Merge branch 'develop' into add_option_pdf_global_with_picture
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -3,7 +3,7 @@
|
||||
*Please:*
|
||||
- *only keep the "Fix", "Close" or "New" section*
|
||||
- *follow the project [contributing guidelines](/.github/CONTRIBUTING.md)*
|
||||
- *replace the bracket enclosed textswith meaningful informations*
|
||||
- *replace the bracket enclosed texts with meaningful information*
|
||||
|
||||
|
||||
# Fix #[*issue_number Short description*]
|
||||
|
||||
41
.travis.yml
@ -9,6 +9,9 @@ dist: xenial
|
||||
|
||||
language: php
|
||||
|
||||
git:
|
||||
depth: 1
|
||||
|
||||
# Start on every boot
|
||||
services:
|
||||
- memcached
|
||||
@ -41,16 +44,20 @@ jobs:
|
||||
#allow_failures:
|
||||
#- php: nightly
|
||||
include:
|
||||
- if: type = push
|
||||
- stage: PHP 5.6-7.4
|
||||
if: type = push
|
||||
php: '5.6'
|
||||
env: DB=postgresql
|
||||
- if: type = pull_request OR type = push
|
||||
- stage: PHP 5.6-7.4
|
||||
if: type = pull_request OR type = push
|
||||
php: '7.4'
|
||||
env: DB=mysql
|
||||
- if: type = push AND branch = develop
|
||||
- stage: PHP Dev
|
||||
if: type = push AND branch = develop
|
||||
php: nightly
|
||||
env: DB=mysql
|
||||
- if: type = push AND branch = 14.0
|
||||
- stage: PHP Dev
|
||||
if: type = push AND branch = 14.0
|
||||
php: nightly
|
||||
env: DB=mysql
|
||||
|
||||
@ -264,24 +271,27 @@ script:
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Checking PHP syntax errors"
|
||||
echo "Checking PHP syntax errors (only 1 version to not overload travis and avoid duplicate tests)"
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
#parallel-lint --exclude htdocs/includes --blame .
|
||||
parallel-lint --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
||||
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
||||
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
||||
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
|
||||
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
if [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then
|
||||
parallel-lint -e php --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
||||
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
||||
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
||||
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
|
||||
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
|
||||
fi
|
||||
set +e
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Checking coding style (excluding Pull Requests builds to not overload travis, excluding also some jobs to avoid duplicate tests)"
|
||||
echo "Checking coding style (only for Pull Requests builds and 1 version to not overload travis and avoid duplicate tests)"
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ] && [ "$DB" = "mysql" ]; then
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then
|
||||
phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .;
|
||||
fi
|
||||
set +e
|
||||
@ -401,11 +411,16 @@ script:
|
||||
php upgrade.php 13.0.0 14.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade13001400.log
|
||||
php upgrade2.php 13.0.0 14.0.0 > $TRAVIS_BUILD_DIR/upgrade13001400-2.log
|
||||
php step5.php 13.0.0 14.0.0 > $TRAVIS_BUILD_DIR/upgrade13001400-3.log
|
||||
ls -alrt $TRAVIS_BUILD_DIR/
|
||||
|
||||
- |
|
||||
echo "Enabling new modules"
|
||||
# Enable modules not enabled into original dump
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_STRIPE > $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
set -e
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_STRIPE,MAIN_MODULE_EXPENSEREPORT > $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_KNOWLEDGEMANAGEMENT,MAIN_MODULE_EVENTORGANIZATION,MAIN_MODULE_PARTNERSHIP >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
echo $?
|
||||
cd -
|
||||
set +e
|
||||
|
||||
32
COPYRIGHT
@ -1,13 +1,24 @@
|
||||
|
||||
License
|
||||
-------
|
||||
Copyright and license
|
||||
----------------------
|
||||
|
||||
Dolibarr is released under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 3 of the License,
|
||||
or (at your option) any later version (GPL-3+).
|
||||
More information: https://www.gnu.org/licenses/gpl-3.0.txt
|
||||
The Dolibarr software as a whole is distributed under the GNU General Public License as published by the Free Software Foundation;
|
||||
either version 3 of the License, or (at your option) any later version (GPL-3+). More information: https://www.gnu.org/licenses/gpl-3.0.txt.
|
||||
A copy of this license is available in the COPYING file.
|
||||
Dolibarr depends on third-party components and code snippets released under their own license (obviously, all compatible with the one of Dolibarr).
|
||||
These dependencies are listed in the bottom of this file.
|
||||
|
||||
Dolibarr uses some external libraries released under different licenses. This is compatibility summary:
|
||||
|
||||
The Dolibarr images resources (available in the doc directory) is distributed under the Creative Commons Attribution 4.0 International license (CC BY 4.0).
|
||||
|
||||
|
||||
The name Dolibarr is a trademark initially registered by Laurent Destailleur and ceased to the Dolibarr foundation. You can use the name Dolibarr
|
||||
for your own need as long as you follow the rules defined on the page https://wiki.dolibarr.org/index.php/Rules_to_use_the_brand_name_%22Dolibarr%22
|
||||
The use of the name DoliStore is also restricted to the same rules defined on https://wiki.dolibarr.org/index.php/Rules_to_use_the_brand_name_%22Dolibarr%22
|
||||
|
||||
|
||||
|
||||
Licence of dependencies of third-party components used by Dolibarr (all compatible with the Licence of Dolibarr):
|
||||
|
||||
Component Version License GPL Compatible Usage
|
||||
-------------------------------------------------------------------------------------
|
||||
@ -28,7 +39,7 @@ php-iban 1.4.7 LGPL-3+ Yes
|
||||
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
|
||||
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
|
||||
PSR/Logs 1.0 Library for logs (used by DebugBar)
|
||||
PSR/simple-cache ? MIT License Yes Library for cache (used by PHPSpreadSheet)
|
||||
PSR/simple-cache ? MIT License Yes Library for cache (used by PHPSpreadSheet)
|
||||
Restler 3.1.1 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer)
|
||||
Sabre 3.2.2 BSD Yes DAV support
|
||||
Swift Mailer 5.4.2-DEV MIT License Yes Comprehensive mailing tools for PHP
|
||||
@ -63,11 +74,10 @@ Font libraries:
|
||||
Fontawesome 5.13 Font Awesome Free Licence Yes
|
||||
|
||||
|
||||
For licenses compatibility informations:
|
||||
https://www.gnu.org/licenses/licenses.en.html
|
||||
For more licenses compatibility informations: https://www.gnu.org/licenses/licenses.en.html
|
||||
|
||||
|
||||
Copyright / Authors
|
||||
Authors
|
||||
-------------------
|
||||
|
||||
See page https://github.com/Dolibarr/dolibarr/graphs/contributors
|
||||
|
||||
316
ChangeLog
@ -3,36 +3,326 @@ English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 15.0.0 compared to 14.0.0 *****
|
||||
|
||||
For developers:
|
||||
---------------
|
||||
|
||||
WARNING:
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook.
|
||||
|
||||
***** ChangeLog for 14.0.0 compared to 13.0.0 *****
|
||||
|
||||
For users:
|
||||
----------
|
||||
NEW: Feature to make inventories
|
||||
NEW: Several security issues after a second private bug bounty campaign.
|
||||
NEW: Module Recruitment to follow application to job positions is now stable.
|
||||
NEW: Feature to make Stock Inventories
|
||||
NEW: Several security issues after a second private bug hunting campaign.
|
||||
NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better)
|
||||
NEW: All main menu entries are using the picto of the module
|
||||
NEW: Add a copy to clipboard button on some fields
|
||||
NEW: Add an example of scheduled job to send email reminder for unpaid invoices
|
||||
NEW: Add some color and picto for the direction of movement
|
||||
NEW: add the column "Channel" into the list of orders
|
||||
NEW: Add the column "alias" of company in the list of proposal, order, invoice
|
||||
NEW: Add the column "Office phone" and "User mobile" in user list
|
||||
NEW: Add the column "Price level" in thirdparty list
|
||||
NEW: Add some company information in the dropdown login menu
|
||||
NEW: Add edit/delete action icons on categories list pages
|
||||
NEW: Add hidden option to auto load input line extrafield into new lines
|
||||
NEW: Add import profile to import BOM
|
||||
NEW: Add link picto to the stock movement on the detail of production
|
||||
NEW: Add mass action "Set tag" for product/service, user, thirdparty, warehouse, project, bank account, members
|
||||
NEW: Add bulk action Validate and Set to billed on order list.
|
||||
NEW: Add possibility to exports userGroups fields on user exports
|
||||
NEW: Can search on lots or serials into the quick search bar
|
||||
NEW: Add support for Friday as a non working day
|
||||
NEW: auto notification with module Notification can use templated emails
|
||||
NEW: Can clone a cron job
|
||||
NEW: Can create a lot from the list view (Look and feel standardization).
|
||||
NEW: Can filter on extrafields date on lists
|
||||
NEW: Can filter on rowid in list of blocked logs
|
||||
NEW: Can hide columns "time consumed" on timesheet per week
|
||||
NEW: Can set an employee on each social contribution
|
||||
NEW: Can set order of execution of hooks
|
||||
NEW: Can toggle FCKeditor on public/private notes
|
||||
NEW: Check update availability for externals modules using a button on module page
|
||||
NEW: Choose lines to use while creating intervention card from origin
|
||||
NEW: Columns shipment method, payment mode, payment term in proposal and order list
|
||||
NEW: Conf for default actioncomm status
|
||||
NEW: Dictionary for availability - Add a column position
|
||||
NEW: Can set a user related to a social contribution
|
||||
NEW: ICS Direct debit can be set with a different value for each bank account
|
||||
NEW: LDAP: usergroup search can be filtered
|
||||
NEW: Make public bookmarks editable by admin users only
|
||||
NEW: If main logo not defined, can use the squarred logo on login page
|
||||
NEW: The manifest file can use the squared image if available
|
||||
NEW: Enhance the multicurrency rate editor
|
||||
NEW: Normalise Type company field with ajax combobox
|
||||
NEW: preload product description on selection for customer propal/order/invoice
|
||||
NEW: Search usergroups & resources
|
||||
NEW: Setup Page for module creation with module builder enhancement #FoundationFunding
|
||||
NEW: Show picto of module into the list of dictionaries
|
||||
NEW: Show the total of payment on the payment confirmation page
|
||||
NEW: The global setup for Mandatory fields can now be done on combo list too.
|
||||
NEW: translate in "en_US" to complete PR 16980
|
||||
NEW: Update the list of taxes available by default for France
|
||||
NEW: Salary payment request and Salary payment are 2 different steps in workflow on Salary payment recording
|
||||
NEW: VAT payment request and VAT payment are now 2 different steps in workflow on VAT payment recording
|
||||
NEW: VAT report - Optimisation & collapse by rate
|
||||
NEW: When a doc file is shared, link is visible from the main page of doc.
|
||||
NEW: #16378 more E-Mail Contact substitution Values for better salutation
|
||||
NEW: option to keep the "Automatically create the payment" checkbox empty on the tax creation page
|
||||
|
||||
Accountancy
|
||||
NEW: Add FEC import
|
||||
NEW: Add a confirmation form with options on export (for notified export and validate operations)
|
||||
NEW: Add select date from/to in already bind customer and supplier list
|
||||
NEW: FEC / FEC2 export - Add new field DateLimitReglmt
|
||||
NEW: In ledger & journals, show link on bank transaction
|
||||
NEW: Possibility to filter on journals in balance
|
||||
NEW: Add a page to list subledger accounts
|
||||
NEW: Multiselect journal code filter on journal / balance / ledger
|
||||
NEW: Add first step to close fiscal year
|
||||
|
||||
Agenda
|
||||
NEW: add support for Friday as a non working day
|
||||
NEW: can show the leave dates/holidays on the agenda view
|
||||
NEW: Support color for types of event
|
||||
|
||||
Bank
|
||||
NEW: Bank Entries : display user linked to a salary or a taxes
|
||||
NEW: Add bulk actions for Bank Transfer
|
||||
|
||||
ECM/GED
|
||||
NEW: add DB fields note_public and note_private for ECM module
|
||||
NEW: can filter files in ECM/GED on status Shared / Not shared
|
||||
|
||||
Invoices
|
||||
NEW: add a check to avoid an invoice date in the future
|
||||
NEW: add the total of margin in invoice list
|
||||
NEW: can set a percentage when creating an invoice from another object
|
||||
NEW: Support down payment on supplier invoice (& some adjustments)
|
||||
|
||||
Margin
|
||||
NEW: add the total of margin in invoice list
|
||||
NEW: add the total of margin in page by user
|
||||
|
||||
Members
|
||||
NEW: #17292 default subscription amount by adherent type
|
||||
NEW: option to automatically create a login/user when a new subscription of a member is done online
|
||||
NEW: option to select membership type on the online payment page for membership subscription or renewal
|
||||
|
||||
Products
|
||||
NEW: Add price min and price min including tax into product export
|
||||
NEW: Add a ref in product customer price
|
||||
NEW: customer ref for product customer prices
|
||||
NEW: Set status of all variants when changing status of parent
|
||||
|
||||
Projects/Tasks
|
||||
NEW: option to automatically close an open project when all its tasks are done (=progress 100%)
|
||||
NEW: can show the project ref into PDF documents
|
||||
NEW: when we add contacts/users to a project, ask to also affect them on tasks
|
||||
NEW: Can hide columns "time consumed" on timesheet per week
|
||||
|
||||
Proposals
|
||||
NEW: add bulk action to set a commercial proposal to status "Refused"
|
||||
NEW: can set a warehouse in a proposal
|
||||
NEW: date and user signature on proposal (Issue 16062) #16980
|
||||
|
||||
Shipment
|
||||
NEW: add option in Workflow module to set a shipment as closed
|
||||
|
||||
TakePOS
|
||||
NEW: delayed payment in TakePOS #14456?
|
||||
NEW: display date range if exist in TakePOS
|
||||
NEW: display resiliate status in TakePOS for member
|
||||
NEW: edit sales lines rights in TakePOS
|
||||
NEW: option for TakePOS to show the total price without tax
|
||||
NEW: more permissions in TakePOS (can edit added line, can modify once order sent to kitchen)
|
||||
|
||||
Third Party / Contacts
|
||||
NEW: add contact tag and bulk email status on the thirdparty + contact create form
|
||||
NEW: can set a warehouse on a thirdparty
|
||||
|
||||
Tickets
|
||||
NEW: can use captcha on public page to create a ticket #16347
|
||||
NEW: can set if a ticket group is visible on public interface or not
|
||||
|
||||
Warehouse/Stock
|
||||
NEW: Feature to make Stock Inventories
|
||||
NEW: can make massive stock transfers from a CSV file
|
||||
NEW: Stock movement list - add more complete date field
|
||||
NEW: can set a warehouse in a proposal
|
||||
NEW: can set a warehouse on a thirdparty
|
||||
|
||||
Website Module
|
||||
NEW: #17113 Can upload a favicon in website module
|
||||
NEW: add a new permission "Export website"
|
||||
NEW: add last date of modification for website pages in the list of pages
|
||||
NEW: Save old page with .old extension on disk when editing a website page
|
||||
|
||||
Workflows
|
||||
NEW: add option in Workflow module to set a shipment as closed
|
||||
|
||||
|
||||
for Admins
|
||||
NEW: Add a security center page with all information and advices related to the security of your instance
|
||||
NEW: Add a performance center page with all information and advices related to the performance of your instance
|
||||
NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better)
|
||||
|
||||
Modules
|
||||
NEW: Module Recruitment is now stable
|
||||
NEW: start new experimental module Event Organization Management
|
||||
NEW: start new experimental module Partnership Management
|
||||
NEW: start new experimental module Knowledge Management
|
||||
NEW: start new experimental module Workstations Management
|
||||
NEW: Check update availability for externals modules using a button on module page
|
||||
Module SimplePOS is deprecated - TakePOS is recommended for the future
|
||||
|
||||
new Options
|
||||
NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
|
||||
NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
|
||||
NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
|
||||
NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field
|
||||
NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
|
||||
NEW: add constant ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY to manage binding with accountancy account declared on thirdparty card
|
||||
NEW: add constant MAIN_PRODUCT_PERENTITY_SHARED to manage some informations (Accounting account) when product is shared on several entities
|
||||
NEW: add constant MAIN_COMPANY_PERENTITY_SHARED to manage some informations (Accounting account) when company is shared on several entities
|
||||
|
||||
|
||||
For developers:
|
||||
---------------
|
||||
* start new module Event Organization Management
|
||||
* start new module Partnership Management
|
||||
* start new module Knowledge Management
|
||||
NEW: Can edit an object property in module builder
|
||||
NEW: Add data-eec=1 for EEC countries on select for js interaction
|
||||
NEW: Add experimental repair script to switch to dynamic row format and utf8mb4 encoding
|
||||
NEW: Add function showValueWithClipboardCPButton() to add a copy/paste
|
||||
NEW: Upgrade Stripe PHP lib to 7.67.0
|
||||
NEW: Support sepa_debit in stripe paymentmethods list
|
||||
NEW: Update doleditor.class.php for easily activate SCAYT
|
||||
NEW: Add triggers in the function add_object_linked(), updateObjectLinked() and deleteObjectLinked()
|
||||
NEW: Add triggers OBJECT_LINK_INSERT, OBJECT_LINK_UPDATE et OBJECT_LINK_DELETE in the function add_object_linked(), updateObjectLinked() and deleteObjectLinked()
|
||||
NEW: can set a target image in dolcropresize function
|
||||
NEW: can set a label as placeholder for combo lists
|
||||
NEW: Add pagination on Get Products response API
|
||||
NEW: Add the DefaultValues CRUD class
|
||||
NEW: Extrafields of documents lines are inside the lines, not any more on separate TR
|
||||
NEW: unit selection on object edit line
|
||||
|
||||
APIs
|
||||
NEW: API add option $includeifobjectisused to get a product
|
||||
NEW: API get the list of product ids only
|
||||
NEW: add link to OpenAPI specifications XML file in REST API module setup: swagger.json file can be included into external tools like redoc
|
||||
NEW: add native compression in REST APIs
|
||||
NEW: Product Variants API, add variant stock to response by parameter
|
||||
NEW: Product API route added to get product stock and product with or without variants #13739 #17390
|
||||
|
||||
Hooks
|
||||
NEW: hook printFieldListTitle for cabyprodserv.php
|
||||
NEW: hook to allow external modules to add their own shortlist of recent objects
|
||||
NEW: SQL-altering hooks in the turnover by product report
|
||||
NEW: add form confirm hook on company card
|
||||
NEW: add hook addSectionECMAuto method to add custom directory into ECM auto files
|
||||
|
||||
|
||||
WARNING:
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* The ICS value for direct debit or credit transfer is now store on each bank account instead of into the global setup.
|
||||
* Module SimplePOS is deprecated. If you need a POS module, please use the module TakePOS.
|
||||
* The ICS value for direct debit or credit transfer is now stored on each bank account instead of into the global setup.
|
||||
* API /setup/shipment_methods has been replaced with API /setup/shipping_methods
|
||||
* Field "total" renamed into to "total_ht" for table llx_facture, llx_facture_rec for better field name consistency
|
||||
* Field "tva" renamed into "total_tva" for table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
|
||||
* Field "total" renamed into "total_ttc" for table lx_propal, llx_supplier_proposal for better field name consistency
|
||||
* If your database is PostgreSql, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT)
|
||||
* If your database is MySql or MariaDB, you need at least version 5.1
|
||||
* Field "total" renamed into "total_ht" for table llx_facture, llx_facture_rec for better field name consistency
|
||||
* Field "tva" renamed into "total_tva" for llx_facture, table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
|
||||
* Field "total" renamed into "total_ttc" for table llx_propal, llx_supplier_proposal for better field name consistency
|
||||
* If your database is PostgreSQL, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT)
|
||||
* If your database is MySQL or MariaDB, you need at least version 5.1
|
||||
* Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules
|
||||
* Removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__)
|
||||
* Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries.
|
||||
* v14 seems to work correctly on PHP v8 but it generates a lot of verbose warnings. Currently, v14 i snot yet officialy supported with PHP 8.
|
||||
|
||||
|
||||
***** ChangeLog for 13.0.4 compared to 13.0.3 *****
|
||||
|
||||
FIX: Allow disabling of a module (not a dangerous action) even if there is problem with token (due to bugged modules).
|
||||
FIX: 13.0 - fatal - missing inclusion of ajax.lib.php for calling 'ajax_autocompleter()'
|
||||
FIX: #17919 pictures in docs
|
||||
FIX: #18006
|
||||
FIX: Accountancy - if we define a date start, automatic binding try to continue to solve old binding
|
||||
FIX: Accountancy - Limit date payment not registered on purchases operations
|
||||
FIX: Can't edit replacement invoice
|
||||
FIX: deposit can create credit note in payment conf
|
||||
FIX: division by zero on create
|
||||
FIX: holiday: balances not updated correctly with pgsql because of case sensitivity field
|
||||
FIX: holiday: status filter parameter has been renamed but not in links it was used
|
||||
FIX: List and Create Companies Left Menus
|
||||
FIX: method exists
|
||||
FIX: need to add payment sum to getlibstatus function in object linked block
|
||||
FIX: permission to close a proposal when using advanced permissions
|
||||
FIX: Problem of z-index with popup and top menu
|
||||
FIX: same thing on supplier orders
|
||||
FIX: Status of invoice when making a replacement invoice
|
||||
FIX: update contact birthday alert
|
||||
|
||||
|
||||
***** ChangeLog for 13.0.3 compared to 13.0.2 *****
|
||||
|
||||
FIX: 13.0 warning - missing quotes around 'label'
|
||||
FIX: #16143 Old PG requires "()" on DROP FUNCTION
|
||||
FIX: #16843
|
||||
FIX: #17060
|
||||
FIX: #17192 - With tz < 0, event is show in bad day on calendar views
|
||||
FIX: #17363
|
||||
FIX: #17476 releve.php: Fix SQL statement
|
||||
FIX: #17967
|
||||
Fix: #17906 : fix access denied
|
||||
FIX: Accountancy - Import in general ledger
|
||||
FIX: Accountancy - Quadra export - wrong data on credit
|
||||
FIX: Accountancy - Warning on the pages of the preparatory statements of accounting entries
|
||||
FIX: Add function price2num for rounding values in productAlertStock box
|
||||
FIX: Add parameter to function price2num()
|
||||
FIX: Cannot delete a batch material from item receipts
|
||||
FIX: cast int
|
||||
FIX: Change parameters MF to MS for price2num() function
|
||||
FIX: create event from contact card preselect contact correctly
|
||||
FIX: create sociales : keep values error form
|
||||
FIX: dol_print_date for %a and %b with some timezone
|
||||
FIX: email is not case sensitive
|
||||
FIX: error for duplicate thirdparty found correctly returned by ws
|
||||
FIX: Espadon PDF shippment model with long public note now working
|
||||
FIX: esupplier order: error 500 when using packaging with product where it is not defined
|
||||
FIX: Filter on debit/credit
|
||||
FIX: Filter on supplier payment list
|
||||
FIX: fix checkbox displayed according to module project setup parameters - work in progress
|
||||
FIX: inconsistency in margin recording with option "Force to sale price"
|
||||
FIX: invoice PDF generation after payment
|
||||
FIX: mask selector fournisseur if module not activate
|
||||
FIX: merge thirparty also work for bank URL entry
|
||||
FIX: Missing extrafields into export of agenda record
|
||||
FIX: missing parameter in select for POP
|
||||
FIX: missing return edit if update error
|
||||
FIX: missing token on dolGetButtonAction for action delete
|
||||
FIX: payment creation: re-generate invoice PDF with correct display options
|
||||
FIX: payment validation: invoices PDF were no re-generated, make it with correct display options
|
||||
FIX: Periodicity by default on fiscal year, according to the now date, we have plus 1 year added
|
||||
FIX: pgsql: prevent 'WHERE 1'
|
||||
FIX: PHP version requirement in composer.json
|
||||
FIX: project visibility field with two option
|
||||
FIX: saving template email
|
||||
FIX: search accented words in product description (consumption page)
|
||||
FIX: Search on date in accountancy
|
||||
FIX: selection of project for reception must use
|
||||
FIX: shhhhhh ! There is nothing here...
|
||||
FIX: Show input field checkbox selection
|
||||
FIX: Show Ref.Supplier in LinkToObjectBlock
|
||||
FIX: SQL Error show_contacts : socialnetworks
|
||||
FIX: Start hour on ACCOUNTING_DATE_START_BINDING
|
||||
FIX: supplier order: error 500 when using packaging with product where it is not defined
|
||||
FIX: test must be === and not ==
|
||||
FIX: test on link type
|
||||
FIX: type link extrafield case for advanced target emailing
|
||||
FIX: Write right on document
|
||||
|
||||
|
||||
***** ChangeLog for 13.0.2 compared to 13.0.1 *****
|
||||
@ -64,7 +354,7 @@ FIX: File attachment on lots/batches
|
||||
FIX: handling $heightforinfotot when he's superior to a page height on Supplier Invoice
|
||||
FIX: hourglass and hide button to pay
|
||||
FIX: massaction validate invoice do not regenerate PDF
|
||||
FIX: missing mp4 video mime
|
||||
FIX: #16627 fix missing mp4 video mime
|
||||
FIX: picto on shipment to reset qty to 0. Some quantities were not reset.
|
||||
FIX: Protection to avoid #16504
|
||||
FIX: rounding amount on card updating
|
||||
|
||||
20
README-FR.md
@ -8,10 +8,12 @@ Il est simple d'utilisation et modulaire, vous permettant de n'activez que les f
|
||||
|
||||

|
||||
|
||||
|
||||
## LICENCE
|
||||
|
||||
Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure.
|
||||
|
||||
|
||||
## INSTALLER DOLIBARR
|
||||
|
||||
### Configuration simple
|
||||
@ -52,6 +54,7 @@ Vous pouvez aussi utiliser un serveur Web et une base de données prise en charg
|
||||
|
||||
- Suivez les instructions de l'installateur
|
||||
|
||||
|
||||
## METTRE A JOUR DOLIBARR
|
||||
|
||||
Pour mettre à jour Dolibarr depuis une vieille version vers celle ci:
|
||||
@ -64,9 +67,11 @@ Pour mettre à jour Dolibarr depuis une vieille version vers celle ci:
|
||||
|
||||
*Note: Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
|
||||
|
||||
|
||||
## CE QUI EST NOUVEAU
|
||||
|
||||
Voir fichier ChangeLog.
|
||||
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
|
||||
|
||||
|
||||
## CE QUE DOLIBARR PEUT FAIRE
|
||||
|
||||
@ -82,15 +87,17 @@ Voir fichier ChangeLog.
|
||||
- Calendrier/Agenda partagé (avec export ical, vcal)
|
||||
- Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...)
|
||||
- Gestion de contrats de services
|
||||
- Gestion de stock
|
||||
- Gestion de stock et inventaires
|
||||
- Gestion des expéditions
|
||||
- Gestion des demandes de congès
|
||||
- Gestion des notes de frais
|
||||
- Gestion de recrutement
|
||||
- GED (Gestion Electronique de Documents)
|
||||
- EMailings de masse
|
||||
- Réalisation de sondages
|
||||
- Gestion d'adhérents
|
||||
- Point de vente/Caisse enregistreuse
|
||||
- …
|
||||
- … (près de 100 modules disponibles en standard, près de 1000 autre sur la place de marché d'extensions)
|
||||
|
||||
### Autres modules
|
||||
|
||||
@ -135,31 +142,36 @@ Voir fichier ChangeLog.
|
||||
|
||||
Dolibarr peut aussi être étendu à volonté avec l'ajout de module/applications externes développées par des développeus tiers, disponible sur [DoliStore](https://www.dolistore.com).
|
||||
|
||||
|
||||
## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE
|
||||
|
||||
Voici un liste de fonctionnalités pas encore gérées par Dolibarr:
|
||||
|
||||
- Dolibarr ne contient pas de module de Gestion de la paie.
|
||||
- Dolibarr ne contient pas de module de génération de feuille de paie.
|
||||
- Les tâches du module de gestion de projets n'ont pas de dépendances entre elle.
|
||||
- Dolibarr n'embarque pas de Webmail intégré nativement.
|
||||
- Dolibarr ne fait pas le café (pas encore).
|
||||
|
||||
|
||||
## DOCUMENTATION
|
||||
|
||||
La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org).
|
||||
|
||||
|
||||
## CONTRIBUER
|
||||
|
||||
Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)].
|
||||
|
||||
<a href="https://github.com/Dolibarr/dolibarr/graphs/contributors"><img src="https://opencollective.com/dolibarr/contributors.svg?width=890&button=false" /></a>
|
||||
|
||||
|
||||
## CREDITS
|
||||
|
||||
Dolibarr est le résultat du travail de nombreux contributeurs depuis des années et utilise des librairies d'autres contributeurs.
|
||||
|
||||
Voir le fichier [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT)
|
||||
|
||||
|
||||
## ACTUALITES ET RESEAUX SOCIAUX
|
||||
|
||||
Suivez le projet Dolibarr project sur les réseaux francophones
|
||||
|
||||
99
README.md
@ -13,7 +13,7 @@ You can freely use, study, modify or distribute it according to its licence.
|
||||
|
||||
You can use it as a standalone application or as a web application to access it from the Internet or a LAN.
|
||||
|
||||
Dolibarr has a large community ready to help you, free forums and [officially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
|
||||
Dolibarr has a large community ready to help you, free forums and [preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
|
||||
|
||||

|
||||
|
||||
@ -79,7 +79,7 @@ If you don't have time to install it yourself, you can try some commercial 'read
|
||||
|
||||
## UPGRADING
|
||||
|
||||
Dolibarr supports upgrading usually wihtout the need for any (commercial) support (depending on if you use any commercial extensions) and supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate!
|
||||
Dolibarr supports upgrading, usually without the need for any (commercial) support (depending on if you use any commercial extensions). It supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate!
|
||||
|
||||
- At first make a backup of your Dolibarr files & than [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr)
|
||||
- Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md).
|
||||
@ -97,48 +97,80 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
|
||||
### Main application/modules (all optional)
|
||||
|
||||
- Customers, Prospects (Leads) and/or Suppliers directory + Contacts
|
||||
- Members/Membership management
|
||||
- Products and/or Services catalog
|
||||
- Commercial proposals management
|
||||
- Customer & Supplier Orders management
|
||||
- Invoices and payment management
|
||||
- Shipping management
|
||||
- Warehouse/Stock management
|
||||
- Manufacturing Orders
|
||||
- Bank accounts management
|
||||
- Direct debit orders management (European SEPA)
|
||||
- Accounting management
|
||||
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||
- Opportunities or Leads management
|
||||
- Projects & Tasks management
|
||||
- Ticket System
|
||||
- Contracts management
|
||||
- Interventions management
|
||||
- Employee's leave requests management
|
||||
- Expense reports
|
||||
- Timesheets
|
||||
- Electronic Document Management (EDM)
|
||||
- Foundations members management
|
||||
- Point of Sale (POS)
|
||||
- …
|
||||
- Third-Parties Management: Customers, Prospects (Leads) and/or Suppliers + Contacts
|
||||
- Members/Membership/Foundation management
|
||||
|
||||
Product Management
|
||||
- Products and/or Services catalog
|
||||
- Stock / Warehouse management + Inventory
|
||||
- Barcodes
|
||||
- Batches / Lots / Serials
|
||||
- Product Variants
|
||||
- Bill of Materials (BOM)
|
||||
- Manufacturing Orders
|
||||
|
||||
Customer/Sales Management
|
||||
- Customers/Prospects + Contacts management
|
||||
- Opportunities or Leads management
|
||||
- Commercial proposals management
|
||||
- Customer Orders management
|
||||
- Contracts/Subscription management
|
||||
- Interventions management
|
||||
- Ticket System
|
||||
- Shipping management
|
||||
- Customer Invoices/Credit notes and payment management
|
||||
- Point of Sale (POS)
|
||||
|
||||
Supplier/Purchase Management
|
||||
- Suppliers/Vendors + Contacts
|
||||
- Supplier (price) requests
|
||||
- Purchase Orders management
|
||||
- Delivery/Receiption
|
||||
- Supplier Invoices/credit notes and payment management
|
||||
- INCOTERMS
|
||||
|
||||
Finance / Accounting
|
||||
- Invoices / Payments
|
||||
- Bank accounts management
|
||||
- Direct debit orders management (European SEPA)
|
||||
- Accounting management
|
||||
- Donations management
|
||||
- Loan management
|
||||
- Margins
|
||||
- Reports
|
||||
|
||||
Collaboration
|
||||
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||
- Projects & Tasks management
|
||||
- Ticket System
|
||||
- Surveys
|
||||
|
||||
HR
|
||||
- Employee's leave requests management
|
||||
- Expense reports
|
||||
- Recruitment management
|
||||
- Timesheets
|
||||
|
||||
|
||||
### Other application/modules
|
||||
|
||||
- Electronic Document Management (EDM)
|
||||
- Bookmarks management
|
||||
- Donations management
|
||||
- Reporting
|
||||
- Surveys
|
||||
- Data export/import
|
||||
- Barcodes support
|
||||
- Barcodes
|
||||
- Margin calculations
|
||||
- LDAP connectivity
|
||||
- ClickToDial integration
|
||||
- Mass emailing
|
||||
- RSS integration
|
||||
- Skype integration
|
||||
- Social platforms linking
|
||||
- Payment platforms integration (PayPal, Stripe, Paybox...)
|
||||
- …
|
||||
- Email-Collector
|
||||
|
||||
(around 100 modules available by default, 1000+ on the addon market place)
|
||||
|
||||
|
||||
### Other general features
|
||||
|
||||
@ -170,9 +202,12 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
|
||||
### System Environment / Requirements
|
||||
|
||||
- Works with PHP 5.6+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite))
|
||||
- PHP
|
||||
- MariaDB, MySQL or PostgreSQL
|
||||
- Compatible with all Cloud solutions that match PHP & MySQL or PostgreSQL prerequisites.
|
||||
|
||||
See exact requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite)
|
||||
|
||||
|
||||
### Extending
|
||||
|
||||
|
||||
@ -157,8 +157,9 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1);
|
||||
// Need to ignore document custom etc. Note: this also ignore natively symbolic links.
|
||||
$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
||||
*/
|
||||
$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
|
||||
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
|
||||
// Define qualified files (must be same than into generate_filelist_xml.php and in api_setup.class.php)
|
||||
$regextoinclude = '\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
|
||||
$regextoexclude = '('.($includecustom?'':'custom|').'documents|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
|
||||
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
||||
|
||||
$dir='';
|
||||
|
||||
@ -245,6 +245,14 @@ RESTLER:
|
||||
// @CHANGE LDR
|
||||
if (!is_string($haystack)) return false;
|
||||
|
||||
* Replace
|
||||
|
||||
$loaders = array_unique(static::$rogueLoaders);
|
||||
|
||||
with
|
||||
|
||||
$loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
|
||||
|
||||
|
||||
+With swagger 2 provided into /explorer:
|
||||
----------------------------------------
|
||||
|
||||
74
dev/examples/zapier/creates/contact.js
Normal file
@ -0,0 +1,74 @@
|
||||
/*jshint esversion: 6 */
|
||||
// create a particular contact by name
|
||||
const createContact = async (z, bundle) => {
|
||||
const apiurl = bundle.authData.url + '/api/index.php/contacts';
|
||||
|
||||
const response = await z.request({
|
||||
method: 'POST',
|
||||
url: apiurl,
|
||||
body: {
|
||||
name: bundle.inputData.name,
|
||||
name_alias: bundle.inputData.name_alias,
|
||||
ref_ext: bundle.inputData.ref_ext,
|
||||
ref_int: bundle.inputData.ref_int,
|
||||
address: bundle.inputData.address,
|
||||
zip: bundle.inputData.zip,
|
||||
town: bundle.inputData.town,
|
||||
country_code: bundle.inputData.country_code,
|
||||
country_id: bundle.inputData.country_id,
|
||||
country: bundle.inputData.country,
|
||||
phone: bundle.inputData.phone,
|
||||
email: bundle.inputData.email,
|
||||
sens: 'fromzapier'
|
||||
}
|
||||
});
|
||||
const result = z.JSON.parse(response.content);
|
||||
// api returns an integer when ok, a json when ko
|
||||
return result.response || {id: response};
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
key: 'contact',
|
||||
noun: 'Contact',
|
||||
|
||||
display: {
|
||||
label: 'Create Contact',
|
||||
description: 'Creates a contact.'
|
||||
},
|
||||
|
||||
operation: {
|
||||
inputFields: [
|
||||
{key: 'name', required: true},
|
||||
{key: 'name_alias', required: false},
|
||||
{key: 'address', required: false},
|
||||
{key: 'zip', required: false},
|
||||
{key: 'town', required: false},
|
||||
{key: 'email', required: false}
|
||||
],
|
||||
perform: createContact,
|
||||
|
||||
sample: {
|
||||
id: 1,
|
||||
name: 'DUPOND',
|
||||
name_alias: 'DUPOND Ltd',
|
||||
address: 'Rue des Canaries',
|
||||
zip: '34090',
|
||||
town: 'MONTPELLIER',
|
||||
phone: '0123456789',
|
||||
fax: '2345678901',
|
||||
email: 'robot@domain.com'
|
||||
},
|
||||
|
||||
outputFields: [
|
||||
{key: 'id', type: "integer", label: 'ID'},
|
||||
{key: 'name', label: 'Name'},
|
||||
{key: 'name_alias', label: 'Name alias'},
|
||||
{key: 'address', label: 'Address'},
|
||||
{key: 'zip', label: 'Zip'},
|
||||
{key: 'town', label: 'Town'},
|
||||
{key: 'phone', label: 'Phone'},
|
||||
{key: 'fax', label: 'Fax'},
|
||||
{key: 'email', label: 'Email'}
|
||||
]
|
||||
}
|
||||
};
|
||||
74
dev/examples/zapier/creates/member.js
Normal file
@ -0,0 +1,74 @@
|
||||
/*jshint esversion: 6 */
|
||||
// create a particular member by name
|
||||
const createMember = async (z, bundle) => {
|
||||
const apiurl = bundle.authData.url + '/api/index.php/members';
|
||||
|
||||
const response = await z.request({
|
||||
method: 'POST',
|
||||
url: apiurl,
|
||||
body: {
|
||||
name: bundle.inputData.name,
|
||||
name_alias: bundle.inputData.name_alias,
|
||||
ref_ext: bundle.inputData.ref_ext,
|
||||
ref_int: bundle.inputData.ref_int,
|
||||
address: bundle.inputData.address,
|
||||
zip: bundle.inputData.zip,
|
||||
town: bundle.inputData.town,
|
||||
country_code: bundle.inputData.country_code,
|
||||
country_id: bundle.inputData.country_id,
|
||||
country: bundle.inputData.country,
|
||||
phone: bundle.inputData.phone,
|
||||
email: bundle.inputData.email,
|
||||
sens: 'fromzapier'
|
||||
}
|
||||
});
|
||||
const result = z.JSON.parse(response.content);
|
||||
// api returns an integer when ok, a json when ko
|
||||
return result.response || {id: response};
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
key: 'member',
|
||||
noun: 'Member',
|
||||
|
||||
display: {
|
||||
label: 'Create Member',
|
||||
description: 'Creates a member.'
|
||||
},
|
||||
|
||||
operation: {
|
||||
inputFields: [
|
||||
{key: 'name', required: true},
|
||||
{key: 'name_alias', required: false},
|
||||
{key: 'address', required: false},
|
||||
{key: 'zip', required: false},
|
||||
{key: 'town', required: false},
|
||||
{key: 'email', required: false}
|
||||
],
|
||||
perform: createMember,
|
||||
|
||||
sample: {
|
||||
id: 1,
|
||||
name: 'DUPOND',
|
||||
name_alias: 'DUPOND Ltd',
|
||||
address: 'Rue des Canaries',
|
||||
zip: '34090',
|
||||
town: 'MONTPELLIER',
|
||||
phone: '0123456789',
|
||||
fax: '2345678901',
|
||||
email: 'robot@domain.com'
|
||||
},
|
||||
|
||||
outputFields: [
|
||||
{key: 'id', type: "integer", label: 'ID'},
|
||||
{key: 'name', label: 'Name'},
|
||||
{key: 'name_alias', label: 'Name alias'},
|
||||
{key: 'address', label: 'Address'},
|
||||
{key: 'zip', label: 'Zip'},
|
||||
{key: 'town', label: 'Town'},
|
||||
{key: 'phone', label: 'Phone'},
|
||||
{key: 'fax', label: 'Fax'},
|
||||
{key: 'email', label: 'Email'}
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -6,7 +6,7 @@ const createThirdparty = async (z, bundle) => {
|
||||
const response = await z.request({
|
||||
method: 'POST',
|
||||
url: apiurl,
|
||||
body: JSON.stringify({
|
||||
body: {
|
||||
name: bundle.inputData.name,
|
||||
name_alias: bundle.inputData.name_alias,
|
||||
ref_ext: bundle.inputData.ref_ext,
|
||||
@ -24,7 +24,7 @@ const createThirdparty = async (z, bundle) => {
|
||||
code_client: bundle.inputData.code_client,
|
||||
code_fournisseur: bundle.inputData.code_fournisseur,
|
||||
sens: 'fromzapier'
|
||||
})
|
||||
}
|
||||
});
|
||||
const result = z.JSON.parse(response.content);
|
||||
// api returns an integer when ok, a json when ko
|
||||
|
||||
@ -2,12 +2,18 @@
|
||||
const triggerAction = require('./triggers/action');
|
||||
const triggerOrder = require('./triggers/order');
|
||||
const triggerThirdparty = require('./triggers/thirdparty');
|
||||
const triggerContact = require('./triggers/contact');
|
||||
const triggerTicket = require('./triggers/ticket');
|
||||
const triggerUser = require('./triggers/user');
|
||||
const triggerMember = require('./triggers/member');
|
||||
|
||||
const searchThirdparty = require('./searches/thirdparty');
|
||||
const searchContact = require('./searches/contact');
|
||||
const searchMember = require('./searches/member');
|
||||
|
||||
const createThirdparty = require('./creates/thirdparty');
|
||||
const createContact = require('./creates/contact');
|
||||
const createMember = require('./creates/member');
|
||||
|
||||
const {
|
||||
config: authentication,
|
||||
@ -62,18 +68,24 @@ const App = {
|
||||
[triggerAction.key]: triggerAction,
|
||||
[triggerOrder.key]: triggerOrder,
|
||||
[triggerThirdparty.key]: triggerThirdparty,
|
||||
[triggerContact.key]: triggerContact,
|
||||
[triggerTicket.key]: triggerTicket,
|
||||
[triggerUser.key]: triggerUser,
|
||||
[triggerMember.key]: triggerMember,
|
||||
},
|
||||
|
||||
// If you want your searches to show up, you better include it here!
|
||||
searches: {
|
||||
[searchThirdparty.key]: searchThirdparty,
|
||||
[searchContact.key]: searchContact,
|
||||
[searchMember.key]: searchMember,
|
||||
},
|
||||
|
||||
// If you want your creates to show up, you better include it here!
|
||||
creates: {
|
||||
[createThirdparty.key]: createThirdparty,
|
||||
[createContact.key]: createContact,
|
||||
[createMember.key]: createMember,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dolibarr",
|
||||
"version": "1.13.0",
|
||||
"version": "1.14.0",
|
||||
"description": "An app for connecting Dolibarr to the Zapier platform.",
|
||||
"repository": "Dolibarr/dolibarr",
|
||||
"homepage": "https://www.dolibarr.org/",
|
||||
@ -11,11 +11,11 @@
|
||||
"test": "mocha --recursive"
|
||||
},
|
||||
"engines": {
|
||||
"node": "8.10.0",
|
||||
"node": "14.0.0",
|
||||
"npm": ">=5.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"zapier-platform-core": "10.1.2"
|
||||
"zapier-platform-core": "11.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "^5.2.0",
|
||||
|
||||
95
dev/examples/zapier/searches/contact.js
Normal file
@ -0,0 +1,95 @@
|
||||
module.exports = {
|
||||
key: 'contact',
|
||||
|
||||
// You'll want to provide some helpful display labels and descriptions
|
||||
// for users. Zapier will put them into the UX.
|
||||
noun: 'Contact',
|
||||
display: {
|
||||
label: 'Find a Contact',
|
||||
description: 'Search for contact.'
|
||||
},
|
||||
|
||||
// `operation` is where we make the call to your API to do the search
|
||||
operation: {
|
||||
// This search only has one search field. Your searches might have just one, or many
|
||||
// search fields.
|
||||
inputFields: [
|
||||
{
|
||||
key: 'lastname',
|
||||
type: 'string',
|
||||
label: 'Lastname',
|
||||
helpText: 'Lastname to limit to the search to (i.e. The company or %company%).'
|
||||
},
|
||||
{
|
||||
key: 'email',
|
||||
type: 'string',
|
||||
label: 'Email',
|
||||
helpText: 'Email to limit to the search to.'
|
||||
}
|
||||
],
|
||||
|
||||
perform: async (z, bundle) => {
|
||||
const url = bundle.authData.url + '/api/index.php/contacts/';
|
||||
|
||||
// Put the search value in a query param. The details of how to build
|
||||
// a search URL will depend on how your API works.
|
||||
let filter = '';
|
||||
if (bundle.inputData.lastname) {
|
||||
filter = "t.lastname like \'%"+bundle.inputData.name+"%\'";
|
||||
}
|
||||
if (bundle.inputData.email) {
|
||||
if (bundle.inputData.lastname) {
|
||||
filter += " and ";
|
||||
}
|
||||
filter += "t.email like \'"+bundle.inputData.email+"\'";
|
||||
}
|
||||
const response = await z.request({
|
||||
url: url,
|
||||
// this parameter avoid throwing errors and let us manage them
|
||||
skipThrowForStatus: true,
|
||||
params: {
|
||||
sqlfilters: filter
|
||||
}
|
||||
});
|
||||
//z.console.log(response);
|
||||
if (response.status != 200) {
|
||||
return [];
|
||||
}
|
||||
return response.json;
|
||||
},
|
||||
|
||||
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
|
||||
// returned records, and have obviously dummy values that we can show to any user.
|
||||
sample: {
|
||||
id: 1,
|
||||
createdAt: 1472069465,
|
||||
name: 'DOE',
|
||||
firstname: 'John',
|
||||
authorId: 1,
|
||||
directions: '1. Boil Noodles\n2.Serve with sauce',
|
||||
style: 'italian'
|
||||
},
|
||||
|
||||
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
|
||||
// field definitions. The result will be used to augment the sample.
|
||||
// outputFields: () => { return []; }
|
||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||
outputFields: [
|
||||
{
|
||||
key: 'id',
|
||||
type: "integer",
|
||||
label: 'ID'
|
||||
},
|
||||
{key: 'createdAt', type: "integer", label: 'Created At'},
|
||||
{key: 'name', label: 'Name'},
|
||||
{key: 'firstname', label: 'Firstname'},
|
||||
{key: 'directions', label: 'Directions'},
|
||||
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||
{
|
||||
key: 'style',
|
||||
label: 'Style'
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
88
dev/examples/zapier/searches/member.js
Normal file
@ -0,0 +1,88 @@
|
||||
module.exports = {
|
||||
key: 'member',
|
||||
|
||||
// You'll want to provide some helpful display labels and descriptions
|
||||
// for users. Zapier will put them into the UX.
|
||||
noun: 'Member',
|
||||
display: {
|
||||
label: 'Find a Member',
|
||||
description: 'Search for member.'
|
||||
},
|
||||
|
||||
// `operation` is where we make the call to your API to do the search
|
||||
operation: {
|
||||
// This search only has one search field. Your searches might have just one, or many
|
||||
// search fields.
|
||||
inputFields: [
|
||||
{
|
||||
key: 'lastname',
|
||||
type: 'string',
|
||||
label: 'Lastname',
|
||||
helpText: 'Lastname to limit to the search to (i.e. The company or %company%).'
|
||||
},
|
||||
{
|
||||
key: 'email',
|
||||
type: 'string',
|
||||
label: 'Email',
|
||||
helpText: 'Email to limit to the search to.'
|
||||
}
|
||||
],
|
||||
|
||||
perform: async (z, bundle) => {
|
||||
const url = bundle.authData.url + '/api/index.php/members/';
|
||||
|
||||
// Put the search value in a query param. The details of how to build
|
||||
// a search URL will depend on how your API works.
|
||||
let filter = '';
|
||||
if (bundle.inputData.lastname) {
|
||||
filter = "t.lastname like \'%" + bundle.inputData.name + "%\'";
|
||||
}
|
||||
if (bundle.inputData.email) {
|
||||
if (bundle.inputData.lastname) {
|
||||
filter += " and ";
|
||||
}
|
||||
filter += "t.email like \'" + bundle.inputData.email + "\'";
|
||||
}
|
||||
const response = await z.request({
|
||||
url: url,
|
||||
// this parameter avoid throwing errors and let us manage them
|
||||
skipThrowForStatus: true,
|
||||
params: {
|
||||
sqlfilters: filter
|
||||
}
|
||||
});
|
||||
//z.console.log(response);
|
||||
if (response.status != 200) {
|
||||
return [];
|
||||
}
|
||||
return response.json;
|
||||
},
|
||||
|
||||
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
|
||||
// returned records, and have obviously dummy values that we can show to any user.
|
||||
sample: {
|
||||
id: 1,
|
||||
createdAt: 1472069465,
|
||||
name: 'DOE',
|
||||
firstname: 'John',
|
||||
authorId: 1,
|
||||
},
|
||||
|
||||
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
|
||||
// field definitions. The result will be used to augment the sample.
|
||||
// outputFields: () => { return []; }
|
||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||
outputFields: [
|
||||
{
|
||||
key: 'id',
|
||||
type: "integer",
|
||||
label: 'ID'
|
||||
},
|
||||
{ key: 'createdAt', type: "integer", label: 'Created At' },
|
||||
{ key: 'name', label: 'Name' },
|
||||
{ key: 'firstname', label: 'Firstname' },
|
||||
{ key: 'authorId', type: "integer", label: 'Author ID' },
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -19,21 +19,43 @@ module.exports = {
|
||||
type: 'string',
|
||||
label: 'Name',
|
||||
helpText: 'Name to limit to the search to (i.e. The company or %company%).'
|
||||
},
|
||||
{
|
||||
key: 'email',
|
||||
type: 'string',
|
||||
label: 'Email',
|
||||
helpText: 'Email to limit to the search to.'
|
||||
}
|
||||
],
|
||||
|
||||
perform: (z, bundle) => {
|
||||
perform: async (z, bundle) => {
|
||||
const url = bundle.authData.url + '/api/index.php/thirdparties/';
|
||||
|
||||
// Put the search value in a query param. The details of how to build
|
||||
// a search URL will depend on how your API works.
|
||||
const options = {
|
||||
params: {
|
||||
sqlfilters: "t.nom like \'%"+bundle.inputData.name+"%\'"
|
||||
let filter = '';
|
||||
if (bundle.inputData.name) {
|
||||
filter = "t.nom like \'%"+bundle.inputData.name+"%\'";
|
||||
}
|
||||
if (bundle.inputData.email) {
|
||||
if (bundle.inputData.name) {
|
||||
filter += " and ";
|
||||
}
|
||||
};
|
||||
|
||||
return z.request(url, options).then(response => JSON.parse(response.content));
|
||||
filter += "t.email like \'"+bundle.inputData.email+"\'";
|
||||
}
|
||||
const response = await z.request({
|
||||
url: url,
|
||||
// this parameter avoid throwing errors and let us manage them
|
||||
skipThrowForStatus: true,
|
||||
params: {
|
||||
sqlfilters: filter
|
||||
}
|
||||
});
|
||||
//z.console.log(response);
|
||||
if (response.status != 200) {
|
||||
return [];
|
||||
}
|
||||
return response.json;
|
||||
},
|
||||
|
||||
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||
|
||||
171
dev/examples/zapier/triggers/contact.js
Normal file
@ -0,0 +1,171 @@
|
||||
const subscribeHook = (z, bundle) => {
|
||||
// `z.console.log()` is similar to `console.log()`.
|
||||
z.console.log('suscribing hook!');
|
||||
|
||||
// bundle.targetUrl has the Hook URL this app should call when an action is created.
|
||||
const data = {
|
||||
url: bundle.targetUrl,
|
||||
event: bundle.event,
|
||||
module: 'contact',
|
||||
action: bundle.inputData.action
|
||||
};
|
||||
|
||||
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: url,
|
||||
method: 'POST',
|
||||
body: data,
|
||||
};
|
||||
|
||||
// You may return a promise or a normal data structure from any perform method.
|
||||
return z.request(options).then((response) => JSON.parse(response.content));
|
||||
};
|
||||
|
||||
const unsubscribeHook = (z, bundle) => {
|
||||
// bundle.subscribeData contains the parsed response JSON from the subscribe
|
||||
// request made initially.
|
||||
z.console.log('unsuscribing hook!');
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||
method: 'DELETE',
|
||||
};
|
||||
|
||||
// You may return a promise or a normal data structure from any perform method.
|
||||
return z.request(options).then((response) => JSON.parse(response.content));
|
||||
};
|
||||
|
||||
const getContact = (z, bundle) => {
|
||||
// bundle.cleanedRequest will include the parsed JSON object (if it's not a
|
||||
// test poll) and also a .querystring property with the URL's query string.
|
||||
const contact = {
|
||||
id: bundle.cleanedRequest.id,
|
||||
name: bundle.cleanedRequest.name,
|
||||
name_alias: bundle.cleanedRequest.name_alias,
|
||||
firstname: bundle.cleanedRequest.firstname,
|
||||
address: bundle.cleanedRequest.address,
|
||||
zip: bundle.cleanedRequest.zip,
|
||||
town: bundle.cleanedRequest.town,
|
||||
email: bundle.cleanedRequest.email,
|
||||
phone_pro: bundle.cleanedRequest.phone_pro,
|
||||
phone_perso: bundle.cleanedRequest.phone_perso,
|
||||
phone_mobile: bundle.cleanedRequest.phone_mobile,
|
||||
authorId: bundle.cleanedRequest.authorId,
|
||||
createdAt: bundle.cleanedRequest.createdAt,
|
||||
action: bundle.cleanedRequest.action
|
||||
};
|
||||
|
||||
return [contact];
|
||||
};
|
||||
|
||||
const getFallbackRealContact = (z, bundle) => {
|
||||
// For the test poll, you should get some real data, to aid the setup process.
|
||||
const module = bundle.inputData.module;
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/contacts/0',
|
||||
};
|
||||
|
||||
return z.request(options).then((response) => [JSON.parse(response.content)]);
|
||||
};
|
||||
|
||||
// const getModulesChoices = (z/*, bundle*/) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const options = {
|
||||
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
// };
|
||||
// const getModulesChoices = () => {
|
||||
// return {
|
||||
// orders: "Order",
|
||||
// invoices: "Invoice",
|
||||
// contacts: "Contact",
|
||||
// contacts: "Contacts"
|
||||
// };
|
||||
// };
|
||||
|
||||
// const getActionsChoices = (z, bundle) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const module = bundle.inputData.module;
|
||||
// const options = {
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
// };
|
||||
|
||||
// We recommend writing your triggers separate like this and rolling them
|
||||
// into the App definition at the end.
|
||||
module.exports = {
|
||||
key: 'contact',
|
||||
|
||||
// You'll want to provide some helpful display labels and descriptions
|
||||
// for users. Zapier will put them into the UX.
|
||||
noun: 'Contact',
|
||||
display: {
|
||||
label: 'New Contact',
|
||||
description: 'Triggers when a new contact action is done in Dolibarr.'
|
||||
},
|
||||
|
||||
// `operation` is where the business logic goes.
|
||||
operation: {
|
||||
|
||||
// `inputFields` can define the fields a user could provide,
|
||||
// we'll pass them in as `bundle.inputData` later.
|
||||
inputFields: [
|
||||
{
|
||||
key: 'action',
|
||||
required: true,
|
||||
type: 'string',
|
||||
helpText: 'Which action of contact this should trigger on.',
|
||||
choices: {
|
||||
create: "Create",
|
||||
modify: "Modify",
|
||||
validate: "Validate",
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
type: 'hook',
|
||||
|
||||
performSubscribe: subscribeHook,
|
||||
performUnsubscribe: unsubscribeHook,
|
||||
|
||||
perform: getContact,
|
||||
performList: getFallbackRealContact,
|
||||
|
||||
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
|
||||
// returned records, and have obviously dummy values that we can show to any user.
|
||||
sample: {
|
||||
id: 1,
|
||||
createdAt: 1472069465,
|
||||
lastname: 'DOE',
|
||||
firstname: 'John',
|
||||
authorId: 1,
|
||||
action: 'create'
|
||||
},
|
||||
|
||||
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
|
||||
// field definitions. The result will be used to augment the sample.
|
||||
// outputFields: () => { return []; }
|
||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||
outputFields: [
|
||||
{key: 'id', type: "integer", label: 'ID'},
|
||||
{key: 'createdAt', label: 'Created At'},
|
||||
{key: 'lastname', label: 'Lastname'},
|
||||
{key: 'firstname', label: 'Firstname'},
|
||||
{key: 'phone', label: 'Phone pro'},
|
||||
{key: 'phone_perso', label: 'Phone perso'},
|
||||
{key: 'phone_mobile', label: 'Phone mobile'},
|
||||
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||
{key: 'action', label: 'Action'}
|
||||
]
|
||||
}
|
||||
};
|
||||
171
dev/examples/zapier/triggers/member.js
Normal file
@ -0,0 +1,171 @@
|
||||
const subscribeHook = (z, bundle) => {
|
||||
// `z.console.log()` is similar to `console.log()`.
|
||||
z.console.log('suscribing hook!');
|
||||
|
||||
// bundle.targetUrl has the Hook URL this app should call when an action is created.
|
||||
const data = {
|
||||
url: bundle.targetUrl,
|
||||
event: bundle.event,
|
||||
module: 'member',
|
||||
action: bundle.inputData.action
|
||||
};
|
||||
|
||||
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: url,
|
||||
method: 'POST',
|
||||
body: data,
|
||||
};
|
||||
|
||||
// You may return a promise or a normal data structure from any perform method.
|
||||
return z.request(options).then((response) => JSON.parse(response.content));
|
||||
};
|
||||
|
||||
const unsubscribeHook = (z, bundle) => {
|
||||
// bundle.subscribeData contains the parsed response JSON from the subscribe
|
||||
// request made initially.
|
||||
z.console.log('unsuscribing hook!');
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||
method: 'DELETE',
|
||||
};
|
||||
|
||||
// You may return a promise or a normal data structure from any perform method.
|
||||
return z.request(options).then((response) => JSON.parse(response.content));
|
||||
};
|
||||
|
||||
const getMember = (z, bundle) => {
|
||||
// bundle.cleanedRequest will include the parsed JSON object (if it's not a
|
||||
// test poll) and also a .querystring property with the URL's query string.
|
||||
const member = {
|
||||
id: bundle.cleanedRequest.id,
|
||||
name: bundle.cleanedRequest.name,
|
||||
name_alias: bundle.cleanedRequest.name_alias,
|
||||
firstname: bundle.cleanedRequest.firstname,
|
||||
address: bundle.cleanedRequest.address,
|
||||
zip: bundle.cleanedRequest.zip,
|
||||
town: bundle.cleanedRequest.town,
|
||||
email: bundle.cleanedRequest.email,
|
||||
phone_pro: bundle.cleanedRequest.phone_pro,
|
||||
phone_perso: bundle.cleanedRequest.phone_perso,
|
||||
phone_mobile: bundle.cleanedRequest.phone_mobile,
|
||||
authorId: bundle.cleanedRequest.authorId,
|
||||
createdAt: bundle.cleanedRequest.createdAt,
|
||||
action: bundle.cleanedRequest.action
|
||||
};
|
||||
|
||||
return [member];
|
||||
};
|
||||
|
||||
const getFallbackRealMember = (z, bundle) => {
|
||||
// For the test poll, you should get some real data, to aid the setup process.
|
||||
const module = bundle.inputData.module;
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/members/0',
|
||||
};
|
||||
|
||||
return z.request(options).then((response) => [JSON.parse(response.content)]);
|
||||
};
|
||||
|
||||
// const getModulesChoices = (z/*, bundle*/) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const options = {
|
||||
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
// };
|
||||
// const getModulesChoices = () => {
|
||||
// return {
|
||||
// orders: "Order",
|
||||
// invoices: "Invoice",
|
||||
// members: "Member",
|
||||
// members: "Members"
|
||||
// };
|
||||
// };
|
||||
|
||||
// const getActionsChoices = (z, bundle) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const module = bundle.inputData.module;
|
||||
// const options = {
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
// };
|
||||
|
||||
// We recommend writing your triggers separate like this and rolling them
|
||||
// into the App definition at the end.
|
||||
module.exports = {
|
||||
key: 'member',
|
||||
|
||||
// You'll want to provide some helpful display labels and descriptions
|
||||
// for users. Zapier will put them into the UX.
|
||||
noun: 'Member',
|
||||
display: {
|
||||
label: 'New Member',
|
||||
description: 'Triggers when a new member action is done in Dolibarr.'
|
||||
},
|
||||
|
||||
// `operation` is where the business logic goes.
|
||||
operation: {
|
||||
|
||||
// `inputFields` can define the fields a user could provide,
|
||||
// we'll pass them in as `bundle.inputData` later.
|
||||
inputFields: [
|
||||
{
|
||||
key: 'action',
|
||||
required: true,
|
||||
type: 'string',
|
||||
helpText: 'Which action of member this should trigger on.',
|
||||
choices: {
|
||||
create: "Create",
|
||||
modify: "Modify",
|
||||
validate: "Validate",
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
type: 'hook',
|
||||
|
||||
performSubscribe: subscribeHook,
|
||||
performUnsubscribe: unsubscribeHook,
|
||||
|
||||
perform: getMember,
|
||||
performList: getFallbackRealMember,
|
||||
|
||||
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
|
||||
// returned records, and have obviously dummy values that we can show to any user.
|
||||
sample: {
|
||||
id: 1,
|
||||
createdAt: 1472069465,
|
||||
lastname: 'DOE',
|
||||
firstname: 'John',
|
||||
authorId: 1,
|
||||
action: 'create'
|
||||
},
|
||||
|
||||
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
|
||||
// field definitions. The result will be used to augment the sample.
|
||||
// outputFields: () => { return []; }
|
||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||
outputFields: [
|
||||
{key: 'id', type: "integer", label: 'ID'},
|
||||
{key: 'createdAt', label: 'Created At'},
|
||||
{key: 'lastname', label: 'Lastname'},
|
||||
{key: 'firstname', label: 'Firstname'},
|
||||
{key: 'phone', label: 'Phone pro'},
|
||||
{key: 'phone_perso', label: 'Phone perso'},
|
||||
{key: 'phone_mobile', label: 'Phone mobile'},
|
||||
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||
{key: 'action', label: 'Action'}
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -56,6 +56,12 @@ const getThirdparty = (z, bundle) => {
|
||||
fournisseur: bundle.cleanedRequest.fournisseur,
|
||||
code_client: bundle.cleanedRequest.code_client,
|
||||
code_fournisseur: bundle.cleanedRequest.code_fournisseur,
|
||||
idprof1: bundle.cleanedRequest.idprof1,
|
||||
idprof2: bundle.cleanedRequest.idprof2,
|
||||
idprof3: bundle.cleanedRequest.idprof3,
|
||||
idprof4: bundle.cleanedRequest.idprof4,
|
||||
idprof5: bundle.cleanedRequest.idprof5,
|
||||
idprof6: bundle.cleanedRequest.idprof6,
|
||||
authorId: bundle.cleanedRequest.authorId,
|
||||
createdAt: bundle.cleanedRequest.createdAt,
|
||||
action: bundle.cleanedRequest.action
|
||||
@ -112,7 +118,7 @@ module.exports = {
|
||||
noun: 'Thirdparty',
|
||||
display: {
|
||||
label: 'New Thirdparty',
|
||||
description: 'Triggers when a new thirdpaty action is done in Dolibarr.'
|
||||
description: 'Triggers when a new thirdparty action is done in Dolibarr.'
|
||||
},
|
||||
|
||||
// `operation` is where the business logic goes.
|
||||
@ -170,7 +176,13 @@ module.exports = {
|
||||
{key: 'client', label: 'Customer/Prospect 0/1/2/3'},
|
||||
{key: 'fournisseur', label: 'Supplier 0/1'},
|
||||
{key: 'code_client', label: 'Customer code'},
|
||||
{key: 'code_fournisseur', label: 'Supplier code'}
|
||||
{key: 'code_fournisseur', label: 'Supplier code'},
|
||||
{key: 'idprof1', label: 'Id Prof 1'},
|
||||
{key: 'idprof2', label: 'Id Prof 2'},
|
||||
{key: 'idprof3', label: 'Id Prof 3'},
|
||||
{key: 'idprof4', label: 'Id Prof 4'},
|
||||
{key: 'idprof5', label: 'Id Prof 5'},
|
||||
{key: 'idprof6', label: 'Id Prof 6'}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
@ -5503,7 +5503,7 @@ CREATE TABLE `llx_product` (
|
||||
|
||||
LOCK TABLES `llx_product` WRITE;
|
||||
/*!40000 ALTER TABLE `llx_product` DISABLE KEYS */;
|
||||
INSERT INTO `llx_product` VALUES (1,'2010-07-08 14:33:17','2013-03-12 09:30:24',0,0,'PIDRESS',1,NULL,'Pink dress','A beatifull pink dress','',NULL,NULL,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',20,NULL,0,'','',NULL,100,0,NULL,0,NULL,0,NULL,0,2,0.00000000,NULL,1,0,NULL,0),(2,'2010-07-09 00:30:01','2013-01-19 17:31:58',0,0,'Product_P1',1,NULL,'Product P1','','','',32,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,998,0.00000000,NULL,0,0,NULL,0),(3,'2010-07-09 00:30:25','2012-12-08 13:11:14',0,0,'Service_S1',1,NULL,'Service S1','','',NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,1,'1m',NULL,NULL,0,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,0,0,NULL,0),(4,'2010-07-10 14:44:06','2013-01-19 17:22:48',0,0,'DECAP',1,NULL,'Decapsuleur','','',NULL,NULL,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,2,-3,NULL,0,NULL,0,NULL,0,1001,10.00000000,NULL,1,0,NULL,0),(5,'2011-07-20 23:11:38','2011-07-27 17:02:59',0,0,'aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(6,'2011-07-29 22:16:44','2011-07-29 20:16:44',0,0,'Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(7,'2011-07-29 22:31:21','2011-07-29 20:31:21',0,0,'Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(8,'2011-07-29 22:46:54','2011-07-29 20:46:54',0,0,'Copy_of_Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(10,'2008-12-31 00:00:00','2012-12-08 13:11:14',0,0,'PR123456',1,NULL,'My product','This is a description example for record','Some note',NULL,NULL,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,0.000,NULL,0,0,0,'1y',0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,0,'20110729232310',0),(11,'2013-01-13 20:24:42','2013-01-19 17:22:48',0,0,'gh',1,NULL,'hfghf','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,-1,0.00000000,'',1,0,NULL,0);
|
||||
INSERT INTO `llx_product` VALUES (1,'2010-07-08 14:33:17','2013-03-12 09:30:24',0,0,'PINKDRESS',1,NULL,'Pink dress','A beatifull pink dress','',NULL,NULL,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',20,NULL,0,'','',NULL,100,0,NULL,0,NULL,0,NULL,0,2,0.00000000,NULL,1,0,NULL,0),(2,'2010-07-09 00:30:01','2013-01-19 17:31:58',0,0,'Product_P1',1,NULL,'Product P1','','','',32,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,998,0.00000000,NULL,0,0,NULL,0),(3,'2010-07-09 00:30:25','2012-12-08 13:11:14',0,0,'Service_S1',1,NULL,'Service S1','','',NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,1,'1m',NULL,NULL,0,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,0,0,NULL,0),(4,'2010-07-10 14:44:06','2013-01-19 17:22:48',0,0,'DECAP',1,NULL,'Decapsuleur','','',NULL,NULL,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,2,-3,NULL,0,NULL,0,NULL,0,1001,10.00000000,NULL,1,0,NULL,0),(5,'2011-07-20 23:11:38','2011-07-27 17:02:59',0,0,'aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(6,'2011-07-29 22:16:44','2011-07-29 20:16:44',0,0,'Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(7,'2011-07-29 22:31:21','2011-07-29 20:31:21',0,0,'Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(8,'2011-07-29 22:46:54','2011-07-29 20:46:54',0,0,'Copy_of_Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(10,'2008-12-31 00:00:00','2012-12-08 13:11:14',0,0,'PR123456',1,NULL,'My product','This is a description example for record','Some note',NULL,NULL,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,0.000,NULL,0,0,0,'1y',0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,0,'20110729232310',0),(11,'2013-01-13 20:24:42','2013-01-19 17:22:48',0,0,'gh',1,NULL,'hfghf','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,-1,0.00000000,'',1,0,NULL,0);
|
||||
/*!40000 ALTER TABLE `llx_product` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
@ -1 +1,4 @@
|
||||
http://bitboost.com/ref/international-address-formats.html#Formats
|
||||
https://bitboost.com/ref/international-address-formats.html#Formats
|
||||
|
||||
https://www.upu.int/en/Postal-Solutions/Programmes-Services/Addressing-Solutions
|
||||
|
||||
|
||||
@ -1 +1,5 @@
|
||||
http://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=LST_CLS_DLD&StrNom=NACE_REV2&StrLanguageCode=FR&StrLayoutCode=#
|
||||
NACE
|
||||
|
||||
https://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=LST_CLS_DLD&StrNom=NACE_REV2&StrLanguageCode=EN&StrLayoutCode=
|
||||
|
||||
https://en.wikipedia.org/wiki/Statistical_Classification_of_Economic_Activities_in_the_European_Community
|
||||
|
||||
@ -3,11 +3,12 @@
|
||||
# The list is updated whenever a change to the official code list in ISO 3166-1 is effected by the ISO 3166/MA.
|
||||
# It lists 240 official short names and code elements. One line of text contains one entry.
|
||||
# A country name and its code element are separated by a semicolon (;).
|
||||
# http://www.iso.org/iso/fr/iso3166_en_code_lists.txt
|
||||
# https://www.iso.org/iso-3166-country-codes.html
|
||||
|
||||
# ISO-3166: http://en.wikipedia.org/wiki/ISO_3166-1
|
||||
# ISO-3166 alpha 2: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
||||
# ISO-3166 alpha 3: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
|
||||
# https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
|
||||
# ISO-3166: https://en.wikipedia.org/wiki/ISO_3166-1
|
||||
# ISO-3166 alpha 2: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
||||
# ISO-3166 alpha 3: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
|
||||
|
||||
AFGHANISTAN;AF
|
||||
ÅLAND ISLANDS;AX
|
||||
@ -254,4 +255,4 @@ WALLIS AND FUTUNA;WF
|
||||
WESTERN SAHARA;EH
|
||||
YEMEN;YE
|
||||
ZAMBIA;ZM
|
||||
ZIMBABWE;ZW
|
||||
ZIMBABWE;ZW
|
||||
|
||||
@ -3,11 +3,12 @@
|
||||
# The list is updated whenever a change to the official code list in ISO 3166-1 is effected by the ISO 3166/MA.
|
||||
# It lists 240 official short names and code elements. One line of text contains one entry.
|
||||
# A country name and its code element are separated by a semicolon (;).
|
||||
# http://www.iso.org/iso/fr/iso3166_fr_code_lists.txt
|
||||
# https://www.iso.org/fr/iso-3166-country-codes.html
|
||||
|
||||
# ISO-3166: http://en.wikipedia.org/wiki/ISO_3166-1
|
||||
# ISO-3166 alpha 2: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
||||
# ISO-3166 alpha 3: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
|
||||
# https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
|
||||
# ISO-3166: https://fr.wikipedia.org/wiki/ISO_3166-1
|
||||
# ISO-3166 alpha 2: https://fr.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
||||
# ISO-3166 alpha 3: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
|
||||
|
||||
AFGHANISTAN;AF
|
||||
AFRIQUE DU SUD;ZA
|
||||
@ -254,4 +255,4 @@ VIET NAM;VN
|
||||
WALLIS ET FUTUNA;WF
|
||||
YÉMEN;YE
|
||||
ZAMBIE;ZM
|
||||
ZIMBABWE;ZW
|
||||
ZIMBABWE;ZW
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
|
||||
For languages:
|
||||
http://demo.icu-project.org/icu-bin/locexp?d_=fr
|
||||
https://icu4c-demos.unicode.org/icu-bin/icudemos - Locale Explorer -> Error 404
|
||||
|
||||
For format number:
|
||||
http://en.wikipedia.org/wiki/Decimal_mark
|
||||
https://en.wikipedia.org/wiki/Decimal_mark
|
||||
|
||||
For date format:
|
||||
http://en.wikipedia.org/wiki/Date_format_by_country
|
||||
https://en.wikipedia.org/wiki/Date_format_by_country
|
||||
|
||||
@ -1 +1,7 @@
|
||||
http://en.wikipedia.org/wiki/VAT_identification_number
|
||||
https://en.wikipedia.org/wiki/VAT_identification_number
|
||||
|
||||
terms
|
||||
(en) VAT = Value Added Tax
|
||||
(fr) TVA = Taxe sur la Valeur Ajouté
|
||||
(es) NIF / CIF
|
||||
(de) USt / MwSt
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
http://www.taxrates.cc/index.html
|
||||
https://en.wikipedia.org/wiki/List_of_countries_by_tax_rates
|
||||
|
||||
For India: VAT=IGST/CGST=Localtax1/SGST=Localtax2: https://cleartax.in/s/what-is-sgst-cgst-igst
|
||||
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
https://en.wikipedia.org/wiki/Single_Euro_Payments_Area
|
||||
https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html
|
||||
https://www.europeanpaymentscouncil.eu/about-sepa
|
||||
|
||||
Spec for credit transfer:
|
||||
https://docs.oracle.com/cd/E39124_01/doc.91/e60210/fields_sepa_pay_file_appx.htm#EOAEL00515
|
||||
|
||||
|
||||
@ -10,6 +10,11 @@ To run phpcs:
|
||||
> cd dolibarrgitrepo
|
||||
> phpcs --standard=dev/setup/codesniffer/ruleset.xml --extensions=php --parallel=8 .
|
||||
|
||||
To fix with phpcbf:
|
||||
> cd dolibarrgitrepo
|
||||
> phpcbf --standard=dev/setup/codesniffer/ruleset.xml --extensions=php --parallel=8 .
|
||||
|
||||
|
||||
Note with Eclipse: You must setup the PTI plugin of Eclipse into PHPCodeSniffer menu with:
|
||||
* tab value to 4
|
||||
* path of code sniffer standard to dev/codesniffer
|
||||
|
||||
145
dev/tools/spider.php
Normal file
@ -0,0 +1,145 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file dev/tools/spider.php
|
||||
* \brief Script to spider Dolibarr app.
|
||||
*
|
||||
* To use it:
|
||||
* - Disable module "bookmark"
|
||||
* - Exclude param optioncss, token, sortfield, sortorder
|
||||
*/
|
||||
|
||||
$crawledLinks=array();
|
||||
const MAX_DEPTH=2;
|
||||
|
||||
|
||||
/**
|
||||
* @param string $url URL
|
||||
* @param string $depth Depth
|
||||
* @return string String
|
||||
*/
|
||||
function followLink($url, $depth = 0)
|
||||
{
|
||||
global $crawledLinks;
|
||||
$crawling=array();
|
||||
if ($depth>MAX_DEPTH) {
|
||||
echo "<div style='color:red;'>The Crawler is giving up!</div>";
|
||||
return;
|
||||
}
|
||||
$options=array(
|
||||
'http'=>array(
|
||||
'method'=>"GET",
|
||||
'user-agent'=>"gfgBot/0.1\n"
|
||||
)
|
||||
);
|
||||
$context=stream_context_create($options);
|
||||
$doc=new DomDocument();
|
||||
@$doc->loadHTML(file_get_contents($url, false, $context));
|
||||
$links=$doc->getElementsByTagName('a');
|
||||
$pageTitle=getDocTitle($doc, $url);
|
||||
$metaData=getDocMetaData($doc);
|
||||
foreach ($links as $i) {
|
||||
$link=$i->getAttribute('href');
|
||||
if (ignoreLink($link)) continue;
|
||||
$link=convertLink($url, $link);
|
||||
if (!in_array($link, $crawledLinks)) {
|
||||
$crawledLinks[]=$link;
|
||||
$crawling[]=$link;
|
||||
insertIntoDatabase($link, $pageTitle, $metaData, $depth);
|
||||
}
|
||||
}
|
||||
foreach ($crawling as $crawlURL)
|
||||
followLink($crawlURL, $depth+1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $site Site
|
||||
* @param string $path Path
|
||||
* @return string String
|
||||
*/
|
||||
function convertLink($site, $path)
|
||||
{
|
||||
if (substr_compare($path, "//", 0, 2)==0)
|
||||
return parse_url($site)['scheme'].$path;
|
||||
elseif (substr_compare($path, "http://", 0, 7)==0 or
|
||||
substr_compare($path, "https://", 0, 8)==0 or
|
||||
substr_compare($path, "www.", 0, 4)==0)
|
||||
return $path;
|
||||
else return $site.'/'.$path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url URL
|
||||
* @return boolean
|
||||
*/
|
||||
function ignoreLink($url)
|
||||
{
|
||||
return $url[0]=="#" or substr($url, 0, 11) == "javascript:";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $link URL
|
||||
* @param string $title Title
|
||||
* @param string $metaData Array
|
||||
* @param int $depth Depth
|
||||
* @return void
|
||||
*/
|
||||
function insertIntoDatabase($link, $title, &$metaData, $depth)
|
||||
{
|
||||
//global $crawledLinks;
|
||||
|
||||
echo "Inserting new record {URL= ".$link.", Title = '$title', Description = '".$metaData['description']."', Keywords = ' ".$metaData['keywords']."'}<br/><br/><br/>";
|
||||
|
||||
//²$crawledLinks[]=$link;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $doc Doc
|
||||
* @param string $url URL
|
||||
* @return string URL/Title
|
||||
*/
|
||||
function getDocTitle(&$doc, $url)
|
||||
{
|
||||
$titleNodes=$doc->getElementsByTagName('title');
|
||||
if (count($titleNodes)==0 or !isset($titleNodes[0]->nodeValue))
|
||||
return $url;
|
||||
$title=str_replace('', '\n', $titleNodes[0]->nodeValue);
|
||||
return (strlen($title)<1)?$url:$title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $doc Doc
|
||||
* @return array Array
|
||||
*/
|
||||
function getDocMetaData(&$doc)
|
||||
{
|
||||
$metaData=array();
|
||||
$metaNodes=$doc->getElementsByTagName('meta');
|
||||
foreach ($metaNodes as $node)
|
||||
$metaData[$node->getAttribute("name")] = $node->getAttribute("content");
|
||||
if (!isset($metaData['description']))
|
||||
$metaData['description']='No Description Available';
|
||||
if (!isset($metaData['keywords'])) $metaData['keywords']='';
|
||||
return array(
|
||||
'keywords'=>str_replace('', '\n', $metaData['keywords']),
|
||||
'description'=>str_replace('', '\n', $metaData['description'])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
followLink("http://localhost/dolibarr_dev/htdocs");
|
||||
@ -10,17 +10,16 @@
|
||||
https://github.com/Dolibarr/foundation
|
||||
|
||||
|
||||
* Few icons are / were from website led24.de
|
||||
|
||||
* Attention: This website is no longer available!
|
||||
# LICENCE OF IMAGE RESOURCES
|
||||
--------------------------------
|
||||
|
||||
This is original README file for this source:
|
||||
-------------------------------------------------------
|
||||
* All image resources (except dolihelp.ico and doliadmin.ico) in this directory are distributed under licence CC BY-SA
|
||||
|
||||
List of icons from http://led24.de/iconset/ are:
|
||||
- doliadmin.ico
|
||||
- dolihelp.ico
|
||||
|
||||
This is original README file for the package with this 2 images:
|
||||
You can do whatever you want with these icons (use on web or in desktop applications) as long as you don’t pass them off as your own and remove this readme file. A credit statement and a link back to
|
||||
http://led24.de/iconset/ or http://led24.de/ would be appreciated.
|
||||
|
||||
Follow us on twitter http://twitter.com/gasyoun or email leds24@gmail.com
|
||||
512 icons 20/05/2009
|
||||
-------------------------------------------------------
|
||||
List of icons from http://led24.de/iconset/ are:
|
||||
- dolihelp.ico
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 443 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 412 B After Width: | Height: | Size: 2.1 KiB |
BIN
doc/images/appicon_32.ico
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 693 B After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@ -19,7 +19,7 @@ Download
|
||||
Install
|
||||
--------------------------------
|
||||
|
||||
* For a Quick guide, take a look at README file into root directory.
|
||||
* For a Quick guide, take a look at README.md file into root directory.
|
||||
|
||||
* More complete documentations are also available on line on the Dolibarr Wiki:
|
||||
https://wiki.dolibarr.org
|
||||
|
||||
@ -23,7 +23,7 @@ Download / Herunterladen
|
||||
Installation / Hilfe
|
||||
------------------------------------
|
||||
|
||||
* Für eine kurze Einleitung schau in die README Datei im Hauptverzeichnis.
|
||||
* Für eine kurze Einleitung schau in die README.md Datei im Hauptverzeichnis.
|
||||
|
||||
* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden:
|
||||
https://wiki.dolibarr.org/index.php/Hauptseite
|
||||
|
||||
@ -20,9 +20,7 @@ https://www.dolistore.com
|
||||
Documentation utilisateur
|
||||
--------------------------------
|
||||
|
||||
* Pour une prise en main et installation rapide, consultez le fichier
|
||||
README-FR à la racine.
|
||||
* Pour une prise en main et installation rapide, consultez le fichier README-FR.md à la racine.
|
||||
|
||||
* Une documentation utilisateur francophone plus consistante est disponible en
|
||||
ligne sur le wiki de Dolibarr à l'adresse:
|
||||
https://wiki.dolibarr.org/index.php/Accueil
|
||||
* Une documentation utilisateur francophone plus consistante est disponible en ligne sur le wiki de Dolibarr à l'adresse:
|
||||
https://wiki.dolibarr.org
|
||||
|
||||
@ -4,4 +4,5 @@ User guide
|
||||
--------------------------------
|
||||
|
||||
* All Dolibarr guides are available, on line, on the Dolibarr Web site:
|
||||
|
||||
https://www.dolibarr.org
|
||||
|
||||
@ -7,9 +7,7 @@ Benutzeranleitung
|
||||
|
||||
Alle Dolibarr-Informationen sind online verfuegbar ueber die Webseiten:
|
||||
|
||||
|
||||
https://www.dolibarr.de (de) oder https://www.dolibarr.org (intl)
|
||||
|
||||
|
||||
https://wiki.dolibarr.org/index.php/Hauptseite (de)
|
||||
|
||||
@ -3,9 +3,6 @@ README (french)
|
||||
Documentation utilisateur
|
||||
--------------------------------
|
||||
|
||||
* Pour une prise en main et installation rapide, consultez le fichier
|
||||
README-FR à la racine.
|
||||
La documentation utilisateur francophone est disponible en ligne sur le site Web de Dolibarr à l'adresse:
|
||||
|
||||
* Une documentation utilisateur francophone plus consistante est disponible en
|
||||
ligne sur le site Web de Dolibarr à l'adresse:
|
||||
https://www.dolibarr.fr
|
||||
|
||||
@ -609,10 +609,12 @@ if ($id) {
|
||||
print '</tr>';
|
||||
|
||||
if ($num) {
|
||||
$i = 0;
|
||||
// Lines with values
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
//print_r($obj);
|
||||
|
||||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||
@ -708,6 +710,7 @@ if ($id) {
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -444,7 +444,7 @@ if ($search_country_id > 0) {
|
||||
} else {
|
||||
$sql .= " WHERE ";
|
||||
}
|
||||
$sql .= " (a.fk_country = ".$search_country_id." OR a.fk_country = 0)";
|
||||
$sql .= " (a.fk_country = ".((int) $search_country_id)." OR a.fk_country = 0)";
|
||||
}
|
||||
|
||||
// If sort order is "country", we use country_code instead
|
||||
|
||||
@ -91,7 +91,6 @@ if ($action == 'update') {
|
||||
if (!$error) {
|
||||
foreach ($list as $constname) {
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
var_dump($constname);
|
||||
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
@ -259,7 +258,7 @@ llxHeader('', $title);
|
||||
|
||||
$linkback = '';
|
||||
//$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'accountancy');
|
||||
print load_fiche_titre($title, $linkback, 'accountancy');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
@ -68,7 +68,9 @@ if ($search_accountancy_code_end == - 1) {
|
||||
$search_accountancy_code_end = '';
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new BookKeeping($db);
|
||||
$hookmanager->initHooks(array('balancelist')); // Note that conf->hooks_modules contains array
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$formother = new FormOther($db);
|
||||
@ -155,16 +157,23 @@ if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
* Action
|
||||
*/
|
||||
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
||||
$show_subgroup = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_accountancy_code_start = '';
|
||||
$search_accountancy_code_end = '';
|
||||
$search_ledger_code = array();
|
||||
$filter = array();
|
||||
$parameters = array('socid'=>$socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
||||
$show_subgroup = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_accountancy_code_start = '';
|
||||
$search_accountancy_code_end = '';
|
||||
$search_ledger_code = array();
|
||||
$filter = array();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -183,11 +192,11 @@ if ($action == 'export_csv') {
|
||||
}
|
||||
|
||||
foreach ($object->lines as $line) {
|
||||
print length_accountg($line->numero_compte).$sep;
|
||||
print $object->get_compte_desc($line->numero_compte).$sep;
|
||||
print price($line->debit).$sep;
|
||||
print price($line->credit).$sep;
|
||||
print price($line->debit - $line->credit).$sep;
|
||||
print '"'.length_accountg($line->numero_compte).'"'.$sep;
|
||||
print '"'.$object->get_compte_desc($line->numero_compte).'"'.$sep;
|
||||
print '"'.price($line->debit).'"'.$sep;
|
||||
print '"'.price($line->credit).'"'.$sep;
|
||||
print '"'.price($line->debit - $line->credit).'"'.$sep;
|
||||
print "\n";
|
||||
}
|
||||
|
||||
@ -226,22 +235,28 @@ if ($action != 'export_csv') {
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
$button = '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
$button = '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
|
||||
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#exportcsvbutton").click(function() {
|
||||
event.preventDefault();
|
||||
console.log("Set action to export_csv");
|
||||
jQuery("#action").val("export_csv");
|
||||
jQuery("#searchFormList").submit();
|
||||
jQuery("#action").val("list");
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#exportcsvbutton").click(function() {
|
||||
event.preventDefault();
|
||||
console.log("Set action to export_csv");
|
||||
jQuery("#action").val("export_csv");
|
||||
jQuery("#searchFormList").submit();
|
||||
jQuery("#action").val("list");
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
</script>';
|
||||
}
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
$selectedfields = '';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
@ -283,12 +298,18 @@ if ($action != 'export_csv') {
|
||||
print ' ';
|
||||
print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, '', 'accounts');
|
||||
print '</td>';
|
||||
print '<td class="liste_titre center">';
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Action column
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
||||
@ -298,8 +319,14 @@ if ($action != 'export_csv') {
|
||||
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" class="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
$total_debit = 0;
|
||||
$total_credit = 0;
|
||||
@ -361,7 +388,7 @@ if ($action != 'export_csv') {
|
||||
} elseif (empty($tmparrayforrootaccount['label'])) {
|
||||
// $tmparrayforrootaccount['label'] not defined = the account has not parent with a parent.
|
||||
// This is useless, we should not create a new account when an account has no parent, we must edit it to fix its parent.
|
||||
// BUG 1: Accounts on level root or level 1 must not have a parent 2 level higher, so shoule not show a link to create another account.
|
||||
// BUG 1: Accounts on level root or level 1 must not have a parent 2 level higher, so should not show a link to create another account.
|
||||
// BUG 2: Adding a link to create a new accounting account here is useless because it is not add as parent of the orphelin.
|
||||
//$link = '<a href="' . DOL_URL_ROOT . '/accountancy/admin/card.php?action=create&token=' . newToken() . '&accountingaccount=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
|
||||
}
|
||||
@ -374,14 +401,14 @@ if ($action != 'export_csv') {
|
||||
print '<tr class="liste_total">';
|
||||
print '<td class="right">'.$langs->trans("SubTotal").':</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">'.price($sous_total_opening_balance).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_opening_balance).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
|
||||
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">'.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit)).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit)).'</td>';
|
||||
} else {
|
||||
print '<td class="nowrap right">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
|
||||
}
|
||||
print "<td></td>\n";
|
||||
print '</tr>';
|
||||
@ -402,7 +429,7 @@ if ($action != 'export_csv') {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$accounting_account.'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowraponall right">'.price($opening_balance).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($opening_balance).'</td>';
|
||||
}
|
||||
|
||||
$urlzoom = '';
|
||||
@ -416,14 +443,14 @@ if ($action != 'export_csv') {
|
||||
}
|
||||
}
|
||||
// Debit
|
||||
print '<td class="nowraponall right"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>';
|
||||
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>';
|
||||
// Credit
|
||||
print '<td class="nowraponall right"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>';
|
||||
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>';
|
||||
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowraponall right">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
|
||||
} else {
|
||||
print '<td class="nowraponall right">'.price(price2num($line->debit - $line->credit, 'MT')).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($line->debit - $line->credit, 'MT')).'</td>';
|
||||
}
|
||||
print '<td class="center">';
|
||||
print $link;
|
||||
@ -439,14 +466,14 @@ if ($action != 'export_csv') {
|
||||
if (!empty($show_subgroup)) {
|
||||
print '<tr class="liste_total"><td class="right">'.$langs->trans("SubTotal").':</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">'.price($sous_total_opening_balance).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_opening_balance).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
|
||||
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
||||
print '<td class="right nowraponall amount">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
||||
} else {
|
||||
print '<td class="nowrap right">' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
||||
print '<td class="right nowraponall amount">' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
||||
}
|
||||
print "<td></td>\n";
|
||||
print '</tr>';
|
||||
@ -456,12 +483,12 @@ if ($action != 'export_csv') {
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">'.price($total_opening_balance).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($total_debit).'</td>';
|
||||
print '<td class="nowrap right">'.price($total_credit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($total_debit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($total_credit).'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
|
||||
print '<td class="right nowraponall amount">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
|
||||
} else {
|
||||
print '<td class="nowrap right">' . price(price2num($total_debit - $total_credit, 'MT')) . '</td>';
|
||||
print '<td class="right nowraponall amount">' . price(price2num($total_debit - $total_credit, 'MT')) . '</td>';
|
||||
}
|
||||
print "<td></td>\n";
|
||||
print '</tr>';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
@ -537,6 +537,22 @@ if ($action == 'create') {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date document creation
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans("DateExport").'</td>';
|
||||
print '<td>';
|
||||
print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date document creation
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>';
|
||||
print '<td>';
|
||||
print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Validate
|
||||
/*
|
||||
print '<tr>';
|
||||
@ -619,7 +635,11 @@ if ($action == 'create') {
|
||||
print_liste_field_titre("LabelOperation");
|
||||
print_liste_field_titre("Debit", "", "", "", "", 'class="right"');
|
||||
print_liste_field_titre("Credit", "", "", "", "", 'class="right"');
|
||||
print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"');
|
||||
if (empty($object->date_validation)) {
|
||||
print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"');
|
||||
} else {
|
||||
print_liste_field_titre("");
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -662,21 +682,25 @@ if ($action == 'create') {
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$line->label_operation.'</td>';
|
||||
print '<td class="nowrap right">'.price($line->debit).'</td>';
|
||||
print '<td class="nowrap right">'.price($line->credit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($line->debit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($line->credit).'</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">';
|
||||
print img_edit('', 0, 'class="marginrightonly"');
|
||||
print '</a> ';
|
||||
|
||||
$actiontodelete = 'delete';
|
||||
if ($mode == '_tmp' || $action != 'delmouv') {
|
||||
$actiontodelete = 'confirm_delete';
|
||||
if (empty($line->date_export) && empty($line->date_validation)) {
|
||||
print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
|
||||
print img_edit('', 0, 'class="marginrightonly"');
|
||||
print '</a> ';
|
||||
}
|
||||
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">';
|
||||
print img_delete();
|
||||
if (empty($line->date_validation)) {
|
||||
$actiontodelete = 'delete';
|
||||
if ($mode == '_tmp' || $action != 'delmouv') {
|
||||
$actiontodelete = 'confirm_delete';
|
||||
}
|
||||
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
|
||||
print img_delete();
|
||||
}
|
||||
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
@ -691,32 +715,33 @@ if ($action == 'create') {
|
||||
setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings');
|
||||
}
|
||||
|
||||
if ($action == "" || $action == 'add') {
|
||||
print '<tr class="oddeven">';
|
||||
print '<!-- td columns in add mode -->';
|
||||
print '<td>';
|
||||
print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
|
||||
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
|
||||
// Also, it is not possible to use a value that is not in the list.
|
||||
// Also, the label is not automatically filled when a value is selected.
|
||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||
print $formaccounting->select_auxaccount('', 'subledger_account', 1);
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">';
|
||||
if (empty($object->date_export) && empty($object->date_validation)) {
|
||||
if ($action == "" || $action == 'add') {
|
||||
print '<tr class="oddeven">';
|
||||
print '<!-- td columns in add mode -->';
|
||||
print '<td>';
|
||||
print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
|
||||
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
|
||||
// Also, it is not possible to use a value that is not in the list.
|
||||
// Also, the label is not automatically filled when a value is selected.
|
||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||
print $formaccounting->select_auxaccount('', 'subledger_account', 1);
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">';
|
||||
}
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">';
|
||||
print '</td>';
|
||||
print '<td><input type="text" class="minwidth200" name="label_operation" value="' . $label_operation . '"/></td>';
|
||||
print '<td class="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
|
||||
print '<td class="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
|
||||
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Add") . '"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
|
||||
print '</td>';
|
||||
print '<td><input type="text" class="minwidth200" name="label_operation" value="'.$label_operation.'"/></td>';
|
||||
print '<td class="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
|
||||
print '<td class="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
|
||||
print '<td><input type="submit" class="button" name="save" value="'.$langs->trans("Add").'"></td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
|
||||
if ($mode == '_tmp' && $action == '') {
|
||||
print '<br>';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
@ -44,15 +44,47 @@ $action = GETPOST('action', 'aZ09');
|
||||
$search_mvt_num = GETPOST('search_mvt_num', 'int');
|
||||
$search_doc_type = GETPOST("search_doc_type", 'alpha');
|
||||
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_date_startyear = GETPOST('search_date_startyear', 'int');
|
||||
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
|
||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||
$search_date_endyear = GETPOST('search_date_endyear', 'int');
|
||||
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
|
||||
$search_date_endday = GETPOST('search_date_endday', 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
|
||||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||
$search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmonth', 'int'), GETPOST('date_creation_startday', 'int'), GETPOST('date_creation_startyear', 'int'));
|
||||
$search_date_creation_end = dol_mktime(23, 59, 59, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
|
||||
$search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int'));
|
||||
$search_date_modification_end = dol_mktime(23, 59, 59, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
|
||||
$search_date_export_start = dol_mktime(0, 0, 0, GETPOST('date_export_startmonth', 'int'), GETPOST('date_export_startday', 'int'), GETPOST('date_export_startyear', 'int'));
|
||||
$search_date_export_end = dol_mktime(23, 59, 59, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
|
||||
$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int');
|
||||
$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int');
|
||||
$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int');
|
||||
$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int');
|
||||
$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int');
|
||||
$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int');
|
||||
$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear);
|
||||
$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear);
|
||||
$search_date_modification_startyear = GETPOST('search_date_modification_startyear', 'int');
|
||||
$search_date_modification_startmonth = GETPOST('search_date_modification_startmonth', 'int');
|
||||
$search_date_modification_startday = GETPOST('search_date_modification_startday', 'int');
|
||||
$search_date_modification_endyear = GETPOST('search_date_modification_endyear', 'int');
|
||||
$search_date_modification_endmonth = GETPOST('search_date_modification_endmonth', 'int');
|
||||
$search_date_modification_endday = GETPOST('search_date_modification_endday', 'int');
|
||||
$search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear);
|
||||
$search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear);
|
||||
$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int');
|
||||
$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int');
|
||||
$search_date_export_startday = GETPOST('search_date_export_startday', 'int');
|
||||
$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int');
|
||||
$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
|
||||
$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
|
||||
$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
|
||||
$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
|
||||
$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int');
|
||||
$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int');
|
||||
$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int');
|
||||
$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int');
|
||||
$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int');
|
||||
$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int');
|
||||
$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear);
|
||||
$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear);
|
||||
|
||||
//var_dump($search_date_start);exit;
|
||||
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
|
||||
@ -157,6 +189,7 @@ $arrayfields = array(
|
||||
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
|
||||
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),
|
||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
||||
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
|
||||
);
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
|
||||
@ -216,14 +249,46 @@ if (empty($reshook)) {
|
||||
$search_mvt_label = '';
|
||||
$search_direction = '';
|
||||
$search_ledger_code = array();
|
||||
$search_date_startyear = '';
|
||||
$search_date_startmonth = '';
|
||||
$search_date_startday = '';
|
||||
$search_date_endyear = '';
|
||||
$search_date_endmonth = '';
|
||||
$search_date_endday = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_date_creation_startyear = '';
|
||||
$search_date_creation_startmonth = '';
|
||||
$search_date_creation_startday = '';
|
||||
$search_date_creation_endyear = '';
|
||||
$search_date_creation_endmonth = '';
|
||||
$search_date_creation_endday = '';
|
||||
$search_date_creation_start = '';
|
||||
$search_date_creation_end = '';
|
||||
$search_date_modification_startyear = '';
|
||||
$search_date_modification_startmonth = '';
|
||||
$search_date_modification_startday = '';
|
||||
$search_date_modification_endyear = '';
|
||||
$search_date_modification_endmonth = '';
|
||||
$search_date_modification_endday = '';
|
||||
$search_date_modification_start = '';
|
||||
$search_date_modification_end = '';
|
||||
$search_date_export_startyear = '';
|
||||
$search_date_export_startmonth = '';
|
||||
$search_date_export_startday = '';
|
||||
$search_date_export_endyear = '';
|
||||
$search_date_export_endmonth = '';
|
||||
$search_date_export_endday = '';
|
||||
$search_date_export_start = '';
|
||||
$search_date_export_end = '';
|
||||
$search_date_validation_startyear = '';
|
||||
$search_date_validation_startmonth = '';
|
||||
$search_date_validation_startday = '';
|
||||
$search_date_validation_endyear = '';
|
||||
$search_date_validation_endmonth = '';
|
||||
$search_date_validation_endday = '';
|
||||
$search_date_validation_start = '';
|
||||
$search_date_validation_end = '';
|
||||
$search_debit = '';
|
||||
$search_credit = '';
|
||||
$search_lettering_code = '';
|
||||
@ -301,32 +366,42 @@ if (empty($reshook)) {
|
||||
if (!empty($search_date_creation_start)) {
|
||||
$filter['t.date_creation>='] = $search_date_creation_start;
|
||||
$tmp = dol_getdate($search_date_creation_start);
|
||||
$param .= '&date_creation_startmonth='.urlencode($tmp['mon']).'&date_creation_startday='.urlencode($tmp['mday']).'&date_creation_startyear='.urlencode($tmp['year']);
|
||||
$param .= '&search_date_creation_startmonth='.urlencode($tmp['mon']).'&search_date_creation_startday='.urlencode($tmp['mday']).'&search_date_creation_startyear='.urlencode($tmp['year']);
|
||||
}
|
||||
if (!empty($search_date_creation_end)) {
|
||||
$filter['t.date_creation<='] = $search_date_creation_end;
|
||||
$tmp = dol_getdate($search_date_creation_end);
|
||||
$param .= '&date_creation_endmonth='.urlencode($tmp['mon']).'&date_creation_endday='.urlencode($tmp['mday']).'&date_creation_endyear='.urlencode($tmp['year']);
|
||||
$param .= '&search_date_creation_endmonth='.urlencode($tmp['mon']).'&search_date_creation_endday='.urlencode($tmp['mday']).'&search_date_creation_endyear='.urlencode($tmp['year']);
|
||||
}
|
||||
if (!empty($search_date_modification_start)) {
|
||||
$filter['t.tms>='] = $search_date_modification_start;
|
||||
$tmp = dol_getdate($search_date_modification_start);
|
||||
$param .= '&date_modification_startmonth='.urlencode($tmp['mon']).'&date_modification_startday='.urlencode($tmp['mday']).'&date_modification_startyear='.urlencode($tmp['year']);
|
||||
$param .= '&search_date_modification_startmonth='.urlencode($tmp['mon']).'&search_date_modification_startday='.urlencode($tmp['mday']).'&search_date_modification_startyear='.urlencode($tmp['year']);
|
||||
}
|
||||
if (!empty($search_date_modification_end)) {
|
||||
$filter['t.tms<='] = $search_date_modification_end;
|
||||
$tmp = dol_getdate($search_date_modification_end);
|
||||
$param .= '&date_modification_endmonth='.urlencode($tmp['mon']).'&date_modification_endday='.urlencode($tmp['mday']).'&date_modification_endyear='.urlencode($tmp['year']);
|
||||
$param .= '&search_date_modification_endmonth='.urlencode($tmp['mon']).'&search_date_modification_endday='.urlencode($tmp['mday']).'&search_date_modification_endyear='.urlencode($tmp['year']);
|
||||
}
|
||||
if (!empty($search_date_export_start)) {
|
||||
$filter['t.date_export>='] = $search_date_export_start;
|
||||
$tmp = dol_getdate($search_date_export_start);
|
||||
$param .= '&date_export_startmonth='.urlencode($tmp['mon']).'&date_export_startday='.urlencode($tmp['mday']).'&date_export_startyear='.urlencode($tmp['year']);
|
||||
$param .= '&search_date_export_startmonth='.urlencode($tmp['mon']).'&search_date_export_startday='.urlencode($tmp['mday']).'&search_date_export_startyear='.urlencode($tmp['year']);
|
||||
}
|
||||
if (!empty($search_date_export_end)) {
|
||||
$filter['t.date_export<='] = $search_date_export_end;
|
||||
$tmp = dol_getdate($search_date_export_end);
|
||||
$param .= '&date_export_endmonth='.urlencode($tmp['mon']).'&date_export_endday='.urlencode($tmp['mday']).'&date_export_endyear='.urlencode($tmp['year']);
|
||||
$param .= '&search_date_export_endmonth='.urlencode($tmp['mon']).'&search_date_export_endday='.urlencode($tmp['mday']).'&search_date_export_endyear='.urlencode($tmp['year']);
|
||||
}
|
||||
if (!empty($search_date_validation_start)) {
|
||||
$filter['t.date_validated>='] = $search_date_validation_start;
|
||||
$tmp = dol_getdate($search_date_validation_start);
|
||||
$param .= '&search_date_validation_startmonth='.urlencode($tmp['mon']).'&search_date_validation_startday='.urlencode($tmp['mday']).'&search_date_validation_startyear='.urlencode($tmp['year']);
|
||||
}
|
||||
if (!empty($search_date_validation_end)) {
|
||||
$filter['t.date_validated<='] = $search_date_validation_end;
|
||||
$tmp = dol_getdate($search_date_validation_end);
|
||||
$param .= '&search_date_validation_endmonth='.urlencode($tmp['mon']).'&search_date_validation_endday='.urlencode($tmp['mday']).'&search_date_validation_endyear='.urlencode($tmp['year']);
|
||||
}
|
||||
if (!empty($search_debit)) {
|
||||
$filter['t.debit'] = $search_debit;
|
||||
@ -447,7 +522,8 @@ $sql .= " t.journal_label,";
|
||||
$sql .= " t.piece_num,";
|
||||
$sql .= " t.date_creation,";
|
||||
$sql .= " t.tms as date_modification,";
|
||||
$sql .= " t.date_export";
|
||||
$sql .= " t.date_export,";
|
||||
$sql .= " t.date_validated as date_validation";
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$object->table_element.' as t';
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
@ -471,6 +547,8 @@ if (count($filter) > 0) {
|
||||
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
|
||||
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
|
||||
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
|
||||
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
|
||||
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
|
||||
} elseif ($key == 't.credit' || $key == 't.debit') {
|
||||
$sqlwhere[] = natural_search($key, $value, 1, 1);
|
||||
} elseif ($key == 't.reconciled_option') {
|
||||
@ -498,7 +576,7 @@ if (!empty($sortfield)) {
|
||||
// Export into a file with format defined into setup (FEC, CSV, ...)
|
||||
// Must be after definition of $sql
|
||||
if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) {
|
||||
// TODO Replace the fetchAll + ->export later that consume too much memory on large export with the query($sql) and loop on each line to export them.
|
||||
// TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumew too much memory on large export. Replace this with the query($sql) and loop on each line to export them.
|
||||
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1));
|
||||
|
||||
if ($result < 0) {
|
||||
@ -508,10 +586,13 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
||||
$accountancyexport = new AccountancyExport($db);
|
||||
$accountancyexport->export($object->lines, $formatexportset);
|
||||
|
||||
$notifiedexportdate = GETPOST('notifiedexportdate', 'alpha');
|
||||
$notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha');
|
||||
|
||||
if (!empty($accountancyexport->errors)) {
|
||||
setEventMessages('', $accountancyexport->errors, 'errors');
|
||||
} else {
|
||||
// Specify as export : update field date_export
|
||||
} elseif (!$notifiedexportdate || !$notifiedvalidationdate) {
|
||||
// Specify as export : update field date_export or date_validated
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
|
||||
@ -520,8 +601,15 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
||||
$now = dol_now();
|
||||
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
||||
$sql .= " SET date_export = '".$db->idate($now)."'";
|
||||
$sql .= " , date_validated = '".$db->idate($now)."'";
|
||||
$sql .= " SET";
|
||||
if (!$notifiedexportdate && !$notifiedvalidationdate) {
|
||||
$sql .= " date_export = '".$db->idate($now)."'";
|
||||
$sql .= ", date_validated = '".$db->idate($now)."'";
|
||||
} elseif (!$notifiedexportdate) {
|
||||
$sql .= " date_export = '".$db->idate($now)."'";
|
||||
} elseif (!$notifiedvalidationdate) {
|
||||
$sql .= " date_validated = '".$db->idate($now)."'";
|
||||
}
|
||||
$sql .= " WHERE rowid = ".((int) $movement->id);
|
||||
|
||||
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
|
||||
@ -535,11 +623,11 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExported"), null, 'mesgs');
|
||||
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExportedOrValidated"), null, 'mesgs');
|
||||
} else {
|
||||
$error++;
|
||||
$db->rollback();
|
||||
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExported"), null, 'errors');
|
||||
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"), null, 'errors');
|
||||
}
|
||||
}
|
||||
exit;
|
||||
@ -587,6 +675,8 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) {
|
||||
|
||||
llxHeader('', $title_page);
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
if ($action == 'export_file') {
|
||||
$form_question = array();
|
||||
|
||||
@ -598,17 +688,15 @@ if ($action == 'export_file') {
|
||||
);
|
||||
$form_question['notifiedvalidationdate'] = array(
|
||||
'name' => 'notifiedvalidationdate',
|
||||
'type' => 'checkbox', // We don't use select here, the journal_array is already a select html component
|
||||
'type' => 'checkbox',
|
||||
'label' => $langs->trans('NotifiedValidationDate'),
|
||||
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) ? 'false' : 'true'),
|
||||
);
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300);
|
||||
print $formconfirm;
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600);
|
||||
}
|
||||
if ($action == 'delmouv') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?mvt_num='.GETPOST('mvt_num').$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1);
|
||||
print $formconfirm;
|
||||
}
|
||||
if ($action == 'delbookkeepingyear') {
|
||||
$form_question = array();
|
||||
@ -648,9 +736,11 @@ if ($action == 'delbookkeepingyear') {
|
||||
);
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
|
||||
print $formconfirm;
|
||||
}
|
||||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
//$param=''; param started before
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
@ -669,6 +759,8 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
||||
print '<input type="hidden" name="sortfield" value="'.urlencode($sortfield).'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.urlencode($sortorder).'">';
|
||||
|
||||
$massactionbutton = '';
|
||||
|
||||
if (count($filter)) {
|
||||
$buttonLabel = $langs->trans("ExportFilteredList");
|
||||
} else {
|
||||
@ -701,7 +793,7 @@ if (empty($reshook)) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer);
|
||||
}
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
@ -730,7 +822,7 @@ if (!empty($arrayfields['t.piece_num']['checked'])) {
|
||||
// Code journal
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1);
|
||||
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'maxwidth150');
|
||||
print '</td>';
|
||||
}
|
||||
// Date document
|
||||
@ -773,7 +865,7 @@ if (!empty($arrayfields['t.subledger_account']['checked'])) {
|
||||
print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', $langs->trans('to'), 'maxwidth250', 'subledgeraccount');
|
||||
print '</div>';
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth100" name="search_accountancy_aux_code" value="'.$search_accountancy_aux_code.'">';
|
||||
print '<input type="text" class="maxwidth75" name="search_accountancy_aux_code" value="'.$search_accountancy_aux_code.'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
@ -812,10 +904,10 @@ print $hookmanager->resPrint;
|
||||
if (!empty($arrayfields['t.date_creation']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_creation_start, 'date_creation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print $form->selectDate($search_date_creation_start, 'search_date_creation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_creation_end, 'date_creation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print $form->selectDate($search_date_creation_end, 'search_date_creation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
@ -823,10 +915,10 @@ if (!empty($arrayfields['t.date_creation']['checked'])) {
|
||||
if (!empty($arrayfields['t.tms']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_modification_start, 'date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print $form->selectDate($search_date_modification_start, 'search_date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_modification_end, 'date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
@ -834,10 +926,21 @@ if (!empty($arrayfields['t.tms']['checked'])) {
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_export_start, 'date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print $form->selectDate($search_date_export_start, 'search_date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_export_end, 'date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print $form->selectDate($search_date_export_end, 'search_date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Date validation
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
@ -892,6 +995,9 @@ if (!empty($arrayfields['t.tms']['checked'])) {
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -934,6 +1040,7 @@ while ($i < min($num, $limit)) {
|
||||
$line->date_creation = $db->jdate($obj->date_creation);
|
||||
$line->date_modification = $db->jdate($obj->date_modification);
|
||||
$line->date_export = $db->jdate($obj->date_export);
|
||||
$line->date_validation = $db->jdate($obj->date_validation);
|
||||
|
||||
$total_debit += $line->debit;
|
||||
$total_credit += $line->credit;
|
||||
@ -1067,7 +1174,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Amount debit
|
||||
if (!empty($arrayfields['t.debit']['checked'])) {
|
||||
print '<td class="nowrap right">'.($line->debit != 0 ? price($line->debit) : '').'</td>';
|
||||
print '<td class="right nowraponall amount">'.($line->debit != 0 ? price($line->debit) : '').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -1079,7 +1186,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Amount credit
|
||||
if (!empty($arrayfields['t.credit']['checked'])) {
|
||||
print '<td class="nowrap right">'.($line->credit != 0 ? price($line->credit) : '').'</td>';
|
||||
print '<td class="right nowraponall amount">'.($line->credit != 0 ? price($line->credit) : '').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -1126,12 +1233,22 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Validated operation date
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Action column
|
||||
print '<td class="nowraponall center">';
|
||||
if (empty($line->date_export)) {
|
||||
if (empty($line->date_export) && empty($line->date_validation)) {
|
||||
if ($user->rights->accounting->mouvements->creer) {
|
||||
print '<a class="editfielda paddingleft marginrightonly" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_edit().'</a>';
|
||||
print '<a class="editfielda paddingleft marginrightonly" href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
|
||||
}
|
||||
}
|
||||
if (empty($line->date_validation)) {
|
||||
if ($user->rights->accounting->mouvements->supprimer) {
|
||||
print '<a class="reposition paddingleft marginrightonly" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2016 Neil Orley <neil.orley@oeris.fr>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2020 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -55,7 +55,15 @@ $search_date_export_endyear = GETPOST('search_date_export_endyear', 'int');
|
||||
$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
|
||||
$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
|
||||
$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
|
||||
$search_date_export_end = dol_mktime(0, 0, 0, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
|
||||
$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
|
||||
$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int');
|
||||
$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int');
|
||||
$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int');
|
||||
$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int');
|
||||
$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int');
|
||||
$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int');
|
||||
$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear);
|
||||
$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear);
|
||||
|
||||
$search_accountancy_code = GETPOST("search_accountancy_code");
|
||||
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
|
||||
@ -81,7 +89,7 @@ if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_
|
||||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
@ -144,6 +152,7 @@ $arrayfields = array(
|
||||
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
|
||||
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
|
||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
||||
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
|
||||
);
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
|
||||
@ -221,6 +230,14 @@ if (empty($reshook)) {
|
||||
$search_date_export_endyear = '';
|
||||
$search_date_export_endmonth = '';
|
||||
$search_date_export_endday = '';
|
||||
$search_date_validation_start = '';
|
||||
$search_date_validation_end = '';
|
||||
$search_date_validation_startyear = '';
|
||||
$search_date_validation_startmonth = '';
|
||||
$search_date_validation_startday = '';
|
||||
$search_date_validation_endyear = '';
|
||||
$search_date_validation_endmonth = '';
|
||||
$search_date_validation_endday = '';
|
||||
$search_debit = '';
|
||||
$search_credit = '';
|
||||
$search_lettering_code = '';
|
||||
@ -301,6 +318,14 @@ if (empty($reshook)) {
|
||||
$filter['t.date_export<='] = $search_date_export_end;
|
||||
$param .= '&search_date_export_endmonth='.$search_date_export_endmonth.'&search_date_export_endday='.$search_date_export_endday.'&search_date_export_endyear='.$search_date_export_endyear;
|
||||
}
|
||||
if (!empty($search_date_validation_start)) {
|
||||
$filter['t.date_validated>='] = $search_date_validation_start;
|
||||
$param .= '&search_date_validation_startmonth='.$search_date_validation_startmonth.'&search_date_validation_startday='.$search_date_validation_startday.'&search_date_validation_startyear='.$search_date_validation_startyear;
|
||||
}
|
||||
if (!empty($search_date_validation_end)) {
|
||||
$filter['t.date_validated<='] = $search_date_validation_end;
|
||||
$param .= '&search_date_validation_endmonth='.$search_date_validation_endmonth.'&search_date_validation_endday='.$search_date_validation_endday.'&search_date_validation_endyear='.$search_date_validation_endyear;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
|
||||
@ -484,10 +509,9 @@ $moreforfilter = '';
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= $langs->trans('AccountAccounting').': ';
|
||||
$moreforfilter .= '<div class="nowrap inline-block">';
|
||||
$moreforfilter .= $langs->trans('From').' ';
|
||||
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, 'maxwidth200');
|
||||
$moreforfilter .= ' '.$langs->trans('to').' ';
|
||||
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200');
|
||||
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), array(), 1, 1, 'maxwidth200');
|
||||
$moreforfilter .= ' ';
|
||||
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, 'maxwidth200');
|
||||
$moreforfilter .= '</div>';
|
||||
$moreforfilter .= '</div>';
|
||||
|
||||
@ -564,6 +588,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Date validation
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields);
|
||||
@ -605,6 +640,9 @@ if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -632,20 +670,19 @@ while ($i < min($num, $limit)) {
|
||||
$accountg = length_accountg($line->numero_compte);
|
||||
//if (empty($accountg)) $accountg = '-';
|
||||
|
||||
$colspan = 0; // colspan before field 'label of operation'
|
||||
$colspanend = 3; // colspan after debit/credit
|
||||
if (!empty($arrayfields['t.piece_num']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.doc_date']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.doc_ref']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.label_operation']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) { $colspanend++; }
|
||||
if (!empty($arrayfields['t.date_validating']['checked'])) { $colspanend++; }
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; }
|
||||
|
||||
// Is it a break ?
|
||||
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
|
||||
$colnumber = 5;
|
||||
$colnumberend = 7;
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
$colnumber--;
|
||||
}
|
||||
if (empty($arrayfields['t.date_export']['checked'])) {
|
||||
$colnumber--;
|
||||
}
|
||||
|
||||
$colspan = $totalarray['nbfield'] - $colnumber;
|
||||
$colspanend = $totalarray['nbfield'] - $colnumberend;
|
||||
// Show a subtotal by accounting account
|
||||
if (isset($displayed_account_number)) {
|
||||
print '<tr class="liste_total">';
|
||||
@ -807,7 +844,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Amount debit
|
||||
if (!empty($arrayfields['t.debit']['checked'])) {
|
||||
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
|
||||
print '<td class="right nowraponall amount">'.($line->debit ? price($line->debit) : '').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -819,7 +856,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Amount credit
|
||||
if (!empty($arrayfields['t.credit']['checked'])) {
|
||||
print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
|
||||
print '<td class="right nowraponall amount">'.($line->credit ? price($line->credit) : '').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -845,6 +882,14 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Validated operation date
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -852,12 +897,14 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Action column
|
||||
print '<td class="nowraponall center">';
|
||||
if (empty($line->date_export)) {
|
||||
if (empty($line->date_export) && empty($line->date_validation)) {
|
||||
if ($user->rights->accounting->mouvements->creer) {
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_edit().'</a>';
|
||||
print '<a class="editfielda paddingleft marginrightonly" href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
|
||||
}
|
||||
}
|
||||
if (empty($line->date_validation)) {
|
||||
if ($user->rights->accounting->mouvements->supprimer) {
|
||||
print ' <a class="paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
|
||||
print '<a class="reposition paddingleft marginrightonly" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
@ -874,9 +921,7 @@ while ($i < min($num, $limit)) {
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($num > 0) {
|
||||
$colspan = $totalarray['nbfield'] - $colnumber;
|
||||
$colspanend = $totalarray['nbfield'] - $colnumberend;
|
||||
if ($num > 0 && $colspan > 0) {
|
||||
print '<tr class="liste_total">';
|
||||
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.$accountg.':</td>';
|
||||
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
/* Copyright (C) 2016 Neil Orley <neil.orley@oeris.fr>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2020 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018-2020 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
|
||||
@ -46,7 +46,7 @@ $search_date_endyear = GETPOST('search_date_endyear', 'int');
|
||||
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
|
||||
$search_date_endday = GETPOST('search_date_endday', 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
|
||||
$search_date_end = dol_mktime(0, 0, 0, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||
$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int');
|
||||
$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int');
|
||||
@ -55,7 +55,15 @@ $search_date_export_endyear = GETPOST('search_date_export_endyear', 'int');
|
||||
$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
|
||||
$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
|
||||
$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
|
||||
$search_date_export_end = dol_mktime(0, 0, 0, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
|
||||
$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
|
||||
$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int');
|
||||
$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int');
|
||||
$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int');
|
||||
$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int');
|
||||
$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int');
|
||||
$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int');
|
||||
$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear);
|
||||
$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear);
|
||||
|
||||
$search_accountancy_code = GETPOST("search_accountancy_code");
|
||||
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
|
||||
@ -144,6 +152,7 @@ $arrayfields = array(
|
||||
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
|
||||
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
|
||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
||||
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
|
||||
);
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
|
||||
@ -221,6 +230,14 @@ if (empty($reshook)) {
|
||||
$search_date_export_endyear = '';
|
||||
$search_date_export_endmonth = '';
|
||||
$search_date_export_endday = '';
|
||||
$search_date_validation_start = '';
|
||||
$search_date_validation_end = '';
|
||||
$search_date_validation_startyear = '';
|
||||
$search_date_validation_startmonth = '';
|
||||
$search_date_validation_startday = '';
|
||||
$search_date_validation_endyear = '';
|
||||
$search_date_validation_endmonth = '';
|
||||
$search_date_validation_endday = '';
|
||||
$search_debit = '';
|
||||
$search_credit = '';
|
||||
$search_lettering_code = '';
|
||||
@ -301,6 +318,14 @@ if (empty($reshook)) {
|
||||
$filter['t.date_export<='] = $search_date_export_end;
|
||||
$param .= '&search_date_export_endmonth='.$search_date_export_endmonth.'&search_date_export_endday='.$search_date_export_endday.'&search_date_export_endyear='.$search_date_export_endyear;
|
||||
}
|
||||
if (!empty($search_date_validation_start)) {
|
||||
$filter['t.date_validated>='] = $search_date_validation_start;
|
||||
$param .= '&search_date_validation_startmonth='.$search_date_validation_startmonth.'&search_date_validation_startday='.$search_date_validation_startday.'&search_date_validation_startyear='.$search_date_validation_startyear;
|
||||
}
|
||||
if (!empty($search_date_validation_end)) {
|
||||
$filter['t.date_validated<='] = $search_date_validation_end;
|
||||
$param .= '&search_date_validation_endmonth='.$search_date_validation_endmonth.'&search_date_validation_endday='.$search_date_validation_endday.'&search_date_validation_endyear='.$search_date_validation_endyear;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
|
||||
@ -373,7 +398,6 @@ $title_page = $langs->trans("Operations").' - '.$langs->trans("VueByAccountAccou
|
||||
|
||||
llxHeader('', $title_page);
|
||||
|
||||
|
||||
// List
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
@ -448,7 +472,6 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
@ -488,10 +511,9 @@ $moreforfilter = '';
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= $langs->trans('AccountAccounting').': ';
|
||||
$moreforfilter .= '<div class="nowrap inline-block">';
|
||||
$moreforfilter .= $langs->trans('From').' ';
|
||||
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', 1, 'maxwidth200');
|
||||
$moreforfilter .= ' '.$langs->trans('to').' ';
|
||||
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', 1, 'maxwidth200');
|
||||
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), 'maxwidth200');
|
||||
$moreforfilter .= ' ';
|
||||
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), 'maxwidth200');
|
||||
$moreforfilter .= '</div>';
|
||||
$moreforfilter .= '</div>';
|
||||
|
||||
@ -568,6 +590,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Date validation
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields);
|
||||
@ -609,6 +642,9 @@ if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -636,21 +672,19 @@ while ($i < min($num, $limit)) {
|
||||
$accountg = length_accounta($line->subledger_account);
|
||||
//if (empty($accountg)) $accountg = '-';
|
||||
|
||||
$colspan = 0; // colspan before field 'label of operation'
|
||||
$colspanend = 3; // colspan after debit/credit
|
||||
if (!empty($arrayfields['t.piece_num']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.doc_date']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.doc_ref']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.label_operation']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) { $colspanend++; }
|
||||
if (!empty($arrayfields['t.date_validating']['checked'])) { $colspanend++; }
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; }
|
||||
|
||||
// Is it a break ?
|
||||
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
|
||||
$colnumber = 5;
|
||||
$colnumberend = 7;
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
$colnumber--;
|
||||
}
|
||||
if (empty($arrayfields['t.date_export']['checked'])) {
|
||||
$colnumber--;
|
||||
}
|
||||
|
||||
$colspan = $totalarray['nbfield'] - $colnumber;
|
||||
$colspanend = $totalarray['nbfield'] - $colnumberend;
|
||||
|
||||
// Show a subtotal by accounting account
|
||||
if (isset($displayed_account_number)) {
|
||||
print '<tr class="liste_total">';
|
||||
@ -682,7 +716,7 @@ while ($i < min($num, $limit)) {
|
||||
print "<tr>";
|
||||
print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : 10).'" style="font-weight:bold; border-bottom: 1pt solid black;">';
|
||||
if ($line->subledger_account != "" && $line->subledger_account != '-1') {
|
||||
print $object->get_compte_desc($line->numero_compte).' : '.length_accounta($line->subledger_account);
|
||||
print $line->subledger_label.' : '.length_accounta($line->subledger_account);
|
||||
} else {
|
||||
// Should not happen: subledger account must be null or a non empty value
|
||||
print '<span class="error">'.$langs->trans("Unknown");
|
||||
@ -821,7 +855,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Amount debit
|
||||
if (!empty($arrayfields['t.debit']['checked'])) {
|
||||
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
|
||||
print '<td class="right nowraponall amount">'.($line->debit ? price($line->debit) : '').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -833,7 +867,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Amount credit
|
||||
if (!empty($arrayfields['t.credit']['checked'])) {
|
||||
print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
|
||||
print '<td class="right nowraponall amount">'.($line->credit ? price($line->credit) : '').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -859,6 +893,14 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Validated operation date
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -866,12 +908,14 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Action column
|
||||
print '<td class="nowraponall center">';
|
||||
if (empty($line->date_export)) {
|
||||
if (empty($line->date_export) && empty($line->date_validation)) {
|
||||
if ($user->rights->accounting->mouvements->creer) {
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_edit().'</a>';
|
||||
print '<a class="editfielda paddingleft marginrightonly" href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
|
||||
}
|
||||
}
|
||||
if (empty($line->date_validation)) {
|
||||
if ($user->rights->accounting->mouvements->supprimer) {
|
||||
print ' <a class="paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
|
||||
print '<a class="reposition paddingleft marginrightonly" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
@ -888,9 +932,7 @@ while ($i < min($num, $limit)) {
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($num > 0) {
|
||||
$colspan = $totalarray['nbfield'] - $colnumber;
|
||||
$colspanend = $totalarray['nbfield'] - $colnumberend;
|
||||
if ($num > 0 && $colspan > 0) {
|
||||
print '<tr class="liste_total">';
|
||||
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.$accountg.':</td>';
|
||||
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
|
||||
|
||||
@ -281,7 +281,7 @@ if ($resql) {
|
||||
$journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $obj->code_journal);
|
||||
print '<td class="center">'.$journaltoshow.'</td>';
|
||||
|
||||
if (empty($obj->lettering_code)) {
|
||||
if (empty($obj->lettering_code) && empty($obj->date_validated)) {
|
||||
print '<td class="nowrap center"><input type="checkbox" class="flat checkforselect" name="toselect[]" id="toselect[]" value="'.$obj->rowid.'" /></td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$obj->piece_num.'">';
|
||||
print img_edit();
|
||||
@ -296,15 +296,15 @@ if ($resql) {
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="right" colspan="3">'.$langs->trans("Total").':</td>'."\n";
|
||||
print '<td class="nowrap right"><strong>'.price($debit).'</strong></td>';
|
||||
print '<td class="nowrap right"><strong>'.price($credit).'</strong></td>';
|
||||
print '<td class="right nowraponall amount"><strong>'.price($debit).'</strong></td>';
|
||||
print '<td class="right nowraponall amount"><strong>'.price($credit).'</strong></td>';
|
||||
print '<td colspan="4"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="right" colspan="3">'.$langs->trans("Balancing").':</td>'."\n";
|
||||
print '<td colspan="2"> </td>';
|
||||
print '<td class="nowrap right"><strong>'.price($credit - $debit).'</strong></td>';
|
||||
print '<td class="right nowraponall amount"><strong>'.price($credit - $debit).'</strong></td>';
|
||||
print '<td colspan="6"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -293,15 +293,15 @@ if ($resql) {
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="right" colspan="3">'.$langs->trans("Total").':</td>'."\n";
|
||||
print '<td class="nowrap right"><strong>'.price($debit).'</strong></td>';
|
||||
print '<td class="nowrap right"><strong>'.price($credit).'</strong></td>';
|
||||
print '<td class="right nowraponall amount"><strong>'.price($debit).'</strong></td>';
|
||||
print '<td class="right nowraponall amount"><strong>'.price($credit).'</strong></td>';
|
||||
print '<td colspan="6"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="right" colspan="3">'.$langs->trans("Balancing").':</td>'."\n";
|
||||
print '<td colspan="2"> </td>';
|
||||
print '<td class="nowrap right"><strong>'.price($credit - $debit).'</strong></td>';
|
||||
print '<td class="right nowraponall amount"><strong>'.price($credit - $debit).'</strong></td>';
|
||||
print '<td colspan="4"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -201,7 +201,7 @@ class AccountancyCategory // extends CommonObject
|
||||
$sql .= "entity";
|
||||
$sql .= ") VALUES (";
|
||||
if ($this->rowid > 0) {
|
||||
$sql .= " ".$this->rowid.",";
|
||||
$sql .= " ".((int) $this->rowid).",";
|
||||
}
|
||||
$sql .= " ".(!isset($this->code) ? 'NULL' : "'".$this->db->escape($this->code)."'").",";
|
||||
$sql .= " ".(!isset($this->label) ? 'NULL' : "'".$this->db->escape($this->label)."'").",";
|
||||
@ -209,9 +209,9 @@ class AccountancyCategory // extends CommonObject
|
||||
$sql .= " ".(!isset($this->sens) ? 'NULL' : "'".$this->db->escape($this->sens)."'").",";
|
||||
$sql .= " ".(!isset($this->category_type) ? 'NULL' : "'".$this->db->escape($this->category_type)."'").",";
|
||||
$sql .= " ".(!isset($this->formula) ? 'NULL' : "'".$this->db->escape($this->formula)."'").",";
|
||||
$sql .= " ".(!isset($this->position) ? 'NULL' : $this->db->escape($this->position)).",";
|
||||
$sql .= " ".(!isset($this->fk_country) ? 'NULL' : $this->db->escape($this->fk_country)).",";
|
||||
$sql .= " ".(!isset($this->active) ? 'NULL' : $this->db->escape($this->active));
|
||||
$sql .= " ".(!isset($this->position) ? 'NULL' : ((int) $this->position)).",";
|
||||
$sql .= " ".(!isset($this->fk_country) ? 'NULL' : ((int) $this->fk_country)).",";
|
||||
$sql .= " ".(!isset($this->active) ? 'NULL' : ((int) $this->active));
|
||||
$sql .= ", ".$conf->entity;
|
||||
$sql .= ")";
|
||||
|
||||
@ -263,7 +263,7 @@ class AccountancyCategory // extends CommonObject
|
||||
if ($id) {
|
||||
$sql .= " WHERE t.rowid = ".((int) $id);
|
||||
} else {
|
||||
$sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Dont't use entity if you use rowid
|
||||
$sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Don't use entity if you use rowid
|
||||
if ($code) {
|
||||
$sql .= " AND t.code = '".$this->db->escape($code)."'";
|
||||
} elseif ($label) {
|
||||
@ -675,7 +675,7 @@ class AccountancyCategory // extends CommonObject
|
||||
$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 (c.fk_country = ".((int) $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";
|
||||
@ -806,7 +806,7 @@ class AccountancyCategory // extends CommonObject
|
||||
if ($categorytype >= 0) {
|
||||
$sql .= " AND c.category_type = 1";
|
||||
}
|
||||
$sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)";
|
||||
$sql .= " AND (c.fk_country = ".((int) $mysoc->country_id)." OR c.fk_country = 0)";
|
||||
$sql .= " ORDER BY c.position ASC";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
|
||||
* Copyright (C) 2016-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2017 Elarifr. Ari Elbaz <github@accedinfo.com>
|
||||
* Copyright (C) 2017-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
@ -59,6 +59,8 @@ class AccountancyExport
|
||||
public static $EXPORT_TYPE_LDCOMPTA10 = 120;
|
||||
public static $EXPORT_TYPE_GESTIMUMV3 = 130;
|
||||
public static $EXPORT_TYPE_GESTIMUMV5 = 135;
|
||||
public static $EXPORT_TYPE_ISUITEEXPERT = 200;
|
||||
// Generic FEC after that
|
||||
public static $EXPORT_TYPE_FEC = 1000;
|
||||
public static $EXPORT_TYPE_FEC2 = 1010;
|
||||
|
||||
@ -123,6 +125,7 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
|
||||
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
||||
self::$EXPORT_TYPE_FEC2 => $langs->trans('Modelcsv_FEC2'),
|
||||
self::$EXPORT_TYPE_ISUITEEXPERT => 'Export iSuite Expert',
|
||||
);
|
||||
|
||||
ksort($listofexporttypes, SORT_NUMERIC);
|
||||
@ -158,6 +161,7 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_GESTIMUMV5 => 'gestimumv5',
|
||||
self::$EXPORT_TYPE_FEC => 'fec',
|
||||
self::$EXPORT_TYPE_FEC2 => 'fec2',
|
||||
self::$EXPORT_TYPE_ISUITEEXPERT => 'isuiteexpert',
|
||||
);
|
||||
|
||||
return $formatcode[$type];
|
||||
@ -243,6 +247,10 @@ class AccountancyExport
|
||||
'label' => $langs->trans('Modelcsv_FEC2'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||
),
|
||||
self::$EXPORT_TYPE_ISUITEEXPERT => array(
|
||||
'label' => 'iSuite Expert',
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
|
||||
),
|
||||
),
|
||||
'cr'=> array(
|
||||
'1' => $langs->trans("Unix"),
|
||||
@ -334,6 +342,9 @@ class AccountancyExport
|
||||
case self::$EXPORT_TYPE_FEC2:
|
||||
$this->exportFEC2($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_ISUITEEXPERT :
|
||||
$this->exportiSuiteExpert($TData);
|
||||
break;
|
||||
default:
|
||||
$this->errors[] = $langs->trans('accountancy_error_modelnotfound');
|
||||
break;
|
||||
@ -466,34 +477,43 @@ class AccountancyExport
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : CIEL
|
||||
* Export format : CIEL (Format XIMPORT)
|
||||
* Format since 2003 compatible CIEL version > 2002 / Sage50
|
||||
* Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
*
|
||||
* Help : https://sage50c.online-help.sage.fr/aide-technique/
|
||||
* In sage software | Use menu : "Exchange" > "Importing entries..."
|
||||
*
|
||||
* If you want to force filename to "XIMPORT.TXT" for automatically import file present in a directory :
|
||||
* use constant ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME
|
||||
*
|
||||
* @param array $TData data
|
||||
* @return void
|
||||
*/
|
||||
public function exportCiel(&$TData)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$end_line = "\r\n";
|
||||
|
||||
$i = 1;
|
||||
$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd
|
||||
|
||||
foreach ($TData as $data) {
|
||||
$code_compta = $data->numero_compte;
|
||||
$code_compta = length_accountg($data->numero_compte);
|
||||
if (!empty($data->subledger_account)) {
|
||||
$code_compta = $data->subledger_account;
|
||||
$code_compta = length_accounta($data->subledger_account);
|
||||
}
|
||||
|
||||
$date_document = dol_print_date($data->doc_date, '%Y%m%d');
|
||||
$date_echeance = dol_print_date($data->date_lim_reglement, '%Y%m%d');
|
||||
|
||||
$Tab = array();
|
||||
$Tab['num_ecriture'] = str_pad($i, 5);
|
||||
$Tab['num_ecriture'] = str_pad($data->piece_num, 5);
|
||||
$Tab['code_journal'] = str_pad($data->code_journal, 2);
|
||||
$Tab['date_ecriture'] = $date_ecriture;
|
||||
$Tab['date_ope'] = dol_print_date($data->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['num_piece'] = str_pad(self::trunc($data->piece_num, 12), 12);
|
||||
$Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12);
|
||||
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 11), 11);
|
||||
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25);
|
||||
$Tab['montant'] = str_pad(abs($data->debit - $data->credit), 13, ' ', STR_PAD_LEFT);
|
||||
$Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT);
|
||||
$Tab['type_montant'] = str_pad($data->sens, 1);
|
||||
$Tab['vide'] = str_repeat(' ', 18);
|
||||
$Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34);
|
||||
@ -561,9 +581,9 @@ class AccountancyExport
|
||||
$Tab['contrepartie'] = str_repeat(' ', 8);
|
||||
|
||||
// Force date format : %d%m%y
|
||||
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'); // Format must be ddmmyy
|
||||
if (!empty($data->date_lim_reglement)) {
|
||||
//$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%y'); // Format must be ddmmyy
|
||||
} else {
|
||||
$Tab['date_echeance'] = '000000';
|
||||
}
|
||||
@ -660,9 +680,9 @@ class AccountancyExport
|
||||
|
||||
$Tab['code_stat'] = str_repeat(' ', 4);
|
||||
|
||||
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');
|
||||
if (!empty($data->date_lim_reglement)) {
|
||||
//$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%Y');
|
||||
} else {
|
||||
$Tab['date_echeance'] = dol_print_date($data->doc_date, '%d%m%Y');
|
||||
}
|
||||
@ -1752,6 +1772,62 @@ class AccountancyExport
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : iSuite Expert
|
||||
*
|
||||
* by OpenSolus [https://opensolus.fr]
|
||||
*
|
||||
* @param array $objectLines data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportiSuiteExpert($objectLines)
|
||||
{
|
||||
$this->separator = ';';
|
||||
$this->end_line = "\r\n";
|
||||
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
$tab = array();
|
||||
|
||||
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
|
||||
|
||||
$tab[] = $line->piece_num;
|
||||
$tab[] = $date;
|
||||
$tab[] = substr($date, 6, 4);
|
||||
$tab[] = substr($date, 3, 2);
|
||||
$tab[] = substr($date, 0, 2);
|
||||
$tab[] = $line->doc_ref;
|
||||
//Conversion de chaine UTF8 en Latin9
|
||||
$tab[] = mb_convert_encoding(str_replace(' - Compte auxiliaire', '', $line->label_operation), "Windows-1252", 'UTF-8');
|
||||
|
||||
//Calcul de la longueur des numéros de comptes
|
||||
$taille_numero = strlen(length_accountg($line->numero_compte));
|
||||
|
||||
//Création du numéro de client générique
|
||||
$numero_cpt_client = '411';
|
||||
for ($i = 1; $i <= ($taille_numero - 3); $i++) {
|
||||
$numero_cpt_client .= '0';
|
||||
}
|
||||
|
||||
//Création des comptes auxiliaire des clients
|
||||
if (length_accountg($line->numero_compte) == $numero_cpt_client) {
|
||||
$tab[] = rtrim(length_accounta($line->subledger_account), "0");
|
||||
} else {
|
||||
$tab[] = length_accountg($line->numero_compte);
|
||||
}
|
||||
$nom_client = explode(" - ", $line->label_operation);
|
||||
$tab[] = mb_convert_encoding($nom_client[0], "Windows-1252", 'UTF-8');
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* trunc
|
||||
*
|
||||
|
||||
@ -602,7 +602,7 @@ class AccountingAccount extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account ";
|
||||
$sql .= "SET ".$fieldtouse." = '0'";
|
||||
$sql .= " WHERE rowid = ".$this->db->escape($id);
|
||||
$sql .= " WHERE rowid = ".((int) $id);
|
||||
|
||||
dol_syslog(get_class($this)."::accountDeactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
@ -640,7 +640,7 @@ class AccountingAccount extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account";
|
||||
$sql .= " SET ".$fieldtouse." = '1'";
|
||||
$sql .= " WHERE rowid = ".$this->db->escape($id);
|
||||
$sql .= " WHERE rowid = ".((int) $id);
|
||||
|
||||
dol_syslog(get_class($this)."::account_activate ".$fieldtouse." sql=".$sql, LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
@ -294,14 +294,14 @@ class BookKeeping extends CommonObject
|
||||
$sql = "SELECT count(*) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'";
|
||||
$sql .= " AND fk_doc = ".$this->fk_doc;
|
||||
$sql .= " AND fk_doc = ".((int) $this->fk_doc);
|
||||
if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
|
||||
// DO NOT USE THIS IN PRODUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries.
|
||||
$sql .= " AND fk_docdet = " . $this->fk_docdet; // This field can be 0 if record is for several lines
|
||||
$sql .= " AND fk_docdet = ".$this->fk_docdet; // This field can be 0 if record is for several lines
|
||||
}
|
||||
$sql .= " AND numero_compte = '".$this->db->escape($this->numero_compte)."'";
|
||||
$sql .= " AND label_operation = '".$this->db->escape($this->label_operation)."'";
|
||||
$sql .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features
|
||||
$sql .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -312,13 +312,13 @@ class BookKeeping extends CommonObject
|
||||
$sqlnum = "SELECT piece_num";
|
||||
$sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sqlnum .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'"; // For example doc_type = 'bank'
|
||||
$sqlnum .= " AND fk_doc = ".$this->fk_doc;
|
||||
$sqlnum .= " AND fk_doc = ".((int) $this->fk_doc);
|
||||
if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
|
||||
// fk_docdet is rowid into llx_bank or llx_facturedet or llx_facturefourndet, or ...
|
||||
$sqlnum .= " AND fk_docdet = ".((int) $this->fk_docdet);
|
||||
}
|
||||
$sqlnum .= " AND doc_ref = '".$this->db->escape($this->doc_ref)."'"; // ref of source object
|
||||
$sqlnum .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features
|
||||
$sqlnum .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features
|
||||
|
||||
dol_syslog(get_class($this).":: create sqlnum=".$sqlnum, LOG_DEBUG);
|
||||
$resqlnum = $this->db->query($sqlnum);
|
||||
@ -331,7 +331,7 @@ class BookKeeping extends CommonObject
|
||||
if (empty($this->piece_num)) {
|
||||
$sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum";
|
||||
$sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sqlnum .= " WHERE entity = ".$conf->entity; // Do not use getEntity for accounting features
|
||||
$sqlnum .= " WHERE entity = ".$conf->entity; // Do not use getEntity for accounting features
|
||||
|
||||
$resqlnum = $this->db->query($sqlnum);
|
||||
if ($resqlnum) {
|
||||
@ -728,7 +728,9 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " t.code_journal,";
|
||||
$sql .= " t.journal_label,";
|
||||
$sql .= " t.piece_num,";
|
||||
$sql .= " t.date_creation";
|
||||
$sql .= " t.date_creation,";
|
||||
$sql .= " t.date_export,";
|
||||
$sql .= " t.date_validated as date_validation";
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t';
|
||||
$sql .= ' WHERE 1 = 1';
|
||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||
@ -769,6 +771,9 @@ class BookKeeping extends CommonObject
|
||||
$this->journal_label = $obj->journal_label;
|
||||
$this->piece_num = $obj->piece_num;
|
||||
$this->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$this->date_export = $this->db->jdate($obj->date_export);
|
||||
$this->date_validation = $this->db->jdate($obj->date_validated);
|
||||
$this->date_validation = $this->db->jdate($obj->date_validation);
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
@ -834,7 +839,8 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " t.journal_label,";
|
||||
$sql .= " t.piece_num,";
|
||||
$sql .= " t.date_creation,";
|
||||
$sql .= " t.date_export";
|
||||
$sql .= " t.date_export,";
|
||||
$sql .= " t.date_validated as date_validation";
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
if (count($filter) > 0) {
|
||||
@ -853,6 +859,8 @@ class BookKeeping extends CommonObject
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.credit' || $key == 't.debit') {
|
||||
$sqlwhere[] = natural_search($key, $value, 1, 1);
|
||||
} elseif ($key == 't.reconciled_option') {
|
||||
@ -926,6 +934,8 @@ class BookKeeping extends CommonObject
|
||||
$line->piece_num = $obj->piece_num;
|
||||
$line->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$line->date_export = $this->db->jdate($obj->date_export);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validated);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validation);
|
||||
|
||||
$this->lines[] = $line;
|
||||
|
||||
@ -987,7 +997,8 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " t.date_creation,";
|
||||
$sql .= " t.date_lim_reglement,";
|
||||
$sql .= " t.tms as date_modification,";
|
||||
$sql .= " t.date_export";
|
||||
$sql .= " t.date_export,";
|
||||
$sql .= " t.date_validated as date_validation";
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
@ -1009,6 +1020,8 @@ class BookKeeping extends CommonObject
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.credit' || $key == 't.debit') {
|
||||
$sqlwhere[] = natural_search($key, $value, 1, 1);
|
||||
} else {
|
||||
@ -1054,7 +1067,7 @@ class BookKeeping extends CommonObject
|
||||
$line->label_operation = $obj->label_operation;
|
||||
$line->debit = $obj->debit;
|
||||
$line->credit = $obj->credit;
|
||||
$line->montant = $obj->amount; // deprecated
|
||||
$line->montant = $obj->amount; // deprecated
|
||||
$line->amount = $obj->amount;
|
||||
$line->sens = $obj->sens;
|
||||
$line->lettering_code = $obj->lettering_code;
|
||||
@ -1068,6 +1081,8 @@ class BookKeeping extends CommonObject
|
||||
$line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement);
|
||||
$line->date_modification = $this->db->jdate($obj->date_modification);
|
||||
$line->date_export = $this->db->jdate($obj->date_export);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validated);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validation);
|
||||
|
||||
$this->lines[] = $line;
|
||||
|
||||
@ -1454,6 +1469,8 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " AND code_journal = '".$this->db->escape($journal)."'";
|
||||
}
|
||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||
// Exclusion of validated entries at the time of deletion
|
||||
$sql .= " AND date_validated IS NULL";
|
||||
|
||||
// TODO: In a future we must forbid deletion if record is inside a closed fiscal period.
|
||||
|
||||
@ -1489,6 +1506,7 @@ class BookKeeping extends CommonObject
|
||||
$sql = "DELETE";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= " WHERE piece_num = ".(int) $piecenum;
|
||||
$sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion
|
||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@ -1603,7 +1621,8 @@ class BookKeeping extends CommonObject
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT piece_num,doc_date,code_journal,journal_label,doc_ref,doc_type,date_creation";
|
||||
$sql = "SELECT piece_num, doc_date,code_journal, journal_label, doc_ref, doc_type,";
|
||||
$sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
||||
$sql .= " WHERE piece_num = ".$piecenum;
|
||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||
@ -1620,6 +1639,10 @@ class BookKeeping extends CommonObject
|
||||
$this->doc_ref = $obj->doc_ref;
|
||||
$this->doc_type = $obj->doc_type;
|
||||
$this->date_creation = $obj->date_creation;
|
||||
$this->date_modification = $obj->date_modification;
|
||||
$this->date_export = $obj->date_export;
|
||||
$this->date_validation = $obj->date_validated;
|
||||
$this->date_validation = $obj->date_validation;
|
||||
} else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
dol_syslog(__METHOD__.$this->error, LOG_ERR);
|
||||
@ -1675,7 +1698,8 @@ class BookKeeping extends CommonObject
|
||||
$sql = "SELECT rowid, doc_date, doc_type,";
|
||||
$sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,";
|
||||
$sql .= " numero_compte, label_compte, label_operation, debit, credit,";
|
||||
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num, date_creation";
|
||||
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num,";
|
||||
$sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
||||
$sql .= " WHERE piece_num = ".$piecenum;
|
||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||
@ -1708,6 +1732,10 @@ class BookKeeping extends CommonObject
|
||||
$line->journal_label = $obj->journal_label;
|
||||
$line->piece_num = $obj->piece_num;
|
||||
$line->date_creation = $obj->date_creation;
|
||||
$line->date_modification = $obj->date_modification;
|
||||
$line->date_export = $obj->date_export;
|
||||
$line->date_validation = $obj->date_validated;
|
||||
$line->date_validation = $obj->date_validation;
|
||||
|
||||
$this->linesmvt[] = $line;
|
||||
}
|
||||
@ -1735,7 +1763,8 @@ class BookKeeping extends CommonObject
|
||||
$sql = "SELECT rowid, doc_date, doc_type,";
|
||||
$sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,";
|
||||
$sql .= " numero_compte, label_compte, label_operation, debit, credit,";
|
||||
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num";
|
||||
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,";
|
||||
$sql .= " date_validated as date_validation";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= " WHERE entity IN (".getEntity('accountancy').")";
|
||||
|
||||
@ -1770,6 +1799,8 @@ class BookKeeping extends CommonObject
|
||||
$line->sens = $obj->sens;
|
||||
$line->code_journal = $obj->code_journal;
|
||||
$line->piece_num = $obj->piece_num;
|
||||
$line->date_validation = $obj->date_validated;
|
||||
$line->date_validation = $obj->date_validation;
|
||||
|
||||
$this->linesexport[] = $line;
|
||||
}
|
||||
@ -2103,4 +2134,9 @@ class BookKeepingLine
|
||||
* @var integer|string $date_export;
|
||||
*/
|
||||
public $date_export;
|
||||
|
||||
/**
|
||||
* @var integer|string $date_validation;
|
||||
*/
|
||||
public $date_validation;
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
|
||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
|
||||
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
@ -124,7 +124,11 @@ if ($action == 'validate_movements_confirm' && !empty($user->rights->accounting-
|
||||
$form = new Form($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
llxHeader('', $langs->trans("Closure"));
|
||||
$title = $langs->trans('Closure');
|
||||
|
||||
$help_url ='EN:Module_Double_Entry_Accounting';
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if ($action == 'validate_movements') {
|
||||
$form_question = array();
|
||||
|
||||
@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
|
||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
|
||||
|
||||
// Security check
|
||||
if (empty($conf->accounting->enabled)) {
|
||||
@ -141,6 +141,9 @@ if ($action == 'validatehistory') {
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
|
||||
}
|
||||
$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";
|
||||
@ -155,6 +158,9 @@ if ($action == 'validatehistory') {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND l.product_type <= 2";
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
|
||||
dol_syslog('htdocs/accountancy/customer/index.php');
|
||||
$result = $db->query($sql);
|
||||
@ -198,11 +204,13 @@ if ($action == 'validatehistory') {
|
||||
}
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_sell)) {
|
||||
$objp->code_sell_t = $objp->company_code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_sell)) {
|
||||
$objp->code_sell_t = $objp->company_code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
}
|
||||
}
|
||||
|
||||
if ($objp->aarowid_suggest > 0) {
|
||||
@ -319,10 +327,10 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($row[13]).'</td>';
|
||||
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -405,10 +413,10 @@ if ($resql) {
|
||||
print '</td>';
|
||||
|
||||
for ($i = 2; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($row[13]).'</td>';
|
||||
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -472,9 +480,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr><td>'.$row[0].'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right"><b>'.price($row[13]).'</b></td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -533,9 +541,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr><td>'.$row[0].'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price(price2num($row[$i])).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($row[$i])).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right"><b>'.price(price2num($row[13])).'</b></td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price(price2num($row[13])).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
@ -220,7 +220,7 @@ $sql .= " AND f.fk_statut > 0";
|
||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")";
|
||||
} else {
|
||||
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
|
||||
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
|
||||
}
|
||||
// Add search filter like
|
||||
if ($search_societe) {
|
||||
@ -458,8 +458,8 @@ if ($result) {
|
||||
$productstatic->accountancy_code_sell_export = $objp->accountancy_code_sell_export;
|
||||
|
||||
$accountingaccountstatic->rowid = $objp->fk_compte;
|
||||
$accountingaccountstatic->label = $objp->label;
|
||||
$accountingaccountstatic->labelshort = $objp->labelshort;
|
||||
$accountingaccountstatic->label = $objp->label_account;
|
||||
$accountingaccountstatic->labelshort = $objp->labelshort_account;
|
||||
$accountingaccountstatic->account_number = $objp->account_number;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
@ -492,7 +492,7 @@ if ($result) {
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
|
||||
|
||||
print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
|
||||
|
||||
|
||||
@ -495,7 +495,7 @@ if ($result) {
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ', '', 1);
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
@ -687,7 +687,7 @@ if ($result) {
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="nowrap right">';
|
||||
print '<td class="right nowraponall amount">';
|
||||
print price($objp->total_ht);
|
||||
print '</td>';
|
||||
|
||||
@ -703,13 +703,13 @@ if ($result) {
|
||||
print '<td class="tdoverflowmax100">'.$thirdpartystatic->getNomUrl(1, 'customer').'</td>';
|
||||
|
||||
// Country
|
||||
print '<td>';
|
||||
$labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label;
|
||||
print $labelcountry;
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($labelcountry).'">';
|
||||
print dol_escape_htmltag($labelcountry);
|
||||
print '</td>';
|
||||
|
||||
// VAT Num
|
||||
print '<td>'.$objp->tva_intra.'</td>';
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($objp->tva_intra).'">'.dol_escape_htmltag($objp->tva_intra).'</td>';
|
||||
|
||||
// Found accounts
|
||||
print '<td class="small">';
|
||||
@ -739,13 +739,11 @@ if ($result) {
|
||||
$s .= (empty($objp->code_sell_p) ? '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($objp->code_sell_p));
|
||||
print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1);
|
||||
} else {
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
print '<br>';
|
||||
$s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': ';
|
||||
$shelp = '';
|
||||
$s .= $langs->trans("NotDefined");
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
print '<br>';
|
||||
$s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': ';
|
||||
$shelp = '';
|
||||
$s .= $langs->trans("NotDefined");
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
print '<br>';
|
||||
|
||||
@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
|
||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
|
||||
|
||||
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||
if (GETPOST("year", 'int')) {
|
||||
@ -210,10 +210,10 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($row[13]).'</td>';
|
||||
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -290,10 +290,10 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($row[13]).'</td>';
|
||||
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -352,9 +352,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr><td>'.$row[0].'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right"><b>'.price($row[13]).'</b></td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -388,7 +388,7 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
// Amount without taxes
|
||||
print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
|
||||
|
||||
// Vat rate
|
||||
print '<td class="center">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
|
||||
|
||||
@ -434,7 +434,7 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
// Amount without taxes
|
||||
print '<td class="nowrap right">';
|
||||
print '<td class="right nowraponall amount">';
|
||||
print price($objp->price);
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (empty($conf->comptabilite->enabled) && empty($conf->accounting->enabled) && empty($conf->asset->enabled) && empty($conf->intracommreport->enabled)) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->compta->resultat->lire) && empty($user->rights->accounting->mouvements->lire) && empty($user->rights->asset->read) && empty($user->rights->intracommreport->read)) {
|
||||
if (empty($user->rights->compta->resultat->lire) && empty($user->rights->accounting->comptarapport->lire) && empty($user->rights->accounting->mouvements->lire) && empty($user->rights->asset->read) && empty($user->rights->intracommreport->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ if (empty($user->rights->compta->resultat->lire) && empty($user->rights->account
|
||||
if (GETPOST('addbox')) {
|
||||
// Add box (when submit is done from a form when ajax disabled)
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
||||
$zone = GETPOST('areacode', 'aZ09');
|
||||
$zone = GETPOST('areacode', 'int');
|
||||
$userid = GETPOST('userid', 'int');
|
||||
$boxorder = GETPOST('boxorder', 'aZ09');
|
||||
$boxorder .= GETPOST('boxcombo', 'aZ09');
|
||||
|
||||
@ -177,7 +177,7 @@ $accountingjournalstatic->fetch($id_journal);
|
||||
$journal = $accountingjournalstatic->code;
|
||||
$journal_label = $accountingjournalstatic->label;
|
||||
|
||||
|
||||
//print $sql;
|
||||
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
@ -252,6 +252,7 @@ if ($result) {
|
||||
);
|
||||
|
||||
// Set accountancy code for user
|
||||
// $obj->accountancy_code is the accountancy_code of table u=user but it is defined only if a link with type 'user' exists)
|
||||
$compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : '');
|
||||
|
||||
$tabuser[$obj->rowid] = array(
|
||||
@ -277,7 +278,7 @@ if ($result) {
|
||||
$tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60);
|
||||
}
|
||||
|
||||
// Load of url links to the line into llx_bank
|
||||
// Load of url links to the line into llx_bank (so load llx_bank_url)
|
||||
$links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> )
|
||||
|
||||
// By default
|
||||
@ -287,7 +288,7 @@ if ($result) {
|
||||
|
||||
// get_url may return -1 which is not traversable
|
||||
if (is_array($links) && count($links) > 0) {
|
||||
// Now loop on each link of record in bank.
|
||||
// Now loop on each link of record in bank (code similar to bankentries_list.php)
|
||||
foreach ($links as $key => $val) {
|
||||
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) {
|
||||
// So we excluded 'company' and 'user' here. We want only payment lines
|
||||
@ -302,6 +303,7 @@ if ($result) {
|
||||
}
|
||||
}
|
||||
|
||||
// Special case to ask later to add more request to get information for old links without company link.
|
||||
if ($links[$key]['type'] == 'withdraw') {
|
||||
$tabmoreinfo[$obj->rowid]['withdraw'] = 1;
|
||||
}
|
||||
@ -401,6 +403,44 @@ if ($result) {
|
||||
$paymentsalstatic->label = $links[$key]['label'];
|
||||
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentsalstatic->getNomUrl(2);
|
||||
$tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id;
|
||||
|
||||
// This part of code is no more required. it is here to solve case where a link were missing (ith v14.0.0) and keep writing in accountancy complete.
|
||||
// Note: A better way to fix this is to delete payement of salary and recreate it, or to fix the bookkeeping table manually after.
|
||||
if (!empty($conf->global->ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USEr_ON_SALARY_BANK_PAYMENT)) {
|
||||
$tmpsalary = new Salary($db);
|
||||
$tmpsalary->fetch($paymentsalstatic->id);
|
||||
$tmpsalary->fetch_user($tmpsalary->fk_user);
|
||||
|
||||
$userstatic->id = $tmpsalary->user->id;
|
||||
$userstatic->name = $tmpsalary->user->name;
|
||||
$userstatic->email = $tmpsalary->user->email;
|
||||
$userstatic->firstname = $tmpsalary->user->firstname;
|
||||
$userstatic->lastname = $tmpsalary->user->lastname;
|
||||
$userstatic->statut = $tmpsalary->user->statut;
|
||||
$userstatic->accountancy_code = $tmpsalary->user->accountancy_code;
|
||||
|
||||
if ($userstatic->id > 0) {
|
||||
$tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0);
|
||||
} else {
|
||||
$tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen
|
||||
}
|
||||
|
||||
if (empty($obj->typeop_user)) { // Add test to avoid to add amount twice if a link already exists also on user.
|
||||
$compta_user = $userstatic->accountancy_code;
|
||||
if ($compta_user) {
|
||||
$tabtp[$obj->rowid][$compta_user] += $obj->amount;
|
||||
$tabuser[$obj->rowid] = array(
|
||||
'id' => $userstatic->id,
|
||||
'name' => dolGetFirstLastname($userstatic->firstname, $userstatic->lastname),
|
||||
'lastname' => $userstatic->lastname,
|
||||
'firstname' => $userstatic->firstname,
|
||||
'email' => $userstatic->email,
|
||||
'accountancy_code' => $compta_user,
|
||||
'status' => $userstatic->statut
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($links[$key]['type'] == 'payment_expensereport') {
|
||||
$paymentexpensereportstatic->id = $links[$key]['url_id'];
|
||||
$tabpay[$obj->rowid]["lib"] .= $paymentexpensereportstatic->getNomUrl(2);
|
||||
@ -468,7 +508,7 @@ if ($result) {
|
||||
}
|
||||
}
|
||||
|
||||
// If no links were found to know the amount on thirdparty, we init it to account 'NotDefined'.
|
||||
// If no links were found to know the amount on thirdparty/user, we init it to account 'NotDefined'.
|
||||
if (empty($tabtp[$obj->rowid])) {
|
||||
$tabtp[$obj->rowid]['NotDefined'] = $tabbq[$obj->rowid][$compta_bank];
|
||||
}
|
||||
@ -1108,8 +1148,8 @@ if (empty($action) || $action == 'view') {
|
||||
print $reflabel;
|
||||
print "</td>";
|
||||
print '<td class="center">'.$val["type_payment"]."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
@ -1162,9 +1202,9 @@ if (empty($action) || $action == 'view') {
|
||||
if ($tabtype[$key] == 'unknown') {
|
||||
// We will accept writing, but into a waiting account
|
||||
if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE == '-1') {
|
||||
print '<span class="error">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
|
||||
print '<span class="error small">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
|
||||
} else {
|
||||
print '<span class="warning">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
||||
print '<span class="warning small">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
||||
}
|
||||
} else {
|
||||
// We will refuse writing
|
||||
@ -1187,7 +1227,7 @@ if (empty($action) || $action == 'view') {
|
||||
if ($tabtype[$key] == 'member') {
|
||||
$errorstring = 'MainAccountForSubscriptionPaymentNotDefined';
|
||||
}
|
||||
print '<span class="error">'.$langs->trans($errorstring).'</span>';
|
||||
print '<span class="error small">'.$langs->trans($errorstring).'</span>';
|
||||
}
|
||||
} else {
|
||||
print $accounttoshow;
|
||||
@ -1196,7 +1236,7 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payment with subledger
|
||||
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payments that uses a subledger
|
||||
$accounttoshowsubledger = length_accounta($k);
|
||||
if ($accounttoshow != $accounttoshowsubledger) {
|
||||
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') {
|
||||
@ -1205,14 +1245,14 @@ if (empty($action) || $action == 'view') {
|
||||
var_dump($tabbq[$key]);*/
|
||||
//print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
if (!empty($tabcompany[$key]['code_compta'])) {
|
||||
if (in_array($tabtype[$key], array('payment_various'))) {
|
||||
if (in_array($tabtype[$key], array('payment_various', 'payment_salary'))) {
|
||||
// For such case, if subledger is not defined, we won't use subledger accounts.
|
||||
print '<span class="warning">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
|
||||
print '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
|
||||
} else {
|
||||
print '<span class="warning">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'</span>';
|
||||
print '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'</span>';
|
||||
}
|
||||
} else {
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
|
||||
print '<span class="error small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
|
||||
}
|
||||
} else {
|
||||
print $accounttoshowsubledger;
|
||||
@ -1220,10 +1260,15 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print "<td>".$reflabel."</td>";
|
||||
|
||||
print '<td class="center">'.$val["type_payment"]."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
@ -1259,8 +1304,8 @@ if (empty($action) || $action == 'view') {
|
||||
print "</td>";
|
||||
print "<td>".$reflabel."</td>";
|
||||
print '<td class="center">'.$val["type_payment"]."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
@ -1320,7 +1365,7 @@ function getSourceDocRef($val, $typerecord)
|
||||
if ($typerecord == 'payment') {
|
||||
$sqlmid = 'SELECT payfac.fk_facture as id, f.ref as ref';
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f";
|
||||
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".$val["paymentid"];
|
||||
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".((int) $val["paymentid"]);
|
||||
$ref = $langs->transnoentitiesnoconv("Invoice");
|
||||
} elseif ($typerecord == 'payment_supplier') {
|
||||
$sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref';
|
||||
|
||||
@ -610,8 +610,8 @@ if (empty($action) || $action == 'view') {
|
||||
$userstatic->id = $tabuser[$key]['id'];
|
||||
$userstatic->name = $tabuser[$key]['name'];
|
||||
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
@ -644,8 +644,8 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
print '</td>';
|
||||
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$langs->trans("SubledgerAccount")."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
@ -680,8 +680,8 @@ if (empty($action) || $action == 'view') {
|
||||
print '</td>';
|
||||
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '');
|
||||
print "</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))
|
||||
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
|
||||
}
|
||||
|
||||
$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,";
|
||||
$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlr, f.close_code,";
|
||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
|
||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||
@ -911,8 +911,8 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
print '</td>';
|
||||
print "<td>".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("SubledgerAccount")."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
@ -940,8 +940,8 @@ if (empty($action) || $action == 'view') {
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
print "<td>".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$accountingaccount->label."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
@ -977,8 +977,8 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>";
|
||||
print $companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '');
|
||||
print "</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
@ -1005,8 +1005,8 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>";
|
||||
print '</td>';
|
||||
print "<td>".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("VAT")." NPR (counterpart)</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -851,8 +851,8 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
print '</td>';
|
||||
print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("SubledgerAccount")."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
@ -880,8 +880,8 @@ if (empty($action) || $action == 'view') {
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$accountingaccount->label."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
@ -916,8 +916,8 @@ if (empty($action) || $action == 'view') {
|
||||
print '</td>';
|
||||
print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '');
|
||||
print "</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
|
||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
|
||||
|
||||
// Security check
|
||||
if (empty($conf->accounting->enabled)) {
|
||||
@ -149,6 +149,9 @@ if ($action == 'validatehistory') {
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
|
||||
}
|
||||
$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";
|
||||
@ -163,6 +166,9 @@ if ($action == 'validatehistory') {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_product_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND l.product_type <= 2";
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
|
||||
dol_syslog('htdocs/accountancy/supplier/index.php');
|
||||
|
||||
@ -199,11 +205,13 @@ if ($action == 'validatehistory') {
|
||||
}
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_buy)) {
|
||||
$objp->code_buy_t = $objp->company_code_buy;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_buy)) {
|
||||
$objp->code_buy_t = $objp->company_code_buy;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
}
|
||||
}
|
||||
|
||||
if ($objp->aarowid_suggest > 0) {
|
||||
@ -314,10 +322,10 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($row[13]).'</td>';
|
||||
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -393,10 +401,10 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($row[13]).'</td>';
|
||||
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -456,9 +464,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr><td>'.$row[0].'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right"><b>'.price($row[13]).'</b></td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
@ -194,7 +194,7 @@ print '<script type="text/javascript">
|
||||
*/
|
||||
$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.product_type as line_type, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
|
||||
$sql .= " aa.label, aa.labelshort, aa.account_number,";
|
||||
$sql .= " aa.label as label_account, aa.labelshort as labelshort_account, aa.account_number,";
|
||||
$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, p.tobuy, p.tosell,";
|
||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||
$sql .= " ppe.accountancy_code_buy, ppe.accountancy_code_buy_intra, ppe.accountancy_code_buy_export,";
|
||||
@ -459,8 +459,8 @@ if ($result) {
|
||||
$productstatic->accountancy_code_buy_export = $objp->accountancy_code_sell_buy;
|
||||
|
||||
$accountingaccountstatic->rowid = $objp->fk_compte;
|
||||
$accountingaccountstatic->label = $objp->label;
|
||||
$accountingaccountstatic->labelshort = $objp->labelshort;
|
||||
$accountingaccountstatic->label = $objp->label_account;
|
||||
$accountingaccountstatic->labelshort = $objp->labelshort_account;
|
||||
$accountingaccountstatic->account_number = $objp->account_number;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
@ -497,7 +497,7 @@ if ($result) {
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
|
||||
|
||||
print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
|
||||
|
||||
@ -513,7 +513,7 @@ if ($result) {
|
||||
|
||||
print '<td>'.$objp->tva_intra.'</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
print '<td>';
|
||||
print $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1);
|
||||
print ' <a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
||||
print img_edit();
|
||||
|
||||
@ -482,7 +482,7 @@ if ($result) {
|
||||
print '<td class="liste_titre 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 maxwidth75imp" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth125', 'code2', 1, 0, 1);
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth125', 'code2', 1, 0, 1, null, 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>';
|
||||
@ -503,7 +503,7 @@ if ($result) {
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ', '', 1);
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
@ -671,7 +671,7 @@ if ($result) {
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="nowrap right">';
|
||||
print '<td class="right nowraponall amount">';
|
||||
print price($objp->total_ht);
|
||||
print '</td>';
|
||||
|
||||
@ -687,13 +687,13 @@ if ($result) {
|
||||
print '<td class="tdoverflowmax100">'.$thirdpartystatic->getNomUrl(1, 'supplier').'</td>';
|
||||
|
||||
// Country
|
||||
print '<td>';
|
||||
$labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label;
|
||||
print $labelcountry;
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($labelcountry).'">';
|
||||
print dol_escape_htmltag($labelcountry);
|
||||
print '</td>';
|
||||
|
||||
// VAT Num
|
||||
print '<td>'.$objp->tva_intra.'</td>';
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($objp->tva_intra).'">'.dol_escape_htmltag($objp->tva_intra).'</td>';
|
||||
|
||||
// Found accounts
|
||||
print '<td class="small">';
|
||||
|
||||
@ -16,6 +16,8 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// $formatexportset ùust be defined
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || !is_object($conf)) {
|
||||
print "Error, template page can't be called as URL";
|
||||
@ -56,6 +58,8 @@ if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$
|
||||
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
|
||||
|
||||
$completefilename = $siren."FEC".$endaccountingperiod.".txt";
|
||||
} elseif ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_CIEL && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
|
||||
$completefilename = "XIMPORT.TXT";
|
||||
} else {
|
||||
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;
|
||||
}
|
||||
|
||||
@ -72,12 +72,12 @@ if ($action == 'set_default') {
|
||||
} elseif ($action == 'setdoc') {
|
||||
// Set default model
|
||||
if (dolibarr_set_const($db, "MEMBER_ADDON_PDF_ODT", $value, 'chaine', 0, '', $conf->entity)) {
|
||||
// La constante qui a ete lue en avant du nouveau set
|
||||
// on passe donc par une variable pour avoir un affichage coherent
|
||||
// The constant that was read ahead of the new set
|
||||
// we therefore go through a variable to have a consistent display
|
||||
$conf->global->MEMBER_ADDON_PDF_ODT = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
// We activate the model
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
@ -197,6 +197,8 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="updateall">';
|
||||
|
||||
print load_fiche_titre($langs->trans("MemberMainOptions"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
@ -261,6 +263,7 @@ if ($conf->facture->enabled) {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
|
||||
print '<td>';
|
||||
$selected = (empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) ? '' : $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
|
||||
print img_picto('', 'product', 'class="pictofixedwidth"');
|
||||
$form->select_produits($selected, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0);
|
||||
print '</td>';
|
||||
}
|
||||
@ -268,6 +271,7 @@ if ($conf->facture->enabled) {
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
@ -317,7 +321,7 @@ $helptext .= '__YEAR__, __MONTH__, __DAY__';
|
||||
form_constantes($constantes, 0, $helptext);
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
// Defini tableau def des modeles
|
||||
// Defined model definition table
|
||||
$def = array();
|
||||
$sql = "SELECT nom";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||
@ -338,6 +342,7 @@ if ($resql) {
|
||||
|
||||
print load_fiche_titre($langs->trans("MembersDocModules"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
@ -446,6 +451,8 @@ foreach ($dirmodels as $reldir) {
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print "<br>";
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
@ -39,6 +39,8 @@ if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$error = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -57,7 +59,8 @@ if ($action == 'update') {
|
||||
$amount = GETPOST('MEMBER_NEWFORM_AMOUNT');
|
||||
$editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
|
||||
$payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE');
|
||||
$forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE');
|
||||
$forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int');
|
||||
$forcemorphy = GETPOST('MEMBER_NEWFORM_FORCEMORPHY', 'aZ09');
|
||||
|
||||
$res = dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC", $public, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT", $amount, 'chaine', 0, '', $conf->entity);
|
||||
@ -68,6 +71,11 @@ if ($action == 'update') {
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE", $forcetype, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if ($forcemorphy == '-1') {
|
||||
$res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCEMORPHY", $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCEMORPHY", $forcemorphy, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
@ -164,6 +172,7 @@ print '<br>';
|
||||
if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
print '<br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -182,6 +191,16 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listofval) > 1 ? 1 : 0);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Force nature of member (mor/phy)
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Moral");
|
||||
print '<tr class="oddeven drag" id="trforcenature"><td>';
|
||||
print $langs->trans("ForceMemberNature");
|
||||
print '</td><td class="right">';
|
||||
$forcenature = empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY) ? 0 : $conf->global->MEMBER_NEWFORM_FORCEMORPHY;
|
||||
print $form->selectarray("MEMBER_NEWFORM_FORCEMORPHY", $morphys, $forcenature, 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Amount
|
||||
print '<tr class="oddeven" id="tramount"><td>';
|
||||
print $langs->trans("DefaultAmount");
|
||||
@ -216,6 +235,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
@ -244,7 +264,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
|
||||
print '<div class="urllink">';
|
||||
print '<input type="text" id="publicurlmember" class="quatrevingtpercent" value="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">';
|
||||
print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">';
|
||||
print '<a target="_blank" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
|
||||
print '</div>';
|
||||
print ajax_autoselect('publicurlmember');
|
||||
|
||||
@ -31,8 +31,6 @@ print load_fiche_titre($this->control->tpl['title']);
|
||||
|
||||
dol_htmloutput_errors((is_numeric($object->error) ? '' : $object->error), $object->errors);
|
||||
|
||||
dol_htmloutput_errors((is_numeric($GLOBALS['error']) ? '' : $GLOBALS['error']), $GLOBALS['errors']);
|
||||
|
||||
dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']);
|
||||
|
||||
echo $this->control->tpl['ajax_selectcountry']; ?>
|
||||
@ -68,7 +66,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Morphy"); ?></td>
|
||||
<td colspan="3"><input name="morphy" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
|
||||
<td colspan="3"><input name="morphy" type="text" class="minwidth200" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@ -105,7 +103,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Email"); ?></td>
|
||||
<td colspan="3"><input name="email" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
|
||||
<td colspan="3"><input name="email" type="text" class="minwidth200" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@ -77,7 +77,7 @@ echo $this->control->tpl['ajax_selectcountry'];
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Morphy"); ?></td>
|
||||
<td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
|
||||
<td colspan="3"><input name="poste" type="text" class="minwidth200" maxlength="80" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@ -114,7 +114,7 @@ echo $this->control->tpl['ajax_selectcountry'];
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Email"); ?></td>
|
||||
<td><input name="email" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
|
||||
<td><input name="email" type="text" class="minwidth200" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2012-2020 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -1054,6 +1054,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Country
|
||||
$object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id;
|
||||
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td>';
|
||||
print img_picto('', 'country', 'class="pictofixedwidth"');
|
||||
print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'alpha') : $object->country_id, 'country_id');
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
@ -1064,6 +1065,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (empty($conf->global->MEMBER_DISABLE_STATE)) {
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
if ($object->country_id) {
|
||||
print img_picto('', 'state', 'class="pictofixedwidth"');
|
||||
print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $object->state_id, $object->country_code);
|
||||
} else {
|
||||
print $countrynotdefined;
|
||||
@ -1088,7 +1090,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (!$value['active']) {
|
||||
break;
|
||||
}
|
||||
print '<tr><td>'.$langs->trans($value['label']).'</td><td><input type="text" name="member_'.$key.'" size="40" value="'.(GETPOSTISSET('member_'.$key) ? GETPOST('member_'.$key, 'alpha') : $object->socialnetworks[$key]).'"></td></tr>';
|
||||
$val = (GETPOSTISSET('member_'.$key) ? GETPOST('member_'.$key, 'alpha') : (empty($object->socialnetworks[$key]) ? '' : $object->socialnetworks[$key]));
|
||||
print '<tr><td>'.$langs->trans($value['label']).'</td><td><input type="text" name="member_'.$key.'" size="40" value="'.$val.'"></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1302,6 +1305,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Country
|
||||
//$object->country_id=$object->country_id?$object->country_id:$mysoc->country_id; // In edit mode we don't force to company country if not defined
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
||||
print img_picto('', 'country', 'class="pictofixedwidth"');
|
||||
print $form->select_country(GETPOSTISSET("country_id") ? GETPOST("country_id", "alpha") : $object->country_id, 'country_id');
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
@ -1311,21 +1315,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// State
|
||||
if (empty($conf->global->MEMBER_DISABLE_STATE)) {
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
print img_picto('', 'state', 'class="pictofixedwidth"');
|
||||
print $formcompany->select_state($object->state_id, GETPOSTISSET("country_id") ? GETPOST("country_id", "alpha") : $object->country_id);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Pro phone
|
||||
print '<tr><td>'.$langs->trans("PhonePro").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning').' <input type="text" name="phone" value="'.(GETPOSTISSET("phone") ? GETPOST("phone") : $object->phone).'"></td></tr>';
|
||||
print '<td>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' <input type="text" name="phone" value="'.(GETPOSTISSET("phone") ? GETPOST("phone") : $object->phone).'"></td></tr>';
|
||||
|
||||
// Personal phone
|
||||
print '<tr><td>'.$langs->trans("PhonePerso").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning').' <input type="text" name="phone_perso" value="'.(GETPOSTISSET("phone_perso") ? GETPOST("phone_perso") : $object->phone_perso).'"></td></tr>';
|
||||
print '<td>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' <input type="text" name="phone_perso" value="'.(GETPOSTISSET("phone_perso") ? GETPOST("phone_perso") : $object->phone_perso).'"></td></tr>';
|
||||
|
||||
// Mobile phone
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning_mobile').' <input type="text" name="phone_mobile" value="'.(GETPOSTISSET("phone_mobile") ? GETPOST("phone_mobile") : $object->phone_mobile).'"></td></tr>';
|
||||
print '<td>'.img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"').' <input type="text" name="phone_mobile" value="'.(GETPOSTISSET("phone_mobile") ? GETPOST("phone_mobile") : $object->phone_mobile).'"></td></tr>';
|
||||
|
||||
if (!empty($conf->socialnetworks->enabled)) {
|
||||
foreach ($socialnetworks as $key => $value) {
|
||||
@ -1726,15 +1731,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Password
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||
print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $object->pass);
|
||||
print '<tr><td>'.$langs->trans("Password").'</td><td>';
|
||||
if ($object->pass) {
|
||||
print preg_replace('/./i', '*', $object->pass);
|
||||
} else {
|
||||
if ($user->admin) {
|
||||
print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted;
|
||||
} else {
|
||||
print $langs->trans("Hidden");
|
||||
print '<!-- '.$langs->trans("Crypted").': '.$object->pass_indatabase_crypted.' -->';
|
||||
}
|
||||
print '<span class="opacitymedium"'.$langs->trans("Hidden").'</span>';
|
||||
}
|
||||
if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
|
||||
$langs->load("errors");
|
||||
@ -1891,7 +1895,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}*/
|
||||
|
||||
// Modify
|
||||
if (!$user->rights->adherent->creer) {
|
||||
if (!empty($user->rights->adherent->creer)) {
|
||||
print '<a class="butAction" href="card.php?rowid='.$id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</span>'."\n";
|
||||
@ -1907,7 +1911,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Reactivate
|
||||
if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $Object->statut) {
|
||||
if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $object->statut) {
|
||||
if ($user->rights->adherent->creer) {
|
||||
print '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Reenable")."</a>\n";
|
||||
} else {
|
||||
|
||||
@ -260,9 +260,9 @@ class Adherent extends CommonObject
|
||||
|
||||
public $datefin;
|
||||
|
||||
// From member table
|
||||
|
||||
// Fields loaded by fetch_subscriptions()
|
||||
// Fields loaded by fetch_subscriptions() from member table
|
||||
|
||||
public $first_subscription_date;
|
||||
|
||||
public $first_subscription_amount;
|
||||
@ -277,6 +277,12 @@ class Adherent extends CommonObject
|
||||
|
||||
public $subscriptions = array();
|
||||
|
||||
|
||||
// Fields loaded by fetchPartnerships() from partnership table
|
||||
|
||||
public $partnerships = array();
|
||||
|
||||
|
||||
/**
|
||||
* @var Adherent To contains a clone of this when we need to save old properties of object
|
||||
*/
|
||||
@ -296,15 +302,15 @@ class Adherent extends CommonObject
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1),
|
||||
'ref_ext' => array('type' => 'varchar(128)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 20),
|
||||
'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => -1, 'position' => 25),
|
||||
'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => -1, 'position' => 30),
|
||||
'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => -1, 'position' => 35),
|
||||
'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => -1, 'position' => 30, 'showoncombobox'=>1),
|
||||
'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => -1, 'position' => 35, 'showoncombobox'=>1),
|
||||
'login' => array('type' => 'varchar(50)', 'label' => 'Login', 'enabled' => 1, 'visible' => -1, 'position' => 40),
|
||||
'gender' => array('type' => 'varchar(10)', 'label' => 'Gender', 'enabled' => 1, 'visible' => -1, 'position' => 250),
|
||||
'pass' => array('type' => 'varchar(50)', 'label' => 'Pass', 'enabled' => 1, 'visible' => -1, 'position' => 45),
|
||||
'pass_crypted' => array('type' => 'varchar(128)', 'label' => 'Pass crypted', 'enabled' => 1, 'visible' => -1, 'position' => 50),
|
||||
'fk_adherent_type' => array('type' => 'integer', 'label' => 'Fk adherent type', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 55),
|
||||
'morphy' => array('type' => 'varchar(3)', 'label' => 'MorPhy', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 60),
|
||||
'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => -1, 'position' => 65),
|
||||
'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => -1, 'position' => 65, 'showoncombobox'=>2),
|
||||
'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => -1, 'position' => 70),
|
||||
'address' => array('type' => 'text', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 75),
|
||||
'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80),
|
||||
@ -592,8 +598,8 @@ class Adherent extends CommonObject
|
||||
if ($this->user_id) {
|
||||
// Add link to user
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET";
|
||||
$sql .= " fk_member = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".$this->user_id;
|
||||
$sql .= " fk_member = ".((int) $this->id);
|
||||
$sql .= " WHERE rowid = ".((int) $this->user_id);
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
@ -722,7 +728,7 @@ class Adherent extends CommonObject
|
||||
if (!empty($this->oldcopy) && $this->typeid != $this->oldcopy->typeid) {
|
||||
$sql2 = "SELECT libelle as label";
|
||||
$sql2 .= " FROM ".MAIN_DB_PREFIX."adherent_type";
|
||||
$sql2 .= " WHERE rowid = ".$this->typeid;
|
||||
$sql2 .= " WHERE rowid = ".((int) $this->typeid);
|
||||
$resql2 = $this->db->query($sql2);
|
||||
if ($resql2) {
|
||||
while ($obj = $this->db->fetch_object($resql2)) {
|
||||
@ -1439,11 +1445,12 @@ class Adherent extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Function to get member subscriptions data
|
||||
* first_subscription_date, first_subscription_date_start, first_subscription_date_end, first_subscription_amount
|
||||
* last_subscription_date, last_subscription_date_start, last_subscription_date_end, last_subscription_amount
|
||||
* Function to get member subscriptions data:
|
||||
* subscriptions,
|
||||
* first_subscription_date, first_subscription_date_start, first_subscription_date_end, first_subscription_amount
|
||||
* last_subscription_date, last_subscription_date_start, last_subscription_date_end, last_subscription_amount
|
||||
*
|
||||
* @return int <0 si KO, >0 si OK
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetch_subscriptions()
|
||||
{
|
||||
@ -1475,7 +1482,7 @@ class Adherent extends CommonObject
|
||||
$this->first_subscription_amount = $obj->subscription;
|
||||
}
|
||||
$this->last_subscription_date = $this->db->jdate($obj->datec);
|
||||
$this->last_subscription_date_start = $this->db->jdate($obj->datef);
|
||||
$this->last_subscription_date_start = $this->db->jdate($obj->dateh);
|
||||
$this->last_subscription_date_end = $this->db->jdate($obj->datef);
|
||||
$this->last_subscription_amount = $obj->subscription;
|
||||
|
||||
@ -1503,6 +1510,25 @@ class Adherent extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to get partnerships array
|
||||
*
|
||||
* @param string $mode 'member' or 'thirdparty'
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetchPartnerships($mode)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/parntership/class/partnership.class.php';
|
||||
|
||||
|
||||
$this->partnerships[] = array();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Insert subscription into database and eventually add links to banks, mailman, etc...
|
||||
*
|
||||
@ -1712,7 +1738,8 @@ class Adherent extends CommonObject
|
||||
}
|
||||
}
|
||||
$invoice->socid = $this->fk_soc;
|
||||
$invoice->date = $datesubscription;
|
||||
//$invoice->date = $datesubscription;
|
||||
$invoice->date = dol_now();
|
||||
|
||||
// Possibility to add external linked objects with hooks
|
||||
$invoice->linked_objects['subscription'] = $subscriptionid;
|
||||
|
||||
@ -362,11 +362,11 @@ class AdherentType extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent_type ";
|
||||
$sql .= "SET ";
|
||||
$sql .= "statut = ".$this->status.",";
|
||||
$sql .= "statut = ".((int) $this->status).",";
|
||||
$sql .= "libelle = '".$this->db->escape($this->label)."',";
|
||||
$sql .= "morphy = '".$this->db->escape($this->morphy)."',";
|
||||
$sql .= "subscription = '".$this->db->escape($this->subscription)."',";
|
||||
$sql .= "amount = '".$this->db->escape($this->amount)."',";
|
||||
$sql .= "amount = ".((empty($this->amount) && $this->amount == '') ? 'null' : ((float) $this->amount)).",";
|
||||
$sql .= "duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."',";
|
||||
$sql .= "note = '".$this->db->escape($this->note)."',";
|
||||
$sql .= "vote = ".(integer) $this->db->escape($this->vote).",";
|
||||
@ -656,19 +656,19 @@ class AdherentType extends CommonObject
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $maxlen length max label
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $maxlen length max label
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param string $morecss Add more css on link
|
||||
* @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
|
||||
*/
|
||||
public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0)
|
||||
public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$result = '';
|
||||
|
||||
$label = '';
|
||||
|
||||
$label = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("MemberType").'</u>';
|
||||
$label .= ' '.$this->getLibStatut(4);
|
||||
$label .= '<br>'.$langs->trans("Label").': '.$this->label;
|
||||
@ -676,7 +676,22 @@ class AdherentType extends CommonObject
|
||||
$label .= '<br>'.$langs->trans("SubscriptionRequired").': '.yn($this->subscription);
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?rowid='.((int) $this->id).'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$option = '';
|
||||
|
||||
$url = DOL_URL_ROOT.'/adherents/type.php?rowid='.((int) $this->id);
|
||||
|
||||
if ($option != 'nolink') {
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
|
||||
$add_save_lastsearch_values = 1;
|
||||
}
|
||||
if ($add_save_lastsearch_values) {
|
||||
$url .= '&save_lastsearch_values=1';
|
||||
}
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$linkend = '</a>';
|
||||
|
||||
$result .= $linkstart;
|
||||
|
||||
@ -92,7 +92,7 @@ class AdherentStats extends Stats
|
||||
$sql = "SELECT date_format(p.dateadh,'%m') as dm, count(*)";
|
||||
$sql .= " FROM ".$this->from;
|
||||
//if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE date_format(p.dateadh,'%Y') = ".((int) $year);
|
||||
$sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1);
|
||||
$sql .= " AND ".$this->where;
|
||||
$sql .= " GROUP BY dm";
|
||||
$sql .= $this->db->order('dm', 'DESC');
|
||||
@ -133,7 +133,7 @@ class AdherentStats extends Stats
|
||||
$sql = "SELECT date_format(p.dateadh,'%m') as dm, sum(p.".$this->field.")";
|
||||
$sql .= " FROM ".$this->from;
|
||||
//if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE date_format(p.dateadh,'%Y') = ".((int) $year);
|
||||
$sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1);
|
||||
$sql .= " AND ".$this->where;
|
||||
$sql .= " GROUP BY dm";
|
||||
$sql .= $this->db->order('dm', 'DESC');
|
||||
@ -154,7 +154,7 @@ class AdherentStats extends Stats
|
||||
$sql = "SELECT date_format(p.dateadh,'%m') as dm, avg(p.".$this->field.")";
|
||||
$sql .= " FROM ".$this->from;
|
||||
//if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE date_format(p.dateadh,'%Y') = ".((int) $year);
|
||||
$sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1);
|
||||
$sql .= " AND ".$this->where;
|
||||
$sql .= " GROUP BY dm";
|
||||
$sql .= $this->db->order('dm', 'DESC');
|
||||
|
||||
@ -228,12 +228,12 @@ class Members extends DolibarrApi
|
||||
}
|
||||
$sql .= ' WHERE t.entity IN ('.getEntity('adherent').')';
|
||||
if (!empty($typeid)) {
|
||||
$sql .= ' AND t.fk_adherent_type='.$typeid;
|
||||
$sql .= ' AND t.fk_adherent_type='.((int) $typeid);
|
||||
}
|
||||
// Select members of given category
|
||||
if ($category > 0) {
|
||||
$sql .= " AND c.fk_categorie = ".$this->db->escape($category);
|
||||
$sql .= " AND c.fk_member = t.rowid ";
|
||||
$sql .= " AND c.fk_categorie = ".((int) $category);
|
||||
$sql .= " AND c.fk_member = t.rowid";
|
||||
}
|
||||
// Add sql filters
|
||||
if ($sqlfilters) {
|
||||
|
||||
@ -168,7 +168,7 @@ class Subscription extends CommonObject
|
||||
$sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape($type)."', '".$this->db->idate($now)."',";
|
||||
$sql .= " '".$this->db->idate($this->dateh)."',";
|
||||
$sql .= " '".$this->db->idate($this->datef)."',";
|
||||
$sql .= " ".$this->amount.",";
|
||||
$sql .= " ".((float) $this->amount).",";
|
||||
$sql .= " '".$this->db->escape($this->note_public ? $this->note_public : $this->note)."')";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@ -267,14 +267,14 @@ class Subscription extends CommonObject
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
|
||||
$sql .= " fk_type = ".$this->fk_type.",";
|
||||
$sql .= " fk_adherent = ".$this->fk_adherent.",";
|
||||
$sql .= " fk_type = ".((int) $this->fk_type).",";
|
||||
$sql .= " fk_adherent = ".((int) $this->fk_adherent).",";
|
||||
$sql .= " note=".($this->note ? "'".$this->db->escape($this->note)."'" : 'null').",";
|
||||
$sql .= " subscription = ".price2num($this->amount).",";
|
||||
$sql .= " dateadh='".$this->db->idate($this->dateh)."',";
|
||||
$sql .= " datef='".$this->db->idate($this->datef)."',";
|
||||
$sql .= " datec='".$this->db->idate($this->datec)."',";
|
||||
$sql .= " fk_bank = ".($this->fk_bank ? $this->fk_bank : 'null');
|
||||
$sql .= " fk_bank = ".($this->fk_bank ? ((int) $this->fk_bank) : 'null');
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
@ -341,7 +341,7 @@ class Subscription extends CommonObject
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."subscription WHERE rowid = ".$this->id;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."subscription WHERE rowid = ".((int) $this->id);
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
|
||||
@ -93,6 +93,8 @@ if ($id) {
|
||||
$caneditfieldmember = $user->rights->adherent->creer;
|
||||
}
|
||||
|
||||
$permissiontoadd = $canaddmember;
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'adherent', $object->id, '', '', 'socid', 'rowid', 0);
|
||||
|
||||
@ -180,7 +182,7 @@ if ($id > 0) {
|
||||
print dol_get_fiche_end();
|
||||
|
||||
$modulepart = 'member';
|
||||
$permission = $user->rights->adherent->creer;
|
||||
$permissiontoadd = $user->rights->adherent->creer;
|
||||
$permtoedit = $user->rights->adherent->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
|
||||
@ -52,7 +52,7 @@ $result = restrictedArea($user, 'adherent');
|
||||
if (GETPOST('addbox')) {
|
||||
// Add box (when submit is done from a form when ajax disabled)
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
||||
$zone = GETPOST('areacode', 'aZ09');
|
||||
$zone = GETPOST('areacode', 'int');
|
||||
$userid = GETPOST('userid', 'int');
|
||||
$boxorder = GETPOST('boxorder', 'aZ09');
|
||||
$boxorder .= GETPOST('boxcombo', 'aZ09');
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2014-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2021 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
|
||||
@ -64,6 +65,7 @@ $search_filter = GETPOST("search_filter", 'alpha');
|
||||
$search_status = GETPOST("search_status", 'intcomma');
|
||||
$catid = GETPOST("catid", 'int');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
$filter = GETPOST("filter", 'alpha');
|
||||
if ($filter) {
|
||||
@ -174,7 +176,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
$parameters = array('socid'=>$socid);
|
||||
$parameters = array('socid'=>isset($socid) ? $socid : null);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
@ -305,7 +307,12 @@ $memberstatic = new Adherent($db);
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
$sql = "SELECT d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,";
|
||||
if (!empty($search_categ) || !empty($catid)) {
|
||||
$sql = "SELECT DISTINCT";
|
||||
} else {
|
||||
$sql = "SELECT";
|
||||
}
|
||||
$sql .= " d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,";
|
||||
$sql .= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
|
||||
$sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,";
|
||||
$sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
|
||||
@ -325,7 +332,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N
|
||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)";
|
||||
}
|
||||
if (!empty($search_categ) || !empty($catid)) {
|
||||
@ -336,7 +343,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = d
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = d.state_id)";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on (s.rowid = d.fk_soc)";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql .= " WHERE d.fk_adherent_type = t.rowid ";
|
||||
$sql .= " WHERE d.fk_adherent_type = t.rowid";
|
||||
if ($catid > 0) {
|
||||
$sql .= " AND cm.fk_categorie = ".((int) $catid);
|
||||
}
|
||||
@ -357,13 +364,13 @@ if ($search_type > 0) {
|
||||
$sql .= " AND t.rowid=".((int) $search_type);
|
||||
}
|
||||
if ($search_filter == 'withoutsubscription') {
|
||||
$sql .= " AND (datefin IS NULL OR t.subscription = 0)";
|
||||
$sql .= " AND (datefin IS NULL OR t.subscription = '0')";
|
||||
}
|
||||
if ($search_filter == 'uptodate') {
|
||||
$sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = 0)";
|
||||
$sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = '0')";
|
||||
}
|
||||
if ($search_filter == 'outofdate') {
|
||||
$sql .= " AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)";
|
||||
$sql .= " AND (datefin < '".$db->idate($now)."' AND t.subscription = '1')";
|
||||
}
|
||||
if ($search_status != '') {
|
||||
// Peut valoir un nombre ou liste de nombre separes par virgules
|
||||
@ -467,28 +474,28 @@ llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adh&eacu
|
||||
|
||||
$titre = $langs->trans("MembersList");
|
||||
if (GETPOSTISSET("search_status")) {
|
||||
if ($search_status == '-1,1') {
|
||||
if ($search_status == '-1,1') { // TODO : check this test as -1 == Adherent::STATUS_DRAFT and -2 == Adherent::STATUS_EXLCUDED
|
||||
$titre = $langs->trans("MembersListQualified");
|
||||
}
|
||||
if ($search_status == '-1') {
|
||||
if ($search_status == Adherent::STATUS_DRAFT) {
|
||||
$titre = $langs->trans("MembersListToValid");
|
||||
}
|
||||
if ($search_status == '1' && $filter == '') {
|
||||
if ($search_status == Adherent::STATUS_VALIDATED && $filter == '') {
|
||||
$titre = $langs->trans("MembersValidated");
|
||||
}
|
||||
if ($search_status == '1' && $filter == 'withoutsubscription') {
|
||||
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'withoutsubscription') {
|
||||
$titre = $langs->trans("MembersWithSubscriptionToReceive");
|
||||
}
|
||||
if ($search_status == '1' && $filter == 'uptodate') {
|
||||
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'uptodate') {
|
||||
$titre = $langs->trans("MembersListUpToDate");
|
||||
}
|
||||
if ($search_status == '1' && $filter == 'outofdate') {
|
||||
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'outofdate') {
|
||||
$titre = $langs->trans("MembersListNotUpToDate");
|
||||
}
|
||||
if ($search_status == '0') {
|
||||
if ($search_status == Adherent::STATUS_RESILIATED) {
|
||||
$titre = $langs->trans("MembersListResiliated");
|
||||
}
|
||||
if ($search_status == '-2') {
|
||||
if ($search_status == Adherent::STATUS_EXCLUDED) {
|
||||
$titre = $langs->trans("MembersListExcluded");
|
||||
}
|
||||
} elseif ($action == 'search') {
|
||||
@ -565,7 +572,7 @@ if ($search_phone_mobile != '') {
|
||||
if ($search_filter && $search_filter != '-1') {
|
||||
$param .= "&search_filter=".urlencode($search_filter);
|
||||
}
|
||||
if ($search_status != "" && $search_status != '-1') {
|
||||
if ($search_status != "" && $search_status != Adherent::STATUS_DRAFT) {
|
||||
$param .= "&search_status=".urlencode($search_status);
|
||||
}
|
||||
if ($search_type > 0) {
|
||||
@ -708,7 +715,7 @@ if (!empty($arrayfields['d.morphy']['checked'])) {
|
||||
if (!empty($arrayfields['t.libelle']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
$listetype = $membertypestatic->liste_array();
|
||||
print $form->selectarray("search_type", $listetype, $type, 1, 0, 0, '', 0, 32);
|
||||
print $form->selectarray("search_type", $listetype, $search_type, 1, 0, 0, '', 0, 32);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -790,10 +797,10 @@ if (!empty($arrayfields['d.tms']['checked'])) {
|
||||
if (!empty($arrayfields['d.statut']['checked'])) {
|
||||
print '<td class="liste_titre right maxwidthonsmartphone">';
|
||||
$liststatus = array(
|
||||
'-1'=>$langs->trans("Draft"),
|
||||
'1'=>$langs->trans("Validated"),
|
||||
'0'=>$langs->trans("Resiliated"),
|
||||
'-2'=>$langs->trans("Excluded")
|
||||
Adherent::STATUS_DRAFT => $langs->trans("Draft"),
|
||||
Adherent::STATUS_VALIDATED => $langs->trans("Validated"),
|
||||
Adherent::STATUS_RESILIATED => $langs->trans("MemberStatusResiliatedShort"),
|
||||
Adherent::STATUS_EXCLUDED =>$langs->trans("MemberStatusExcludedShort")
|
||||
);
|
||||
print $form->selectarray('search_status', $liststatus, $search_status, -3);
|
||||
print '</td>';
|
||||
@ -891,6 +898,7 @@ print "</tr>\n";
|
||||
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
@ -947,7 +955,7 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
// Firstname
|
||||
if (!empty($arrayfields['d.firstname']['checked'])) {
|
||||
print "<td>";
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">';
|
||||
print $obj->firstname;
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
@ -956,7 +964,7 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
// Lastname
|
||||
if (!empty($arrayfields['d.lastname']['checked'])) {
|
||||
print "<td>";
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).'">';
|
||||
print $obj->lastname;
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
@ -976,13 +984,13 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
// Company
|
||||
if (!empty($arrayfields['d.company']['checked'])) {
|
||||
print "<td>";
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($companyname).'">';
|
||||
print $companyname;
|
||||
print "</td>\n";
|
||||
}
|
||||
// Login
|
||||
if (!empty($arrayfields['d.login']['checked'])) {
|
||||
print "<td>".$obj->login."</td>\n";
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->login).'">'.$obj->login."</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -1007,7 +1015,7 @@ while ($i < min($num, $limit)) {
|
||||
if (!empty($arrayfields['t.libelle']['checked'])) {
|
||||
$membertypestatic->id = $obj->type_id;
|
||||
$membertypestatic->label = $obj->type;
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="nowraponall">';
|
||||
print $membertypestatic->getNomUrl(1, 32);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -1016,7 +1024,7 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
// Address
|
||||
if (!empty($arrayfields['d.address']['checked'])) {
|
||||
print '<td class="nocellnopadd">';
|
||||
print '<td class="nocellnopadd tdoverflowmax200" title="'.dol_escape_htmltag($obj->address).'">';
|
||||
print $obj->address;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -1096,7 +1104,7 @@ while ($i < min($num, $limit)) {
|
||||
print '<td class="nowrap center">';
|
||||
print dol_print_date($datefin, 'day');
|
||||
if ($memberstatic->hasDelay()) {
|
||||
$textlate .= ' ('.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24) >= 0 ? '+' : '').ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24).' '.$langs->trans("days").')';
|
||||
$textlate = ' ('.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24) >= 0 ? '+' : '').ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24).' '.$langs->trans("days").')';
|
||||
print " ".img_warning($langs->trans("SubscriptionLate").$textlate);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -68,16 +68,21 @@ if ($id) {
|
||||
$caneditfieldmember = $user->rights->adherent->creer;
|
||||
}
|
||||
|
||||
$hookmanager->initHooks(array('membernote'));
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'adherent', $object->id, '', '', 'socid', 'rowid', 0);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -44,50 +44,20 @@
|
||||
//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
|
||||
|
||||
// Load Dolibarr environment
|
||||
$res = 0;
|
||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
||||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--; $j--;
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
|
||||
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
|
||||
$res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php using relative path
|
||||
if (!$res && file_exists("../main.inc.php")) {
|
||||
$res = @include "../main.inc.php";
|
||||
}
|
||||
if (!$res && file_exists("../../main.inc.php")) {
|
||||
$res = @include "../../main.inc.php";
|
||||
}
|
||||
if (!$res && file_exists("../../../main.inc.php")) {
|
||||
$res = @include "../../../main.inc.php";
|
||||
}
|
||||
if (!$res) {
|
||||
die("Include of main fails");
|
||||
}
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
dol_include_once('/partnership/class/partnership.class.php');
|
||||
dol_include_once('/partnership/lib/partnership.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies","members","partnership", "other"));
|
||||
|
||||
// Get parameters
|
||||
$id = GETPOST('id', 'int');
|
||||
$memberid = GETPOST('rowid', 'int');
|
||||
$id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
@ -97,9 +67,9 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
//$lineid = GETPOST('lineid', 'int');
|
||||
|
||||
$member = new Adherent($db);
|
||||
if ($memberid > 0) {
|
||||
$member->fetch($memberid);
|
||||
$object = new Adherent($db);
|
||||
if ($id > 0) {
|
||||
$object->fetch($id);
|
||||
}
|
||||
|
||||
// Initialize technical objects
|
||||
@ -141,15 +111,15 @@ if (empty($conf->partnership->enabled)) accessforbidden();
|
||||
if (empty($permissiontoread)) accessforbidden();
|
||||
if ($action == 'edit' && empty($permissiontoadd)) accessforbidden();
|
||||
|
||||
$partnershipid = $object->fetch(0, "", $memberid);
|
||||
if (empty($action) && empty($partnershipid)) {
|
||||
$action = 'create';
|
||||
if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT) accessforbidden();
|
||||
|
||||
if (empty($memberid) && $object) {
|
||||
$memberid = $object->fk_member;
|
||||
}
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'adherent', $id, '', '', 'socid', 'rowid', 0);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -166,102 +136,7 @@ $date_end = dol_mktime(0, 0, 0, GETPOST('date_partnership_endmonth', 'int'), GET
|
||||
if (empty($reshook)) {
|
||||
$error = 0;
|
||||
|
||||
$backtopage = dol_buildpath('/partnership/partnership.php', 1).'?rowid='.($memberid > 0 ? $memberid : '__ID__');
|
||||
|
||||
$triggermodname = 'PARTNERSHIP_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
if ($action == 'add' && $permissiontoread) {
|
||||
$error = 0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
if (!$error) {
|
||||
$old_start_date = $object->date_partnership_start;
|
||||
|
||||
$object->fk_member = $memberid;
|
||||
$object->date_partnership_start = (!GETPOST('date_partnership_start')) ? '' : $date_start;
|
||||
$object->date_partnership_end = (!GETPOST('date_partnership_end')) ? '' : $date_end;
|
||||
$object->note_public = GETPOST('note_public', 'restricthtml');
|
||||
$object->date_creation = $now;
|
||||
$object->fk_user_creat = $user->id;
|
||||
$object->entity = $conf->entity;
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $object->create($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
if ($result == -4) {
|
||||
setEventMessages($langs->trans("ErrorRefAlreadyExists"), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$db->rollback();
|
||||
$action = 'create';
|
||||
} else {
|
||||
$db->commit();
|
||||
}
|
||||
} elseif ($action == 'update' && $permissiontoread) {
|
||||
$error = 0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
if (!$error) {
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
$old_start_date = $object->date_partnership_start;
|
||||
|
||||
$object->date_partnership_start = (!GETPOST('date_partnership_start')) ? '' : $date_start;
|
||||
$object->date_partnership_end = (!GETPOST('date_partnership_end')) ? '' : $date_end;
|
||||
$object->note_public = GETPOST('note_public', 'restricthtml');
|
||||
$object->fk_user_creat = $user->id;
|
||||
$object->fk_user_modif = $user->id;
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $object->update($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
if ($result == -4) {
|
||||
setEventMessages($langs->trans("ErrorRefAlreadyExists"), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$db->rollback();
|
||||
$action = 'edit';
|
||||
} else {
|
||||
$db->commit();
|
||||
}
|
||||
} elseif ($action == 'confirm_close' || $action == 'update_extras') {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?rowid=".$memberid);
|
||||
exit;
|
||||
}
|
||||
$backtopage = dol_buildpath('/partnership/partnership.php', 1).'?rowid='.($id > 0 ? $id : '__ID__');
|
||||
|
||||
// Actions when linking object each other
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
|
||||
@ -271,10 +146,9 @@ $object->fields['fk_member']['visible'] = 0;
|
||||
if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) $object->fields['reason_decline_or_cancel']['visible'] = 1;
|
||||
$object->fields['note_public']['visible'] = 1;
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*
|
||||
* Put here all code to build page
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
@ -285,11 +159,11 @@ llxHeader('', $title);
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if ($memberid) {
|
||||
if ($id > 0) {
|
||||
$langs->load("members");
|
||||
|
||||
$member = new Adherent($db);
|
||||
$result = $member->fetch($memberid);
|
||||
$object = new Adherent($db);
|
||||
$result = $object->fetch($id);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
$langs->load("mails");
|
||||
@ -297,13 +171,13 @@ if ($memberid) {
|
||||
|
||||
$adht->fetch($object->typeid);
|
||||
|
||||
$head = member_prepare_head($member);
|
||||
$head = member_prepare_head($object);
|
||||
|
||||
print dol_get_fiche_head($head, 'partnership', $langs->trans("ThirdParty"), -1, 'user');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($member, 'rowid', $linkback);
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
@ -312,21 +186,21 @@ if ($memberid) {
|
||||
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$member->login.' </td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
||||
}
|
||||
|
||||
// Type
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
|
||||
|
||||
// Morphy
|
||||
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$member->getmorphylib().'</td>';
|
||||
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$member->company.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$member->getCivilityLabel().' </td>';
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().' </td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -334,194 +208,13 @@ if ($memberid) {
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
$params = '';
|
||||
|
||||
print '<br>';
|
||||
} else {
|
||||
dol_print_error('', 'Parameter rowid not defined');
|
||||
}
|
||||
|
||||
// Part to create
|
||||
if ($action == 'create') {
|
||||
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Partnership")), '', '');
|
||||
|
||||
$backtopageforcancel = DOL_URL_ROOT.'/partnership/partnership.php?rowid='.$memberid;
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="rowid" value="'.$memberid.'">';
|
||||
print '<input type="hidden" name="fk_member" value="'.$memberid.'">';
|
||||
|
||||
if ($backtopage) {
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
}
|
||||
if ($backtopageforcancel) {
|
||||
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||
}
|
||||
|
||||
print dol_get_fiche_head(array(), '');
|
||||
|
||||
print '<table class="border centpercent tableforfieldcreate">'."\n";
|
||||
|
||||
// Common attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
||||
|
||||
print '</table>'."\n";
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Validate")).'">';
|
||||
print ' ';
|
||||
// print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
// Part to edit record
|
||||
if (($partnershipid || $ref) && $action == 'edit') {
|
||||
print load_fiche_titre($langs->trans("Partnership"), '', '');
|
||||
|
||||
$backtopageforcancel = DOL_URL_ROOT.'/partnership/partnership.php?rowid='.$memberid;
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="rowid" value="'.$memberid.'">';
|
||||
print '<input type="hidden" name="fk_member" value="'.$memberid.'">';
|
||||
if ($backtopage) {
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
}
|
||||
if ($backtopageforcancel) {
|
||||
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||
}
|
||||
|
||||
print dol_get_fiche_head();
|
||||
|
||||
print '<table class="border centpercent tableforfieldedit">'."\n";
|
||||
|
||||
// Common attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
// Part to show record
|
||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
|
||||
print load_fiche_titre($langs->trans("PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv("Partnership")), '', '');
|
||||
|
||||
$res = $object->fetch_optionals();
|
||||
|
||||
// $head = partnershipPrepareHead($object);
|
||||
// print dol_get_fiche_head($head, 'card', $langs->trans("Partnership"), -1, $object->picto);
|
||||
|
||||
$linkback = '';
|
||||
dol_banner_tab($object, 'id', $linkback, 0, 'rowid', 'ref');
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
// Close confirmation
|
||||
if ($action == 'close') {
|
||||
// Create an array for form
|
||||
$formquestion = array();
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClose'), $langs->trans('ConfirmClosePartnershipAsk', $object->ref), 'confirm_close', $formquestion, 'yes', 1);
|
||||
}
|
||||
// Reopon confirmation
|
||||
if ($action == 'reopen') {
|
||||
// Create an array for form
|
||||
$formquestion = array();
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToReopon'), $langs->trans('ConfirmReoponAsk', $object->ref), 'confirm_reopen', $formquestion, 'yes', 1);
|
||||
}
|
||||
|
||||
// Refuse confirmatio
|
||||
if ($action == 'refuse') {
|
||||
//Form to close proposal (signed or not)
|
||||
$formquestion = array(
|
||||
array('type' => 'text', 'name' => 'reason_decline_or_cancel', 'label' => $langs->trans("Note"), 'morecss' => 'reason_decline_or_cancel', 'value' => '') // Field to complete private note (not replace)
|
||||
);
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReasonDecline'), $text, 'confirm_refuse', $formquestion, '', 1, 250);
|
||||
}
|
||||
|
||||
// Call Hook formConfirm
|
||||
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
|
||||
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
$formconfirm .= $hookmanager->resPrint;
|
||||
} elseif ($reshook > 0) {
|
||||
$formconfirm = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
|
||||
// Object card
|
||||
// ------------------------------------------------------------
|
||||
$linkback = '<a href="'.dol_buildpath('/partnership/partnership_list.php', 1).'?restore_lastsearch_values=1'.(!empty($memberid) ? '&rowid='.$memberid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">'."\n";
|
||||
|
||||
// Common attributes
|
||||
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
|
||||
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
||||
//unset($object->fields['fk_member']); // Hide field already shown in banner
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||
|
||||
// End of subscription date
|
||||
$fadherent = new Adherent($db);
|
||||
$fadherent->fetch($object->fk_member);
|
||||
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
|
||||
if ($fadherent->datefin) {
|
||||
print dol_print_date($fadherent->datefin, 'day');
|
||||
if ($fadherent->hasDelay()) {
|
||||
print " ".img_warning($langs->trans("Late"));
|
||||
}
|
||||
} else {
|
||||
if (!$adht->subscription) {
|
||||
print $langs->trans("SubscriptionNotRecorded");
|
||||
if ($fadherent->statut > 0) {
|
||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($fadherent->statut > 0) {
|
||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes. Fields from hook formObjectOptions and Extrafields.
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
// Buttons for actions
|
||||
|
||||
if ($action != 'presend') {
|
||||
@ -533,24 +226,67 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
if ($object->status == $object::STATUS_DRAFT) {
|
||||
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?rowid='.$memberid.'&action=edit', '', $permissiontoadd);
|
||||
}
|
||||
|
||||
// Show
|
||||
if ($permissiontoadd) {
|
||||
print dolGetButtonAction($langs->trans('ShowPartnership'), '', 'default', dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$object->id, '', $permissiontoadd);
|
||||
}
|
||||
|
||||
// Cancel
|
||||
if ($permissiontoadd) {
|
||||
if ($object->status == $object::STATUS_ACCEPTED) {
|
||||
print dolGetButtonAction($langs->trans('Cancel'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd);
|
||||
}
|
||||
print dolGetButtonAction($langs->trans('AddPartnership'), '', 'default', DOL_URL_ROOT.'/partnership/partnership_card.php?action=create&fk_member='.$object->id.'&backtopage='.urlencode(DOL_URL_ROOT.'/adherents/partnership.php?id='.$object->id), '', $permissiontoadd);
|
||||
}
|
||||
}
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
|
||||
//$morehtmlright = 'partnership/partnership_card.php?action=create&backtopage=%2Fdolibarr%2Fhtdocs%2Fpartnership%2Fpartnership_list.php';
|
||||
$morehtmlright = '';
|
||||
|
||||
print load_fiche_titre($langs->trans("PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv("Partnership")), $morehtmlright, '');
|
||||
|
||||
$memberid = $object->id;
|
||||
|
||||
|
||||
// TODO Replace this card with the list of all partnerships.
|
||||
|
||||
$object = new Partnership($db);
|
||||
$partnershipid = $object->fetch(0, "", $memberid);
|
||||
|
||||
if ($partnershipid > 0) {
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">'."\n";
|
||||
|
||||
// Common attributes
|
||||
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
|
||||
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
||||
//unset($object->fields['fk_member']); // Hide field already shown in banner
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||
|
||||
// End of subscription date
|
||||
$fadherent = new Adherent($db);
|
||||
$fadherent->fetch($object->fk_member);
|
||||
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
|
||||
if ($fadherent->datefin) {
|
||||
print dol_print_date($fadherent->datefin, 'day');
|
||||
if ($fadherent->hasDelay()) {
|
||||
print " ".img_warning($langs->trans("Late"));
|
||||
}
|
||||
} else {
|
||||
if (!$adht->subscription) {
|
||||
print $langs->trans("SubscriptionNotRecorded");
|
||||
if ($fadherent->statut > 0) {
|
||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($fadherent->statut > 0) {
|
||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@ -29,7 +29,7 @@ $graphwidth = 700;
|
||||
$mapratio = 0.5;
|
||||
$graphheight = round($graphwidth * $mapratio);
|
||||
|
||||
$mode = GETPOST('mode') ?GETPOST('mode') : '';
|
||||
$mode = GETPOST('mode') ? GETPOST('mode') : '';
|
||||
|
||||
|
||||
// Security check
|
||||
@ -40,7 +40,7 @@ if ($user->socid > 0) {
|
||||
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$startyear = $year - 2;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
// Load translation files required by the page
|
||||
@ -69,7 +69,7 @@ $sql .= " d.morphy as code";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND d.statut != -1"; // Not draft
|
||||
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
|
||||
$sql .= " GROUP BY d.morphy";
|
||||
$foundphy = $foundmor = 0;
|
||||
|
||||
@ -104,7 +104,7 @@ $sql .= " d.morphy as code";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND d.statut >= 1"; // Active (not draft=-1, not resiliated=0)
|
||||
$sql .= " AND d.statut >= 1"; // Active (not excluded=-2, not draft=-1, not resiliated=0)
|
||||
$sql .= " GROUP BY d.morphy";
|
||||
$foundphy = $foundmor = 0;
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ if ($user->socid > 0) {
|
||||
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$startyear = $year - 2;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
// Load translation files required by the page
|
||||
@ -92,7 +92,7 @@ if ($mode) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND d.statut != -1";
|
||||
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
|
||||
$sql .= " GROUP BY c.label, c.code";
|
||||
//print $sql;
|
||||
}
|
||||
@ -110,7 +110,7 @@ if ($mode) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND d.statut != -1";
|
||||
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
|
||||
$sql .= " GROUP BY co.label, co.code, c.nom";
|
||||
//print $sql;
|
||||
}
|
||||
@ -127,7 +127,7 @@ if ($mode) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND d.statut != -1";
|
||||
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
|
||||
$sql .= " GROUP BY co.label, co.code, r.nom"; //+
|
||||
//print $sql;
|
||||
}
|
||||
@ -142,7 +142,7 @@ if ($mode) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND d.statut != -1";
|
||||
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
|
||||
$sql .= " GROUP BY c.label, c.code, d.town";
|
||||
//print $sql;
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ if ($user->socid > 0) {
|
||||
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$startyear = $year - 2;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
// Load translation files required by the page
|
||||
@ -151,12 +151,14 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Member").'</td><td>';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
print $form->select_company($id,'memberid','',1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("User").'</td><td>';
|
||||
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print img_picto('', 'user', 'class="pictofixedwidth"');
|
||||
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300');
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
|
||||
print '<tr><td class="center" colspan="2"><input type="submit" name="submit" class="button small" value="'.$langs->trans("Refresh").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
print '<br><br>';
|
||||
@ -187,8 +189,8 @@ foreach ($data as $val) {
|
||||
//print '</a>';
|
||||
print '</td>';
|
||||
print '<td class="right">0</td>';
|
||||
print '<td class="right">0</td>';
|
||||
print '<td class="right">0</td>';
|
||||
print '<td class="right amount nowraponall">0</td>';
|
||||
print '<td class="right amount nowraponall">0</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr class="oddeven" height="24">';
|
||||
@ -198,8 +200,8 @@ foreach ($data as $val) {
|
||||
//print '</a>';
|
||||
print '</td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>';
|
||||
print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>';
|
||||
print '<td class="right amount nowraponall"><span class="amount">'.price(price2num($val['total'], 'MT'), 1).'</span></td>';
|
||||
print '<td class="right amount nowraponall"><span class="amount">'.price(price2num($val['avg'], 'MT'), 1).'</span></td>';
|
||||
print '</tr>';
|
||||
$oldyear = $year;
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
$parameters = array('socid'=>$socid);
|
||||
$parameters = array('socid'=>isset($socid) ? $socid : null);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
@ -477,6 +477,7 @@ print "</tr>\n";
|
||||
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
@ -495,7 +496,7 @@ while ($i < min($num, $limit)) {
|
||||
$adherent->gender = $obj->gender;
|
||||
$adherent->morphy = $obj->morphy;
|
||||
$adherent->email = $obj->email;
|
||||
$adherent->typeid = $obj->type;
|
||||
$adherent->typeid = $obj->fk_type;
|
||||
$adherent->datefin = $db->jdate($obj->datef);
|
||||
|
||||
$typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
|
||||
@ -527,7 +528,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Lastname
|
||||
if (!empty($arrayfields['d.lastname']['checked'])) {
|
||||
print '<td>'.$adherent->getNomUrl(-1, 0, 'card', 'lastname').'</td>';
|
||||
print '<td class="tdoverflowmax150">'.$adherent->getNomUrl(-1, 0, 'card', 'lastname').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -550,7 +551,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Label
|
||||
if (!empty($arrayfields['t.libelle']['checked'])) {
|
||||
print '<td class="tdoverflowmax500" title="'.dol_escape_htmltag($obj->note).'">';
|
||||
print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->note).'">';
|
||||
print $obj->note;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
|
||||
@ -43,6 +43,8 @@ $action = GETPOST('action', 'aZ09');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
|
||||
$sall = GETPOST("sall", "alpha");
|
||||
$filter = GETPOST("filter", 'alpha');
|
||||
$search_lastname = GETPOST('search_lastname', 'alpha');
|
||||
$search_login = GETPOST('search_login', 'alpha');
|
||||
$search_email = GETPOST('search_email', 'alpha');
|
||||
@ -71,7 +73,7 @@ $label = GETPOST("label", "alpha");
|
||||
$morphy = GETPOST("morphy", "alpha");
|
||||
$status = GETPOST("status", "int");
|
||||
$subscription = GETPOST("subscription", "int");
|
||||
$amount = price2num(GETPOST('amount', 'alpha'), 'MT');
|
||||
$amount = GETPOST('amount', 'alpha');
|
||||
$duration_value = GETPOST('duration_value', 'int');
|
||||
$duration_unit = GETPOST('duration_unit', 'alpha');
|
||||
$vote = GETPOST("vote", "int");
|
||||
@ -119,7 +121,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) {
|
||||
$object->morphy = trim($morphy);
|
||||
$object->status = (int) $status;
|
||||
$object->subscription = (int) $subscription;
|
||||
$object->amount = $amount;
|
||||
$object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
|
||||
$object->duration_value = $duration_value;
|
||||
$object->duration_unit = $duration_unit;
|
||||
$object->note = trim($comment);
|
||||
@ -166,12 +168,11 @@ if ($action == 'update' && $user->rights->adherent->configurer) {
|
||||
$object->fetch($rowid);
|
||||
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
$object->label= trim($label);
|
||||
$object->morphy = trim($morphy);
|
||||
$object->status = (int) $status;
|
||||
$object->subscription = (int) $subscription;
|
||||
$object->amount = $amount;
|
||||
$object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));;
|
||||
$object->duration_value = $duration_value;
|
||||
$object->duration_unit = $duration_unit;
|
||||
$object->note = trim($comment);
|
||||
@ -306,7 +307,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center">'.yn($objp->subscription).'</td>';
|
||||
print '<td class="center">'.price($objp->amount).'</td>';
|
||||
print '<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).'</span></td>';
|
||||
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||
print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
|
||||
if ($user->rights->adherent->configurer) {
|
||||
@ -446,7 +447,7 @@ if ($rowid > 0) {
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Amount").'</td><td>';
|
||||
print price($object->amount);
|
||||
print ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount));
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
@ -594,24 +595,24 @@ if ($rowid > 0) {
|
||||
$titre .= " (".$membertype->label.")";
|
||||
}
|
||||
|
||||
$param = "&rowid=".$object->id;
|
||||
$param = "&rowid=".urlencode($object->id);
|
||||
if (!empty($status)) {
|
||||
$param .= "&status=".$status;
|
||||
$param .= "&status=".urlencode($status);
|
||||
}
|
||||
if (!empty($search_lastname)) {
|
||||
$param .= "&search_lastname=".$search_lastname;
|
||||
$param .= "&search_lastname=".urlencode($search_lastname);
|
||||
}
|
||||
if (!empty($search_firstname)) {
|
||||
$param .= "&search_firstname=".$search_firstname;
|
||||
$param .= "&search_firstname=".urlencode($search_firstname);
|
||||
}
|
||||
if (!empty($search_login)) {
|
||||
$param .= "&search_login=".$search_login;
|
||||
$param .= "&search_login=".urlencode($search_login);
|
||||
}
|
||||
if (!empty($search_email)) {
|
||||
$param .= "&search_email=".$search_email;
|
||||
$param .= "&search_email=".urlencode($search_email);
|
||||
}
|
||||
if (!empty($filter)) {
|
||||
$param .= "&filter=".$filter;
|
||||
$param .= "&filter=".urlencode($filter);
|
||||
}
|
||||
|
||||
if ($sall) {
|
||||
@ -797,7 +798,9 @@ if ($rowid > 0) {
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>';
|
||||
print '<input name="amount" size="5" value="'.price($object->amount).'">';
|
||||
print '<input name="amount" size="5" value="';
|
||||
print ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount));
|
||||
print '">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
|
||||
@ -157,7 +157,7 @@ $form = new Form($db);
|
||||
$formadmin = new FormAdmin($db);
|
||||
|
||||
$head = member_type_prepare_head($object);
|
||||
$titre = $langs->trans("MemberType".$object->type);
|
||||
$titre = $langs->trans("MemberType".$object->id);
|
||||
|
||||
// Calculate $cnt_trans
|
||||
$cnt_trans = 0;
|
||||
|
||||
@ -99,14 +99,16 @@ print "<br>\n";
|
||||
/**
|
||||
* Edit parameters
|
||||
*/
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
print '$(document).ready(function () {
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
print '$(document).ready(function () {
|
||||
$("#selectcountry_id").change(function() {
|
||||
document.form_index.action.value="updateedit";
|
||||
document.form_index.submit();
|
||||
});
|
||||
});';
|
||||
print '</script>'."\n";
|
||||
print '</script>'."\n";
|
||||
}
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="form_index">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@ -131,7 +133,7 @@ print '<input name="town" class="minwidth100" id="town" value="'.(GETPOSTISSET('
|
||||
|
||||
// Country
|
||||
print '<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
|
||||
print img_picto('', 'globe-americas', 'class="pictofixedwidth"');
|
||||
print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'country_id');
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
@ -139,28 +141,29 @@ if ($user->admin) {
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
|
||||
$formcompany->select_departement((GETPOSTISSET('state_id') ? GETPOST('state_id', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id');
|
||||
print img_picto('', 'state', 'class="pictofixedwidth"');
|
||||
print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOST('state_id', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id');
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="tel" id="phone" value="'.(GETPOSTISSET('tel') ? GETPOST('tel', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_PHONE) ? $conf->global->MAIN_INFO_ACCOUNTANT_PHONE : '')).'"></td></tr>';
|
||||
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input name="tel" id="phone" class="maxwidth150 widthcentpercentminusx" value="'.(GETPOSTISSET('tel') ? GETPOST('tel', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_PHONE) ? $conf->global->MAIN_INFO_ACCOUNTANT_PHONE : '')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="fax" id="fax" value="'.(GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_FAX) ? $conf->global->MAIN_INFO_ACCOUNTANT_FAX : '')).'"></td></tr>';
|
||||
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input name="fax" id="fax" class="maxwidth150 widthcentpercentminusx" value="'.(GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_FAX) ? $conf->global->MAIN_INFO_ACCOUNTANT_FAX : '')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="mail" id="email" class="minwidth200" value="'.(GETPOSTISSET('mail') ? GETPOST('mail', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_MAIL) ? $conf->global->MAIN_INFO_ACCOUNTANT_MAIL : '')).'"></td></tr>';
|
||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input name="mail" id="email" class="maxwidth150 widthcentpercentminusx" value="'.(GETPOSTISSET('mail') ? GETPOST('mail', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_MAIL) ? $conf->global->MAIN_INFO_ACCOUNTANT_MAIL : '')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Web
|
||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="web" id="web" class="minwidth300" value="'.(GETPOSTISSET('web') ? GETPOST('web', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_WEB) ? $conf->global->MAIN_INFO_ACCOUNTANT_WEB : '')).'"></td></tr>';
|
||||
print img_picto('', 'globe', '', false, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input name="web" id="web" class="maxwidth300 widthcentpercentminusx" value="'.(GETPOSTISSET('web') ? GETPOST('web', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_WEB) ? $conf->global->MAIN_INFO_ACCOUNTANT_WEB : '')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Code
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
/* Copyright (C) 2018-2021 Alexandre Spangaro <aspangaro@open-dsi.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
|
||||
@ -18,7 +18,7 @@
|
||||
/**
|
||||
* \file htdocs/admin/accounting.php
|
||||
* \ingroup accounting
|
||||
* \brief Setup page to configure accountanting module
|
||||
* \brief Setup page to configure accounting module
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
@ -32,7 +32,7 @@ $action = GETPOST('action', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminaccoutant'; // To manage different context of search
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'companies'));
|
||||
$langs->loadLangs(array('admin', 'companies', 'accountancy'));
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
@ -52,12 +52,13 @@ $error = 0;
|
||||
* View
|
||||
*/
|
||||
|
||||
$title = $langs->trans("ConfigAccountingExpert");
|
||||
$help_url = '';
|
||||
llxHeader('', $langs->trans("ConfigAccountingExpert"), $help_url);
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("ConfigAccountingExpert"), $linkback, 'title_setup');
|
||||
print load_fiche_titre($title, $linkback, 'title_setup');
|
||||
|
||||
print "<br>\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("Accounting").' - '.$langs->transnoentitiesnoconv("Setup"))."</span><br>\n";
|
||||
|
||||