Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
a42ad74a37
11
.travis.yml
11
.travis.yml
@ -12,6 +12,7 @@ php:
|
|||||||
- '5.5'
|
- '5.5'
|
||||||
- '5.6'
|
- '5.6'
|
||||||
- '7.0'
|
- '7.0'
|
||||||
|
- '7.1'
|
||||||
- nightly
|
- nightly
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
@ -50,6 +51,7 @@ env:
|
|||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
allow_failures:
|
||||||
|
- php: 7.1
|
||||||
- php: nightly
|
- php: nightly
|
||||||
# FIXME
|
# FIXME
|
||||||
#- env: DB=postgresql
|
#- env: DB=postgresql
|
||||||
@ -96,7 +98,7 @@ install:
|
|||||||
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then
|
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then
|
||||||
composer -n require phpunit/phpunit ^4
|
composer -n require phpunit/phpunit ^4
|
||||||
fi
|
fi
|
||||||
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||||
composer -n require phpunit/phpunit ^5
|
composer -n require phpunit/phpunit ^5
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
@ -136,7 +138,7 @@ before_script:
|
|||||||
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||||
echo
|
echo
|
||||||
echo "Enabling Memcached for PHP <= 5.4"
|
echo "Enabling Memcached for PHP <= 5.4"
|
||||||
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0 and nightly!
|
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1 and nightly!
|
||||||
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||||
fi
|
fi
|
||||||
phpenv rehash
|
phpenv rehash
|
||||||
@ -208,7 +210,7 @@ before_script:
|
|||||||
echo "Setting up Apache + FPM"
|
echo "Setting up Apache + FPM"
|
||||||
# enable php-fpm
|
# enable php-fpm
|
||||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
|
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
|
||||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||||
# Copy the included pool
|
# Copy the included pool
|
||||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf
|
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf
|
||||||
fi
|
fi
|
||||||
@ -290,6 +292,9 @@ script:
|
|||||||
php upgrade.php 4.0.0 5.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade400500.log
|
php upgrade.php 4.0.0 5.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade400500.log
|
||||||
php upgrade2.php 4.0.0 5.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade400500-2.log
|
php upgrade2.php 4.0.0 5.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade400500-2.log
|
||||||
php step5.php 4.0.0 5.0.0 > $TRAVIS_BUILD_DIR/upgrade400500-3.log
|
php step5.php 4.0.0 5.0.0 > $TRAVIS_BUILD_DIR/upgrade400500-3.log
|
||||||
|
php upgrade.php 5.0.0 6.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade500600.log
|
||||||
|
php upgrade2.php 5.0.0 6.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade500600-2.log
|
||||||
|
php step5.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-3.log
|
||||||
cd -
|
cd -
|
||||||
set +e
|
set +e
|
||||||
echo
|
echo
|
||||||
|
|||||||
178
ChangeLog
178
ChangeLog
@ -150,7 +150,76 @@ Dolibarr better:
|
|||||||
- A new paramater sqlfilters was introduced to allow filter on any fields int the REST API. Few old parameters,
|
- A new paramater sqlfilters was introduced to allow filter on any fields int the REST API. Few old parameters,
|
||||||
no more required, were also removed. Use this new one if you were using one of them.
|
no more required, were also removed. Use this new one if you were using one of them.
|
||||||
- The trigger that activate or close a contract line is run on a contract line, not on contract.
|
- The trigger that activate or close a contract line is run on a contract line, not on contract.
|
||||||
|
- Method commande->set_availability(user, availability_id) removed from commande class, use method commande->availability(availability_id, notrigger).
|
||||||
|
|
||||||
|
Dolibarr 5.0 was frozen before PHP 7.1 was released. Unit tests are successful on PHP 7.1 but we don't have enough
|
||||||
|
feedback to confirm all application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0.
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 4.0.4 to 4.0.3 *****
|
||||||
|
FIX: #6227 Document models table header "Unit" is shown in 2 lines in Spanish
|
||||||
|
FIX: #6230
|
||||||
|
FIX: #6237
|
||||||
|
FIX: #6245 Thirdparty link in supplier invoices list, links to "comm/card" instead of "fourn/card" page
|
||||||
|
FIX: #6253 Supplier invoice list filter does not respect "thirdparty" filter
|
||||||
|
FIX: #6277
|
||||||
|
FIX: project list and ajax completion return wrong list.
|
||||||
|
FIX: bug margin calculation by user with multicompany
|
||||||
|
FIX: Can make a stock transfert on product not on sale/purchase.
|
||||||
|
FIX: extrafield input for varchar was not working with special char within (ie double quotes)
|
||||||
|
FIX: javascript error
|
||||||
|
FIX: link for not found photo when using gravatar. Must use external url.
|
||||||
|
FIX: Protection so even if link is output for external user, links is disabled.
|
||||||
|
FIX: repair tool was ko to restore extrafields with type select.
|
||||||
|
FIX: Security access problem with external users on projects/tasks
|
||||||
|
FIX: We must not drop extrafield column if there is still record on other entities.
|
||||||
|
FIX: regression with sedning email when introducing security options to restrict nb of email sending.
|
||||||
|
t
|
||||||
|
***** ChangeLog for 4.0.3 to 4.0.2 *****
|
||||||
|
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
||||||
|
FIX: #5958 no discount on supplier command made by replenishment
|
||||||
|
FIX: #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them
|
||||||
|
FIX: #5972 #5734
|
||||||
|
FIX: #6007
|
||||||
|
FIX: #6010
|
||||||
|
FIX: #6029
|
||||||
|
FIX: #6043 - Payment mode not visible on supplier invoice list
|
||||||
|
FIX: #6051
|
||||||
|
FIX: #6062
|
||||||
|
FIX: #6088
|
||||||
|
FIX: A draft can be deleted by a user with create permission.
|
||||||
|
FIX: bad permission to see contract on home page
|
||||||
|
FIX: bad permission to see contract statistics
|
||||||
|
FIX: Bcc must not appears to recipient when using SMTPs lib
|
||||||
|
FIX: Consistent description for add or edit product
|
||||||
|
FIX: delete contract extrafields on contract deletion
|
||||||
|
FIX: Deposits and credit notes weren't added in the received and pending columns
|
||||||
|
FIX: export extrafields must not include separe type
|
||||||
|
FIX: Export of opportunity status must be code, not id.
|
||||||
|
FIX: False positive on services not activated
|
||||||
|
FIX: Filter was wrong or lost during navigation
|
||||||
|
FIX: HT and TTC price should always be displayed together
|
||||||
|
FIX: if a supplier price reference is changed after creating an order, we can't clone order.
|
||||||
|
FIX: in export. Error when using a separate extrafields.
|
||||||
|
FIX: Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email.
|
||||||
|
FIX: javascript error when using on mobile/smartphone
|
||||||
|
FIX: javascript xss injection and a translation
|
||||||
|
FIX: Label of project is in field title not label.
|
||||||
|
FIX: List of people able to validate an expense report was not complete.
|
||||||
|
FIX: Missing field
|
||||||
|
FIX: Module gravatar was not triggered on thirdparty and contact card
|
||||||
|
FIX: Must use external link into a forged email content.
|
||||||
|
FIX: Pb in management of date end of projects
|
||||||
|
FIX: Regression when deleting product
|
||||||
|
FIX: rendering of output of estimated amount on project overview page.
|
||||||
|
FIX: Sanitize title of ajax_dialog
|
||||||
|
FIX: Security to restrict email sending was not efficient
|
||||||
|
FIX: Setting supplier as client when accept a supplier proposal
|
||||||
|
FIX: Some statistics not compatible with multicompany module.
|
||||||
|
FIX: the time spent on project was not visible in its overwiew
|
||||||
|
FIX: Update intervention lline crash with PgSQL
|
||||||
|
FIX: wrong test on dict.php
|
||||||
|
FIX: wrong var name
|
||||||
|
|
||||||
***** ChangeLog for 4.0.2 compared to 4.0.1 *****
|
***** ChangeLog for 4.0.2 compared to 4.0.1 *****
|
||||||
FIX: #5340
|
FIX: #5340
|
||||||
@ -357,6 +426,115 @@ So if you included it into your module, change your code like this to be compati
|
|||||||
if (! $res) include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
if (! $res) include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 3.9.4 compared to 3.9.3 *****
|
||||||
|
FIX: #2853
|
||||||
|
FIX: #3128
|
||||||
|
FIX: #4447
|
||||||
|
FIX: #5128 if create method return duplicated code error not use GETPOST in order to get a new code
|
||||||
|
FIX: #5340
|
||||||
|
FIX: #5473
|
||||||
|
FIX: #5474 Country_id of "Don" object is still empty
|
||||||
|
FIX: #5534
|
||||||
|
FIX: #5535 bad dependency.
|
||||||
|
FIX: #5537 AJAX project search does not work properly
|
||||||
|
FIX: #5540 getFormMail is not registered as addReplace hook
|
||||||
|
FIX: #5544 Disabled Contact still appear in lists to send emails
|
||||||
|
FIX: #5549 getNomUrl tooltips show Order info even if user has no rights to read them
|
||||||
|
FIX: #5568
|
||||||
|
FIX: #5594
|
||||||
|
FIX: #5629 PgSQL Interger string stylish error
|
||||||
|
FIX: #5651
|
||||||
|
FIX: #5660
|
||||||
|
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
||||||
|
FIX: #5907
|
||||||
|
FIX: #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them
|
||||||
|
FIX: #6051
|
||||||
|
FIX: #6088
|
||||||
|
FIX: Can correct stock of lot using eatby or sell by date
|
||||||
|
FIX: Can make a movement on "out of sell" products
|
||||||
|
FIX: cannot update bank account on invoice if module order not activated
|
||||||
|
FIX: Can't create withdrawal document
|
||||||
|
FIX: delete contract extrafields on contract deletion
|
||||||
|
FIX: Direction of movement lost if an error occurs
|
||||||
|
FIX: Error when CATEGORIE_RECURSIV_ADD is enabled and new category is daughter of an already linked to object
|
||||||
|
FIX: export extrafields must not include separe type
|
||||||
|
FIX: External user must not be able to edit its discounts
|
||||||
|
FIX: Failed to export contact categories with contact extra fields
|
||||||
|
FIX: header title in commercial area
|
||||||
|
FIX: HT and TTC price should always be displayed together
|
||||||
|
FIX: incoterms
|
||||||
|
FIX: incoterms do not output into crabe invoice PDF
|
||||||
|
FIX: in PgSQL no quote "word style" is permitted around column name
|
||||||
|
FIX: Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email.
|
||||||
|
FIX: margin tab on customer card must filter on current entity invoices
|
||||||
|
FIX: missing column into SQL on thridparty list
|
||||||
|
FIX: only show projects of related third if external user
|
||||||
|
FIX: PgSQL Module Ressource list crash #5637
|
||||||
|
FIX: php Strict
|
||||||
|
FIX: Regression when deleting product
|
||||||
|
FIX: Security to restrict email sending was not efficient
|
||||||
|
FIX: tag for date rfc in odt substitution
|
||||||
|
FIX: Update intervention lline crash with PgSQL
|
||||||
|
FIX: update limit stock on product stock
|
||||||
|
FIX: vat dictionary should allow enter and edit multiple values for localtaxes, separated by: (ex -19:-15)
|
||||||
|
FIX: wrong test on dict.php
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 3.9.4 compared to 3.9.3 *****
|
||||||
|
FIX: #2853
|
||||||
|
FIX: #3128
|
||||||
|
FIX: #4447
|
||||||
|
FIX: #5128 if create method return duplicated code error not use GETPOST in order to get a new code
|
||||||
|
FIX: #5340
|
||||||
|
FIX: #5473
|
||||||
|
FIX: #5474 Country_id of "Don" object is still empty
|
||||||
|
FIX: #5534
|
||||||
|
FIX: #5535 bad dependency.
|
||||||
|
FIX: #5537 AJAX project search does not work properly
|
||||||
|
FIX: #5540 getFormMail is not registered as addReplace hook
|
||||||
|
FIX: #5544 Disabled Contact still appear in lists to send emails
|
||||||
|
FIX: #5549 getNomUrl tooltips show Order info even if user has no rights to read them
|
||||||
|
FIX: #5568
|
||||||
|
FIX: #5594
|
||||||
|
FIX: #5629 PgSQL Interger string stylish error
|
||||||
|
FIX: #5651
|
||||||
|
FIX: #5660
|
||||||
|
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
||||||
|
FIX: #5907
|
||||||
|
FIX: #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them
|
||||||
|
FIX: #6051
|
||||||
|
FIX: #6088
|
||||||
|
FIX: Can correct stock of lot using eatby or sell by date
|
||||||
|
FIX: Can make a movement on "out of sell" products
|
||||||
|
FIX: cannot update bank account on invoice if module order not activated
|
||||||
|
FIX: Can't create withdrawal document
|
||||||
|
FIX: delete contract extrafields on contract deletion
|
||||||
|
FIX: Direction of movement lost if an error occurs
|
||||||
|
FIX: Error when CATEGORIE_RECURSIV_ADD is enabled and new category is daughter of an already linked to object
|
||||||
|
FIX: export extrafields must not include separe type
|
||||||
|
FIX: External user must not be able to edit its discounts
|
||||||
|
FIX: Failed to export contact categories with contact extra fields
|
||||||
|
FIX: header title in commercial area
|
||||||
|
FIX: HT and TTC price should always be displayed together
|
||||||
|
FIX: incoterms
|
||||||
|
FIX: incoterms do not output into crabe invoice PDF
|
||||||
|
FIX: in PgSQL no quote "word style" is permitted around column name
|
||||||
|
FIX: Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email.
|
||||||
|
FIX: margin tab on customer card must filter on current entity invoices
|
||||||
|
FIX: missing column into SQL on thridparty list
|
||||||
|
FIX: only show projects of related third if external user
|
||||||
|
FIX: PgSQL Module Ressource list crash #5637
|
||||||
|
FIX: php Strict
|
||||||
|
FIX: Regression when deleting product
|
||||||
|
FIX: Security to restrict email sending was not efficient
|
||||||
|
FIX: tag for date rfc in odt substitution
|
||||||
|
FIX: Update intervention lline crash with PgSQL
|
||||||
|
FIX: update limit stock on product stock
|
||||||
|
FIX: vat dictionary should allow enter and edit multiple values for localtaxes, separated by: (ex -19:-15)
|
||||||
|
FIX: wrong test on dict.php
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 3.9.3 compared to 3.9.2 *****
|
***** ChangeLog for 3.9.3 compared to 3.9.2 *****
|
||||||
FIX: #4383 $userid not defined
|
FIX: #4383 $userid not defined
|
||||||
FIX: #4448 $filebonprev is not used, $this->filename now
|
FIX: #4448 $filebonprev is not used, $this->filename now
|
||||||
|
|||||||
19
README-FR.md
19
README-FR.md
@ -54,19 +54,10 @@ Pour mettre a jour Dolibarr depuis une vieille version vers celle ci:
|
|||||||
- Ecraser les vieux fichiers dans le vieux repertoire 'dolibarr' par les fichiers
|
- Ecraser les vieux fichiers dans le vieux repertoire 'dolibarr' par les fichiers
|
||||||
fournis dans ce nouveau package.
|
fournis dans ce nouveau package.
|
||||||
|
|
||||||
- Si vous venez d'une version x.y.z vers x.y.w (seul le 3eme chiffre varie),
|
- Au prochain accès, Dolibarr proposera la page de "mise a jour" des données (si necessaire).
|
||||||
il n'y a pas besoin de migration de données.
|
Si un fichier install.lock existe pour vérouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transféré sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents")
|
||||||
|
|
||||||
- Si vous venez d'une beta ou d'un version x.y.z vers une autre ou les numeros x
|
|
||||||
ou y varient, vous devez appelez la page "install/" de migration dans votre
|
|
||||||
navigateur (ceci doit se faire automatiquement au premier accès de l'application).
|
|
||||||
Ce sera une URL du genre:
|
|
||||||
http://localhost/dolibarr/htdocs/install/index.php
|
|
||||||
ou
|
|
||||||
http://yourdolibarrhost/install/index.php
|
|
||||||
|
|
||||||
Ensuite, choisir l'option de "mise a jour" en rapport avec votre cas.
|
*Note: Le processus de migration peut etre lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
|
||||||
Note: Le processus de migration peut etre lance plusieurs fois sans risque.
|
|
||||||
|
|
||||||
|
|
||||||
## CE QUI EST NOUVEAU
|
## CE QUI EST NOUVEAU
|
||||||
@ -86,11 +77,13 @@ Voir fichier ChangeLog.
|
|||||||
- Gestion des factures clients/fournisseurs et paiements
|
- Gestion des factures clients/fournisseurs et paiements
|
||||||
- Gestion des virements bancaires SEPA
|
- Gestion des virements bancaires SEPA
|
||||||
- Gestion des comptes bancaires
|
- Gestion des comptes bancaires
|
||||||
- Agenda partagé
|
- 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é, ...)
|
- 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 contrats de services
|
||||||
- Gestion de stock
|
- Gestion de stock
|
||||||
- Gestion des expéditions
|
- Gestion des expéditions
|
||||||
|
- Gestion des demandes de congès
|
||||||
|
- Gestion des notes de frais
|
||||||
- GED (Gestion Electronique de Documents)
|
- GED (Gestion Electronique de Documents)
|
||||||
- EMailings de masse
|
- EMailings de masse
|
||||||
- Réalisation de sondages
|
- Réalisation de sondages
|
||||||
|
|||||||
22
README.md
22
README.md
@ -26,6 +26,16 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git
|
|||||||
|
|
||||||
Releases can be downloaded from [official website](https://www.dolibarr.org/).
|
Releases can be downloaded from [official website](https://www.dolibarr.org/).
|
||||||
|
|
||||||
|
### Install from composer
|
||||||
|
If you do not already have Composer installed, you may do so by following the instructions at getcomposer.org. On Linux and Mac OS X, you'll run the following commands:
|
||||||
|
|
||||||
|
curl -sS https://getcomposer.org/installer | php
|
||||||
|
mv composer.phar /usr/local/bin/composer
|
||||||
|
|
||||||
|
On Windows, you'll download and run https://getcomposer.org/Composer-Setup.exe
|
||||||
|
|
||||||
|
composer create-project dolibarr/dolibarr erp
|
||||||
|
|
||||||
### Simple setup
|
### Simple setup
|
||||||
|
|
||||||
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in few clicks, you can use one of the packaged versions:
|
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in few clicks, you can use one of the packaged versions:
|
||||||
@ -60,10 +70,10 @@ You can use a Web server and a supported database (MariaDb, MySql or Postgresql)
|
|||||||
## UPGRADING
|
## UPGRADING
|
||||||
|
|
||||||
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
|
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
|
||||||
- If you're upgrading from version x.y.z to x.y.w (only third number differs), there is no need to run any migration process.
|
- At first next access, Dolibarr will redirect your to the "install/" page to make the upgrade process.
|
||||||
- If you're upgrading from a beta version or from any version x.y.z to any other where x or y number differs, you must call the Dolibarr "install/" page in your browser (this should be done automatically at first dolibarr access) and follow the upgrade process.
|
If a file install.lock exists to lock any run of upgrade process, the application will ask you to remove the file manually (you should find the install.lock file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "documents").
|
||||||
|
|
||||||
*Note: migration process can safely be done multiple times.*
|
*Note: migration process can safely be done multiple times by calling the page /install/index.php*
|
||||||
|
|
||||||
## WHAT'S NEW
|
## WHAT'S NEW
|
||||||
|
|
||||||
@ -80,17 +90,17 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Invoices and payment management
|
- Invoices and payment management
|
||||||
- Standing orders management (European SEPA)
|
- Standing orders management (European SEPA)
|
||||||
- Bank accounts management
|
- Bank accounts management
|
||||||
- Shared calendar
|
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||||
- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...)
|
- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...)
|
||||||
- Projects management
|
- Projects management
|
||||||
- Contracts management
|
- Contracts management
|
||||||
- Stock management
|
- Stock management
|
||||||
- Shipping management
|
- Shipping management
|
||||||
- Interventions management
|
- Interventions management
|
||||||
- Agenda with ical and vcal export for third party tools integration
|
- Employee's leave requests management
|
||||||
|
- Expense report management
|
||||||
- Electronic Document Management (EDM)
|
- Electronic Document Management (EDM)
|
||||||
- Foundations members management
|
- Foundations members management
|
||||||
- Employee's holidays management
|
|
||||||
- Mass emailing
|
- Mass emailing
|
||||||
- Surveys
|
- Surveys
|
||||||
- Point of Sale
|
- Point of Sale
|
||||||
|
|||||||
@ -320,8 +320,8 @@ x.y.z+dfsgw
|
|||||||
Note: If there was errors solved manually after get-orig-sources.sh, you may need to make a git commit
|
Note: If there was errors solved manually after get-orig-sources.sh, you may need to make a git commit
|
||||||
|
|
||||||
* Update/fix debian/* files used to build package.
|
* Update/fix debian/* files used to build package.
|
||||||
At least, add an entry into debian/changelog
|
At least, add an entry into debian/changelog with command
|
||||||
> dch -v x.y.z+dfsgw-v "My comment" will add entry.
|
> dch -v x.y.z+dfsgw-1 "My comment"
|
||||||
For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increased for each new import)
|
For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increased for each new import)
|
||||||
Then check/modify changelog to replace "version" or "unstable" with "UNRELEASED".
|
Then check/modify changelog to replace "version" or "unstable" with "UNRELEASED".
|
||||||
Then check/modify also the user/date signature:
|
Then check/modify also the user/date signature:
|
||||||
@ -332,7 +332,9 @@ Then check/modify also the user/date signature:
|
|||||||
To update dolibarr debian package when only files into debian has changed:
|
To update dolibarr debian package when only files into debian has changed:
|
||||||
|
|
||||||
* Change files and commit.
|
* Change files and commit.
|
||||||
* Add a tag debian/x.y.z+dfsgw-2 (increase the last 1 into 2, 3...)
|
* Add a line into changelog for version debian/x.y.z+dfsgw-v (increase the last v into 2, 3...)
|
||||||
|
> dch -v x.y.z+dfsgw-v "My comment"
|
||||||
|
* git tag will be added when package is pushed.
|
||||||
|
|
||||||
|
|
||||||
To update dolibarr debian package when only files not into debian has changed:
|
To update dolibarr debian package when only files not into debian has changed:
|
||||||
|
|||||||
@ -26,11 +26,11 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
|
|||||||
# Misc dependencies
|
# Misc dependencies
|
||||||
# fonts-dejavu-core | ttf-dejavu-core,
|
# fonts-dejavu-core | ttf-dejavu-core,
|
||||||
xdg-utils,
|
xdg-utils,
|
||||||
virtual-mysql-client,
|
mariadb-client | virtual-mysql-client,
|
||||||
${misc:Depends},
|
${misc:Depends},
|
||||||
${perl:Depends}
|
${perl:Depends}
|
||||||
Recommends: apache2 | lighttpd | httpd,
|
Recommends: apache2 | lighttpd | httpd,
|
||||||
virtual-mysql-server
|
mariadb-server | virtual-mysql-server
|
||||||
Suggests: www-browser, php5-geoip
|
Suggests: www-browser, php5-geoip
|
||||||
Description: Web based software to manage a company or foundation
|
Description: Web based software to manage a company or foundation
|
||||||
Dolibarr ERP & CRM is an easy to use open source/free software package for
|
Dolibarr ERP & CRM is an easy to use open source/free software package for
|
||||||
|
|||||||
22
build/generate_filelist_xml.php
Normal file → Executable file
22
build/generate_filelist_xml.php
Normal file → Executable file
@ -65,6 +65,8 @@ fputs($fp, '<checksum_list version="'.$release.'">'."\n");
|
|||||||
|
|
||||||
fputs($fp, '<dolibarr_htdocs_dir>'."\n");
|
fputs($fp, '<dolibarr_htdocs_dir>'."\n");
|
||||||
|
|
||||||
|
$checksumconcat=array();
|
||||||
|
|
||||||
$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
|
$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
|
||||||
$iterator1 = new RecursiveIteratorIterator($dir_iterator1);
|
$iterator1 = new RecursiveIteratorIterator($dir_iterator1);
|
||||||
// need to ignore document custom etc
|
// need to ignore document custom etc
|
||||||
@ -81,12 +83,22 @@ foreach ($files as $file) {
|
|||||||
$needtoclose=1;
|
$needtoclose=1;
|
||||||
}
|
}
|
||||||
if (filetype($file)=="file") {
|
if (filetype($file)=="file") {
|
||||||
fputs($fp, '<md5file name="'.basename($file).'">'.md5_file($file).'</md5file>'."\n");
|
$md5=md5_file($file);
|
||||||
|
$checksumconcat[]=$md5;
|
||||||
|
fputs($fp, '<md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fputs($fp, '</dir>'."\n");
|
fputs($fp, '</dir>'."\n");
|
||||||
fputs($fp, '</dolibarr_htdocs_dir>'."\n");
|
fputs($fp, '</dolibarr_htdocs_dir>'."\n");
|
||||||
|
|
||||||
|
asort($checksumconcat); // Sort list of checksum
|
||||||
|
//var_dump($checksumconcat);
|
||||||
|
fputs($fp, '<dolibarr_htdocs_dir_checksum>'."\n");
|
||||||
|
fputs($fp, md5(join(',',$checksumconcat))."\n");
|
||||||
|
fputs($fp, '</dolibarr_htdocs_dir_checksum>'."\n");
|
||||||
|
|
||||||
|
|
||||||
|
$checksumconcat=array();
|
||||||
|
|
||||||
fputs($fp, '<dolibarr_script_dir version="'.$release.'">'."\n");
|
fputs($fp, '<dolibarr_script_dir version="'.$release.'">'."\n");
|
||||||
|
|
||||||
@ -106,12 +118,18 @@ foreach ($files as $file) {
|
|||||||
$needtoclose=1;
|
$needtoclose=1;
|
||||||
}
|
}
|
||||||
if (filetype($file)=="file") {
|
if (filetype($file)=="file") {
|
||||||
fputs($fp, '<md5file name="'.basename($file).'">'.md5_file($file).'</md5file>'."\n");
|
$md5=md5_file($file);
|
||||||
|
$checksumconcat[]=$md5;
|
||||||
|
fputs($fp, '<md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fputs($fp, '</dir>'."\n");
|
fputs($fp, '</dir>'."\n");
|
||||||
fputs($fp, '</dolibarr_script_dir>'."\n");
|
fputs($fp, '</dolibarr_script_dir>'."\n");
|
||||||
|
|
||||||
|
asort($checksumconcat); // Sort list of checksum
|
||||||
|
fputs($fp, '<dolibarr_script_dir_checksum>'."\n");
|
||||||
|
fputs($fp, md5(join(',',$checksumconcat))."\n");
|
||||||
|
fputs($fp, '</dolibarr_script_dir_checksum>'."\n");
|
||||||
|
|
||||||
fputs($fp, '</checksum_list>'."\n");
|
fputs($fp, '</checksum_list>'."\n");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|||||||
@ -162,7 +162,7 @@ export res=$?
|
|||||||
|
|
||||||
|
|
||||||
# ---------------------------- copy demo files
|
# ---------------------------- copy demo files
|
||||||
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" `
|
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g' `
|
||||||
if [ "x$documentdir" != "x" ]
|
if [ "x$documentdir" != "x" ]
|
||||||
then
|
then
|
||||||
echo cp -pr $mydir/documents_demo/* "$documentdir/"
|
echo cp -pr $mydir/documents_demo/* "$documentdir/"
|
||||||
@ -174,7 +174,7 @@ then
|
|||||||
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||||
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||||
else
|
else
|
||||||
echo Detection of documents directory failed so demo files were not copied.
|
echo Detection of documents directory from $mydir failed so demo files were not copied.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
13
dev/resources/iso-normes/sample_FEC_file.txt
Normal file
13
dev/resources/iso-normes/sample_FEC_file.txt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
JOURNALCODE JOURNALLIB ECRITURENUM ECRITUREDATE COMPTENUM COMPTELIB COMPAUXNUM COMPAUXLIB PIECEREF PIECEDATE ECRITURELIB DEBIT CREDIT ECRITURELET DATELET VALIDDATE MONTANTDEVISE IDEVISE
|
||||||
|
Banque Banque 17293 20170109 401PPRO PUBLI-PROV L08 20170109 PPRO domiciliation 1TR 187,20 0,00 20170109
|
||||||
|
Banque Banque 17293 20170109 5121CRA CR AGRICOLE L08 20170109 PPRO domiciliation 1TR 0,00 187,20 20170109
|
||||||
|
Banque Banque 17295 20170109 401ORPA ORANGE PARIS Report 20170109 ORPA adsl par 12 96,00 0,00 20170109
|
||||||
|
Banque Banque 17295 20170109 5121CRA CR AGRICOLE Report 20170109 ORPA adsl par 12 0,00 96,00 20170109
|
||||||
|
Banque Banque 17302 20170105 401ORVI ORANGE VEBRON INTERNET Report 20170105 ORVI adsl veb 12 26,00 0,00 20170109
|
||||||
|
Banque Banque 17302 20170105 5121CRA CR AGRICOLE Report 20170105 ORVI adsl veb 12 0,00 26,00 20170109
|
||||||
|
Fournisseurs Fournisseurs 17305 20170119 401ZDAV SANDRA DAVILA A01 20170119 ZDAV courtage s/ ventes 0,00 508,00 20170119
|
||||||
|
Fournisseurs Fournisseurs 17305 20170119 622200 Courtages s/ ventes A01 20170119 ZDAV courtage s/ ventes 508,00 0,00 20170119
|
||||||
|
Banque Banque 17306 20170119 5121CRA CR AGRICOLE A01 20170119 ZDAV courtage s/ ventes 0,00 508,00 20170119
|
||||||
|
Banque Banque 17306 20170119 401ZDAV SANDRA DAVILA A01 20170119 ZDAV courtage s/ ventes 508,00 0,00 20170119
|
||||||
|
Banque Banque 17307 20170119 401ZDAV SANDRA DAVILA A01 20170119 ZDAV courtage s/ ventes 508,00 0,00 20170131
|
||||||
|
Banque Banque 17307 20170119 5121CRA CR AGRICOLE A01 20170119 ZDAV courtage s/ ventes 0,00 508,00 20170131
|
||||||
28
dev/setup/nginx/dolibarr
Normal file
28
dev/setup/nginx/dolibarr
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Dolibarr server configuration sample for NGinx
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
|
||||||
|
root /path/to/your/htdocs;
|
||||||
|
|
||||||
|
# Optionnal
|
||||||
|
error_log /path/to/your/log/directory/nginx.error.log;
|
||||||
|
access_log /path/to/your/log/directory/nginx.access.log;
|
||||||
|
|
||||||
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
|
# Optionnal
|
||||||
|
server_name your-fqdn.tld;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ [^/]\.php(/|$) {
|
||||||
|
try_files $uri =404;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_read_timeout 600;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -303,7 +303,7 @@ foreach($property as $key => $prop)
|
|||||||
$varprop.="\$this->db->escape(\$this->".$prop['field'].")";
|
$varprop.="\$this->db->escape(\$this->".$prop['field'].")";
|
||||||
$varprop.=".\"'\")";
|
$varprop.=".\"'\")";
|
||||||
}
|
}
|
||||||
elseif ($prop['field']=='fk_user_mod' || $prop['field']=='fk_user_author')
|
elseif ($prop['field']=='fk_user_mod' || $prop['field']=='fk_user_m' || $prop['field']=='fk_user_author')
|
||||||
{
|
{
|
||||||
$varprop.="'.\$user->id";
|
$varprop.="'.\$user->id";
|
||||||
}
|
}
|
||||||
@ -367,7 +367,7 @@ foreach($property as $key => $prop)
|
|||||||
$varprop.=')."\'" : \'null\')';
|
$varprop.=')."\'" : \'null\')';
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif ($prop['field']=='fk_user_mod') {
|
elseif ($prop['field']=='fk_user_mod' || $prop['field']=='fk_user_m') {
|
||||||
$varprop.="'.\$user->id";
|
$varprop.="'.\$user->id";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -188,11 +188,13 @@ class Skeleton_Class extends CommonObject
|
|||||||
|
|
||||||
// Retrieve all extrafields for invoice
|
// Retrieve all extrafields for invoice
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
|
/*
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields=new ExtraFields($this->db);
|
$extrafields=new ExtraFields($this->db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
|
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
|
||||||
$this->fetch_optionals($this->id,$extralabels);
|
$this->fetch_optionals($this->id,$extralabels);
|
||||||
|
*/
|
||||||
|
|
||||||
// $this->fetch_lines();
|
// $this->fetch_lines();
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
@ -251,23 +253,19 @@ class Skeleton_Class extends CommonObject
|
|||||||
$sql .= $this->db->order($sortfield,$sortorder);
|
$sql .= $this->db->order($sortfield,$sortorder);
|
||||||
}
|
}
|
||||||
if (!empty($limit)) {
|
if (!empty($limit)) {
|
||||||
$sql .= ' ' . $this->db->plimit($limit + 1, $offset);
|
$sql .= ' ' . $this->db->plimit($limit, $offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->lines = array();
|
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
|
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
$line = new Skeleton_ClassLine();
|
$line = new self($this->db);
|
||||||
|
|
||||||
$line->id = $obj->rowid;
|
$line->id = $obj->rowid;
|
||||||
$line->prop1 = $obj->field1;
|
$line->prop1 = $obj->field1;
|
||||||
$line->prop2 = $obj->field2;
|
$line->prop2 = $obj->field2;
|
||||||
|
|
||||||
$this->lines[$line->id] = $line;
|
|
||||||
//...
|
//...
|
||||||
}
|
}
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|||||||
@ -89,8 +89,11 @@ if ($user->societe_id > 0)
|
|||||||
//accessforbidden();
|
//accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialize technical object to manage context to save list fields
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'mymodulelist';
|
||||||
|
|
||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||||
$hookmanager->initHooks(array('skeletonlist'));
|
$hookmanager->initHooks(array('mymodulelist'));
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
@ -244,7 +247,7 @@ $sql.=$db->order($sortfield,$sortorder);
|
|||||||
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -305,6 +308,7 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
|||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
|
||||||
|
|
||||||
|
|||||||
@ -42,11 +42,15 @@ then
|
|||||||
then
|
then
|
||||||
aaupper="US"
|
aaupper="US"
|
||||||
fi
|
fi
|
||||||
|
if [ $aaupper = "EL" ]
|
||||||
|
then
|
||||||
|
aaupper="GR"
|
||||||
|
fi
|
||||||
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
|
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
|
||||||
if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
|
if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
|
||||||
then
|
then
|
||||||
reflang="htdocs/langs/"$aa"_"$aaupper
|
reflang="htdocs/langs/"$aa"_"$aaupper
|
||||||
if [ -d $reflang ]
|
if [ -d $reflang -a $aa"_"$bb != $aa"_"$aaupper ]
|
||||||
then
|
then
|
||||||
echo "***** Process language "$aa"_"$bb" - Search original into "$reflang
|
echo "***** Process language "$aa"_"$bb" - Search original into "$reflang
|
||||||
echo $dirshort is an alternative language of $reflang
|
echo $dirshort is an alternative language of $reflang
|
||||||
|
|||||||
@ -17,14 +17,14 @@ fi
|
|||||||
# To detec
|
# To detec
|
||||||
if [ "x$1" = "xlist" ]
|
if [ "x$1" = "xlist" ]
|
||||||
then
|
then
|
||||||
find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF
|
find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep CRLF
|
||||||
# find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF
|
# find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# To convert
|
# To convert
|
||||||
if [ "x$1" = "xfix" ]
|
if [ "x$1" = "xfix" ]
|
||||||
then
|
then
|
||||||
for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' `
|
for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' `
|
||||||
do
|
do
|
||||||
echo "Fix file $fic"
|
echo "Fix file $fic"
|
||||||
dos2unix "$fic"
|
dos2unix "$fic"
|
||||||
|
|||||||
8
dev/tools/github_authors_peryear.sh
Executable file
8
dev/tools/github_authors_peryear.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
FROM=2016-01-01
|
||||||
|
TO=2016-12-31
|
||||||
|
|
||||||
|
echo "git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l"
|
||||||
|
git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l
|
||||||
|
|
||||||
15
dev/tools/github_commits_perversion.sh
Executable file
15
dev/tools/github_commits_perversion.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#/bin/bash
|
||||||
|
Releases=("3.8" "3.9" "4.0" "5.0", "develop")
|
||||||
|
Dates=("2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-07-01")
|
||||||
|
let "counter = 1"
|
||||||
|
|
||||||
|
for i in "${Releases[@]}"
|
||||||
|
do
|
||||||
|
git shortlog -s -n --after=${Dates[counter-1]} --before=${Dates[counter]}
|
||||||
|
echo -n "Total $i: "
|
||||||
|
git log --pretty=oneline --after=${Dates[counter-1]} --before=${Dates[counter]} | wc -l
|
||||||
|
echo "======================="
|
||||||
|
echo
|
||||||
|
let "counter +=1"
|
||||||
|
done
|
||||||
|
|
||||||
@ -39,8 +39,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<!-- Password -->
|
<!-- Password -->
|
||||||
<tr><td valign="top" class="nowrap"> <strong><label for="password">Mot de passe</label></strong> </td>
|
<tr><td class="tdtop nowrap"> <strong><label for="password">Mot de passe</label></strong> </td>
|
||||||
<td valign="top" class="nowrap">
|
<td class="tdtop nowrap">
|
||||||
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="" tabindex="2" />
|
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="" tabindex="2" />
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
|
|||||||
14
dev/translation/erp_comparison_translation.txt
Normal file
14
dev/translation/erp_comparison_translation.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
Term Dolibarr SAP Odoo ...
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
Thirdparty Contact partner Partner/Contact (company)
|
||||||
|
Contact/address Contact person Partner/Contact (individual)
|
||||||
|
|
||||||
|
Financial ?? Invoicing
|
||||||
|
|
||||||
|
Income / Expense ?? Profit / Loss
|
||||||
|
Balance Net profit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -41,6 +41,7 @@ $action = GETPOST('action');
|
|||||||
$cancel = GETPOST('cancel');
|
$cancel = GETPOST('cancel');
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$rowid = GETPOST('rowid', 'int');
|
$rowid = GETPOST('rowid', 'int');
|
||||||
|
|
||||||
$search_account = GETPOST("search_account");
|
$search_account = GETPOST("search_account");
|
||||||
$search_label = GETPOST("search_label");
|
$search_label = GETPOST("search_label");
|
||||||
$search_accountparent = GETPOST("search_accountparent");
|
$search_accountparent = GETPOST("search_accountparent");
|
||||||
@ -68,6 +69,15 @@ if (! $sortfield)
|
|||||||
if (! $sortorder)
|
if (! $sortorder)
|
||||||
$sortorder = "ASC";
|
$sortorder = "ASC";
|
||||||
|
|
||||||
|
$arrayfields=array(
|
||||||
|
'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
|
||||||
|
'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||||
|
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>0),
|
||||||
|
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>0),
|
||||||
|
'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0),
|
||||||
|
'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1)
|
||||||
|
);
|
||||||
|
|
||||||
$accounting = new AccountingAccount($db);
|
$accounting = new AccountingAccount($db);
|
||||||
|
|
||||||
|
|
||||||
@ -95,6 +105,7 @@ if (empty($reshook))
|
|||||||
$search_accountparent = "";
|
$search_accountparent = "";
|
||||||
$search_pcgtype = "";
|
$search_pcgtype = "";
|
||||||
$search_pcgsubtype = "";
|
$search_pcgsubtype = "";
|
||||||
|
$search_array_options=array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('change_chart'))
|
if (GETPOST('change_chart'))
|
||||||
@ -135,6 +146,7 @@ if (empty($reshook))
|
|||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
$form=new Form($db);
|
||||||
|
|
||||||
llxHeader('', $langs->trans("ListAccounts"));
|
llxHeader('', $langs->trans("ListAccounts"));
|
||||||
|
|
||||||
@ -145,8 +157,6 @@ if ($action == 'delete') {
|
|||||||
|
|
||||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active, ";
|
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active, ";
|
||||||
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
|
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||||
@ -154,25 +164,16 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_vers
|
|||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON aa.account_parent = a2.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON aa.account_parent = a2.rowid";
|
||||||
$sql .= " WHERE asy.rowid = " . $pcgver;
|
$sql .= " WHERE asy.rowid = " . $pcgver;
|
||||||
|
|
||||||
if (strlen(trim($search_account))) {
|
if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);
|
||||||
$sql .= natural_search("aa.account_number", $search_account);
|
if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label);
|
||||||
}
|
if (strlen(trim($search_accountparent))) $sql .= natural_search("aa.account_parent", $search_accountparent);
|
||||||
if (strlen(trim($search_label))) {
|
if (strlen(trim($search_pcgtype))) $sql .= natural_search("aa.pcg_type", $search_pcgtype);
|
||||||
$sql .= natural_search("aa.label", $search_label);
|
if (strlen(trim($search_pcgsubtype))) $sql .= natural_search("aa.pcg_subtype", $search_pcgsubtype);
|
||||||
}
|
|
||||||
if (strlen(trim($search_accountparent))) {
|
|
||||||
$sql .= natural_search("aa.account_parent", $search_accountparent);
|
|
||||||
}
|
|
||||||
if (strlen(trim($search_pcgtype))) {
|
|
||||||
$sql .= natural_search("aa.pcg_type", $search_pcgtype);
|
|
||||||
}
|
|
||||||
if (strlen(trim($search_pcgsubtype))) {
|
|
||||||
$sql .= natural_search("aa.pcg_subtype", $search_pcgsubtype);
|
|
||||||
}
|
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -184,18 +185,19 @@ $sql .= $db->plimit($limit + 1, $offset);
|
|||||||
dol_syslog('accountancy/admin/account.php:: $sql=' . $sql);
|
dol_syslog('accountancy/admin/account.php:: $sql=' . $sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
if ($resql) {
|
if ($resql)
|
||||||
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
$params='';
|
$params='';
|
||||||
if ($search_account != "") $params.= '&search_account='.urlencode($search_account);
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
if ($search_label != "") $params.= '&search_label='.urlencode($search_label);
|
if ($search_account) $params.= '&search_account='.urlencode($search_account);
|
||||||
if ($search_accountparent != "") $params.= '&search_accountparent='.urlencode($search_accountparent);
|
if ($search_label) $params.= '&search_label='.urlencode($search_label);
|
||||||
if ($search_pcgtype != "") $params.= '&search_pcgtype='.urlencode($search_pcgtype);
|
if ($search_accountparent) $params.= '&search_accountparent='.urlencode($search_accountparent);
|
||||||
if ($search_pcgsubtype != "") $params.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
if ($search_pcgtype) $params.= '&search_pcgtype='.urlencode($search_pcgtype);
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($search_pcgsubtype) $params.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
||||||
|
if ($optioncss) $param.='&optioncss='.$optioncss;
|
||||||
|
|
||||||
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy');
|
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy');
|
||||||
|
|
||||||
print '<form method="GET" action="' . $_SERVER["PHP_SELF"] . '">';
|
print '<form method="GET" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||||
@ -207,7 +209,7 @@ if ($resql) {
|
|||||||
$sql = "SELECT rowid, pcg_version, label, active";
|
$sql = "SELECT rowid, pcg_version, label, active";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_system";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_system";
|
||||||
$sql .= " WHERE active = 1";
|
$sql .= " WHERE active = 1";
|
||||||
dol_syslog('accountancy/admin/index.php:: $sql=' . $sql);
|
dol_syslog('accountancy/admin/account.php:: $sql=' . $sql);
|
||||||
$resqlchart = $db->query($sql);
|
$resqlchart = $db->query($sql);
|
||||||
$var = true;
|
$var = true;
|
||||||
if ($resqlchart) {
|
if ($resqlchart) {
|
||||||
@ -228,34 +230,53 @@ if ($resql) {
|
|||||||
print '<input type="submit" class="button" name="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
|
print '<input type="submit" class="button" name="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||||
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
|
print '<input type="hidden" name="action" value="list">';
|
||||||
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
print '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>';
|
print '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>';
|
||||||
print '<a class="butAction" href="./categories.php">' . $langs->trans("ApplyMassCategories") . '</a>';
|
print '<a class="butAction" href="./categories.php">' . $langs->trans("ApplyMassCategories") . '</a>';
|
||||||
// print '<a class="butAction" href="./importaccounts.php">' . $langs->trans("ImportAccount") . '</a>';
|
// print '<a class="butAction" href="./importaccounts.php">' . $langs->trans("ImportAccount") . '</a>';
|
||||||
// print '<a class="butAction" href="./productaccount.php">' . $langs->trans("CheckProductAccountancyCode") . '</a>';
|
// print '<a class="butAction" href="./productaccount.php">' . $langs->trans("CheckProductAccountancyCode") . '</a>';
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
print '<tr class="liste_titre">';
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
print_liste_field_titre($langs->trans("AccountNumber"), $_SERVER["PHP_SELF"], "aa.account_number", "", $params, "", $sortfield, $sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "aa.label", "", $params, "", $sortfield, $sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("Accountparent"), $_SERVER["PHP_SELF"], "aa.account_parent", "", $params, "", $sortfield, $sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("Pcgtype"), $_SERVER["PHP_SELF"], "aa.pcg_type", "", $params, "", $sortfield, $sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("Pcgsubtype"), $_SERVER["PHP_SELF"], "aa.pcg_subtype", "", $params, "", $sortfield, $sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("Activated"), $_SERVER["PHP_SELF"], "aa.active", "", $params, "", $sortfield, $sortorder);
|
|
||||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $params, "", 'width="60" align="center"', $sortfield, $sortorder);
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive">';
|
||||||
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_account" value="' . $search_account . '"></td>';
|
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder);
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_accountparent" value="' . $search_accountparent . '"></td>';
|
if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder);
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
|
if (! empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"],"aa.account_parent", "", $param,'align="left"',$sortfield,$sortorder);
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
|
if (! empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'],$_SERVER["PHP_SELF"],'aa.pcg_type','',$param,'',$sortfield,$sortorder);
|
||||||
print '<td class="liste_titre"> </td>';
|
if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'],$_SERVER["PHP_SELF"],'aa.pcg_subtype','',$param,'',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'],$_SERVER["PHP_SELF"],'aa.active','',$param,'',$sortfield,$sortorder);
|
||||||
|
|
||||||
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Line for search fields
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
if (! empty($arrayfields['aa.account_number']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_account" value="' . $search_account . '"></td>';
|
||||||
|
if (! empty($arrayfields['aa.label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
||||||
|
if (! empty($arrayfields['aa.account_parent']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_accountparent" value="' . $search_accountparent . '"></td>';
|
||||||
|
if (! empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
|
||||||
|
if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
|
||||||
|
if (! empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre"> </td>';
|
||||||
print '<td align="right" colspan="2" class="liste_titre">';
|
print '<td align="right" colspan="2" class="liste_titre">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||||
print $searchpitco;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -263,8 +284,7 @@ if ($resql) {
|
|||||||
|
|
||||||
$accountstatic = new AccountingAccount($db);
|
$accountstatic = new AccountingAccount($db);
|
||||||
$accountparent = new AccountingAccount($db);
|
$accountparent = new AccountingAccount($db);
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
while ( $i < min($num, $limit) )
|
while ( $i < min($num, $limit) )
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
@ -274,35 +294,81 @@ if ($resql) {
|
|||||||
$accountstatic->account_number = $obj->account_number;
|
$accountstatic->account_number = $obj->account_number;
|
||||||
|
|
||||||
print '<tr ' . $bc[$var] . '>';
|
print '<tr ' . $bc[$var] . '>';
|
||||||
print '<td>' . $accountstatic->getNomUrl(1) . '</td>';
|
|
||||||
print '<td>' . $obj->label . '</td>';
|
|
||||||
|
|
||||||
if (! empty($obj->account_parent))
|
// Account number
|
||||||
{
|
if (! empty($arrayfields['aa.account_number']['checked']))
|
||||||
$accountparent->id = $obj->rowid2;
|
|
||||||
$accountparent->label = $obj->label2;
|
|
||||||
$accountparent->account_number = $obj->account_number2;
|
|
||||||
|
|
||||||
print '<td>' . $accountparent->getNomUrl(1) . '</td>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
print '<td> </td>';
|
print "<td>";
|
||||||
|
print $accountstatic->getNomUrl(1);
|
||||||
|
print "</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
print '<td>' . $obj->pcg_type . '</td>';
|
|
||||||
print '<td>' . $obj->pcg_subtype . '</td>';
|
// Account label
|
||||||
print '<td>';
|
if (! empty($arrayfields['aa.label']['checked']))
|
||||||
if (empty($obj->active)) {
|
{
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=enable">';
|
print "<td>";
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
print $obj->label;
|
||||||
print '</a>';
|
print "</td>\n";
|
||||||
} else {
|
if (! $i) $totalarray['nbfield']++;
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=disable">';
|
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
||||||
print '</a>';
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
|
||||||
|
// Account parent
|
||||||
|
if (! empty($arrayfields['aa.account_parent']['checked']))
|
||||||
|
{
|
||||||
|
if (! empty($obj->account_parent))
|
||||||
|
{
|
||||||
|
$accountparent->id = $obj->rowid2;
|
||||||
|
$accountparent->label = $obj->label2;
|
||||||
|
$accountparent->account_number = $obj->account_number2;
|
||||||
|
|
||||||
|
print "<td>";
|
||||||
|
print $accountparent->getNomUrl(1);
|
||||||
|
print "</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td> </td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Chart of accounts type
|
||||||
|
if (! empty($arrayfields['aa.pcg_type']['checked']))
|
||||||
|
{
|
||||||
|
print "<td>";
|
||||||
|
print $obj->pcg_type;
|
||||||
|
print "</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Chart of accounts subtype
|
||||||
|
if (! empty($arrayfields['aa.pcg_subtype']['checked']))
|
||||||
|
{
|
||||||
|
print "<td>";
|
||||||
|
print $obj->pcg_subtype;
|
||||||
|
print "</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Activated or not
|
||||||
|
if (! empty($arrayfields['aa.active']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
if (empty($obj->active)) {
|
||||||
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=enable">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a>';
|
||||||
|
} else {
|
||||||
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=disable">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Action
|
// Action
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($user->admin) {
|
if ($user->admin) {
|
||||||
@ -315,6 +381,7 @@ if ($resql) {
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
print '</td>' . "\n";
|
print '</td>' . "\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
@ -322,6 +389,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
print "</div>";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
|
|||||||
@ -888,18 +888,18 @@ if ($id)
|
|||||||
{
|
{
|
||||||
if ($value == 'country')
|
if ($value == 'country')
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($id == 4) print '<td></td>';
|
if ($id == 4) print '<td></td>';
|
||||||
print '<td></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre" colspan="2" align="right">';
|
print '<td class="liste_titre" colspan="2" align="right">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||||
|
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,24 +17,24 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/admin/categories.php
|
* \file htdocs/accountancy/admin/categories.php
|
||||||
* \ingroup Advanced accountancy
|
* \ingroup Advanced accountancy
|
||||||
* \brief Page to assign mass categories to accounts
|
* \brief Page to assign mass categories to accounts
|
||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
// Class
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancycategory.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancycategory.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
// Langs
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("accountancy");
|
$langs->load("accountancy");
|
||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
$id = GETPOST('id', 'int');
|
||||||
|
$rowid = GETPOST('rowid', 'int');
|
||||||
|
$cancel = GETPOST('cancel');
|
||||||
$action = GETPOST('action');
|
$action = GETPOST('action');
|
||||||
$cat_id = GETPOST('account_category');
|
$cat_id = GETPOST('account_category');
|
||||||
$selectcpt = GETPOST('cpt_bk', 'array');
|
$selectcpt = GETPOST('cpt_bk', 'array');
|
||||||
@ -43,36 +44,31 @@ if ($cat_id == 0) {
|
|||||||
$cat_id = null;
|
$cat_id = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = GETPOST('id', 'int');
|
|
||||||
$rowid = GETPOST('rowid', 'int');
|
|
||||||
$cancel = GETPOST('cancel');
|
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (! $user->admin)
|
if (! $user->admin) accessforbidden();
|
||||||
accessforbidden();
|
|
||||||
|
|
||||||
$AccCat = new AccountancyCategory($db);
|
$accountingcategory = new AccountancyCategory($db);
|
||||||
|
|
||||||
// si ajout de comptes
|
// si ajout de comptes
|
||||||
if (! empty($selectcpt)) {
|
if (! empty($selectcpt)) {
|
||||||
$cpts = array ();
|
$cpts = array ();
|
||||||
foreach ( $selectcpt as $selectedOption ) {
|
foreach ( $selectcpt as $selectedoption ) {
|
||||||
if (! array_key_exists($selectedOption, $cpts))
|
if (! array_key_exists($selectedoption, $cpts))
|
||||||
$cpts[$selectedOption] = "'" . $selectedOption . "'";
|
$cpts[$selectedoption] = "'" . $selectedoption . "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$return= $AccCat->updateAccAcc($cat_id, $cpts);
|
$return= $accountingcategory->updateAccAcc($cat_id, $cpts);
|
||||||
|
|
||||||
if ($return<0) {
|
if ($return<0) {
|
||||||
setEventMessages($langs->trans('errors'), $AccCat->errors, 'errors');
|
setEventMessages($langs->trans('errors'), $accountingcategory->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($langs->trans('Saved'), null, 'mesgs');
|
setEventMessages($langs->trans('Saved'), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
if ($cpt_id) {
|
if ($cpt_id) {
|
||||||
if ($AccCat->deleteCptCat($cpt_id)) {
|
if ($accountingcategory->deleteCptCat($cpt_id)) {
|
||||||
setEventMessages($langs->trans('Deleted'), null, 'mesgs');
|
setEventMessages($langs->trans('CategoryDeleted'), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($langs->trans('errors'), null, 'errors');
|
setEventMessages($langs->trans('errors'), null, 'errors');
|
||||||
}
|
}
|
||||||
@ -83,12 +79,11 @@ if ($action == 'delete') {
|
|||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
$form = new Form($db);
|
||||||
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
llxheader('', $langs->trans('AccountAccounting'));
|
llxheader('', $langs->trans('AccountAccounting'));
|
||||||
|
|
||||||
$formaccounting = new FormAccounting($db);
|
|
||||||
$form = new Form($db);
|
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans('Categories'));
|
print load_fiche_titre($langs->trans('Categories'));
|
||||||
|
|
||||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||||
@ -102,22 +97,23 @@ print '<table class="border" width="100%">';
|
|||||||
print '<tr><td>' . $langs->trans("AccountingCategory") . '</td>';
|
print '<tr><td>' . $langs->trans("AccountingCategory") . '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$formaccounting->select_accounting_category($cat_id, 'account_category', 1);
|
$formaccounting->select_accounting_category($cat_id, 'account_category', 1);
|
||||||
print '<input class="button" type="submit" value="' . $langs->trans("Display") . '">';
|
print '<input class="button" type="submit" value="' . $langs->trans("Show") . '">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
if (! empty($cat_id)) {
|
if (! empty($cat_id)) {
|
||||||
$return = $AccCat->getCptBK($cat_id);
|
$return = $accountingcategory->getCptBK($cat_id);
|
||||||
if ($return < 0) {
|
if ($return < 0) {
|
||||||
setEventMessages(null, $AccCat->errors, 'errors');
|
setEventMessages(null, $accountingcategory->errors, 'errors');
|
||||||
}
|
}
|
||||||
print '<tr><td>' . $langs->trans("AddCompteFromBK") . '</td>';
|
print '<tr><td>' . $langs->trans("AddAccountFromBookKeepingWithNoCategories") . '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (is_array($AccCat->lines_cptbk) && count($AccCat->lines_cptbk) > 0) {
|
if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) {
|
||||||
print '<select size="' . count($obj) . '" name="cpt_bk[]" multiple>';
|
print '<select size="' . count($obj) . '" name="cpt_bk[]" multiple>';
|
||||||
foreach ( $AccCat->lines_cptbk as $cpt ) {
|
foreach ( $accountingcategory->lines_cptbk as $cpt ) {
|
||||||
print '<option value="' . length_accountg($cpt->numero_compte) . '">' . length_accountg($cpt->numero_compte) . ' (' . $cpt->label_compte . ' ' . $cpt->doc_ref . ')</option>';
|
print '<option value="' . length_accountg($cpt->numero_compte) . '">' . length_accountg($cpt->numero_compte) . ' (' . $cpt->label_compte . ' ' . $cpt->doc_ref . ')</option>';
|
||||||
}
|
}
|
||||||
print '</select> - <input class="button" type="submit" id="" class="action-delete" value="' . $langs->trans("add") . '"> ';
|
print '</select>';
|
||||||
|
print '<input class="button" type="submit" id="" class="action-delete" value="' . $langs->trans("Add") . '"> ';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -131,26 +127,30 @@ print '</form>';
|
|||||||
|
|
||||||
if ($action == 'display' || $action == 'delete') {
|
if ($action == 'display' || $action == 'delete') {
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print "<table class='noborder' width='100%'>\n";
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
print '<tr class="liste_titre"><th class="liste_titre">' . $langs->trans("Numerocompte") . '</th><th class="liste_titre">' . $langs->trans("Description") . '</th><th class="liste_titre" width="60" align="center">Action</th></tr>';
|
print '<td>'.$langs->trans("AccountAccounting")."</td>";
|
||||||
|
print '<td colspan="2">'.$langs->trans("Label")."</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
if (! empty($cat_id)) {
|
if (! empty($cat_id)) {
|
||||||
$return = $AccCat->display($cat_id);
|
$return = $accountingcategory->display($cat_id);
|
||||||
if ($return < 0) {
|
if ($return < 0) {
|
||||||
setEventMessages(null, $AccCat->errors, 'errors');
|
setEventMessages(null, $accountingcategory->errors, 'errors');
|
||||||
}
|
}
|
||||||
$j = 1;
|
|
||||||
if (is_array($AccCat->lines_display) && count($AccCat->lines_display) > 0) {
|
if (is_array($accountingcategory->lines_display) && count($accountingcategory->lines_display) > 0) {
|
||||||
foreach ( $AccCat->lines_display as $cpt ) {
|
foreach ( $accountingcategory->lines_display as $cpt ) {
|
||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
print '<tr' . $bc[$var] . '>';
|
print '<tr' . $bc[$var] . '>';
|
||||||
print '<td>' . length_accountg($cpt->account_number) . '</td>';
|
print '<td>' . length_accountg($cpt->account_number) . '</td>';
|
||||||
print '<td>' . $cpt->label . '</td>';
|
print '<td>' . $cpt->label . '</td>';
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"] . "?account_category=$cat_id&cptid=" . $cpt->rowid, $langs->trans("DeleteCptCategory"), $langs->trans("ConfirmDeleteCptCategory"), "delete", '', 0, "action-delete" . $j);
|
print '<td align="right">';
|
||||||
print '<td><input class="button" type="button" id="action-delete' . $j . '" value="' . $langs->trans("Delete") . '"></td>';
|
print "<a href= '".$_SERVER['PHP_SELF']."?action=delete&account_category=" . $cat_id . "&cptid=" . $cpt->rowid."'>";
|
||||||
|
print img_delete($langs->trans("DeleteFromCat")).' ';
|
||||||
|
print $langs->trans("DeleteFromCat")."</a>";
|
||||||
|
print "</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$j ++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
@ -62,7 +62,10 @@ $list_account = array (
|
|||||||
'ACCOUNTING_VAT_PAY_ACCOUNT',
|
'ACCOUNTING_VAT_PAY_ACCOUNT',
|
||||||
'ACCOUNTING_ACCOUNT_SUSPENSE',
|
'ACCOUNTING_ACCOUNT_SUSPENSE',
|
||||||
'ACCOUNTING_ACCOUNT_TRANSFER_CASH',
|
'ACCOUNTING_ACCOUNT_TRANSFER_CASH',
|
||||||
'DONATION_ACCOUNTINGACCOUNT'
|
'DONATION_ACCOUNTINGACCOUNT',
|
||||||
|
'LOAN_ACCOUNTING_ACCOUNT_CAPITAL',
|
||||||
|
'LOAN_ACCOUNTING_ACCOUNT_INTEREST',
|
||||||
|
'LOAN_ACCOUNTING_ACCOUNT_INSURANCE'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ $sql .= " WHERE f.entity = " . $conf->entity;
|
|||||||
$sql.=$db->order($sortfield,$sortorder);
|
$sql.=$db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -268,7 +268,7 @@ if ($action == 'create')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td valign="top">';
|
print '<tr><td class="tdtop">';
|
||||||
print $form->editfieldkey("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
|
print $form->editfieldkey("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
|
||||||
print '</td><td colspan="2">';
|
print '</td><td colspan="2">';
|
||||||
print $form->editfieldval("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
|
print $form->editfieldval("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
|
||||||
|
|||||||
@ -248,7 +248,7 @@ if (strlen(trim($search_desc))) {
|
|||||||
}
|
}
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -143,7 +143,7 @@ else {
|
|||||||
|
|
||||||
// List
|
// List
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
|
$nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
|
||||||
if ($nbtotalofrecords < 0) {
|
if ($nbtotalofrecords < 0) {
|
||||||
|
|||||||
@ -38,7 +38,7 @@ $langs->load("other");
|
|||||||
$langs->load("accountancy");
|
$langs->load("accountancy");
|
||||||
|
|
||||||
// Filter
|
// Filter
|
||||||
$year = $_GET["year"];
|
$year = GETPOST("year",'int');
|
||||||
if ($year == 0) {
|
if ($year == 0) {
|
||||||
$year_current = strftime("%Y", time());
|
$year_current = strftime("%Y", time());
|
||||||
$year_start = $year_current;
|
$year_start = $year_current;
|
||||||
@ -47,9 +47,11 @@ if ($year == 0) {
|
|||||||
$year_start = $year;
|
$year_start = $year;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('', $langs->trans("Bookkeeping"));
|
llxHeader('', $langs->trans("Bookkeeping"));
|
||||||
|
|
||||||
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
|
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
|
||||||
|
|||||||
@ -293,7 +293,7 @@ llxHeader('', $title_page);
|
|||||||
|
|
||||||
// List
|
// List
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
||||||
if ($nbtotalofrecords < 0) {
|
if ($nbtotalofrecords < 0) {
|
||||||
|
|||||||
@ -162,7 +162,7 @@ llxHeader('', $title_page);
|
|||||||
|
|
||||||
// List
|
// List
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
|
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
|
||||||
if ($nbtotalofrecords < 0) {
|
if ($nbtotalofrecords < 0) {
|
||||||
@ -235,9 +235,8 @@ print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60"
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="GET">';
|
print '<td class="liste_titre">' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . '</td>';
|
||||||
print '<td>' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . '</td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td></td>';
|
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
print $langs->trans('From') . ': ';
|
print $langs->trans('From') . ': ';
|
||||||
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
|
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
|
||||||
@ -247,10 +246,10 @@ print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_mvt_label" value="' . $search_mvt_label . '"/></td>';
|
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_mvt_label" value="' . $search_mvt_label . '"/></td>';
|
||||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_account" value="' . $search_label_account . '"/></td>';
|
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_account" value="' . $search_label_account . '"/></td>';
|
||||||
print '<td> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td align="right"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
||||||
print '<td align="right" colspan="2" class="liste_titre">';
|
print '<td class="liste_titre" align="right" colspan="2">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -158,7 +158,7 @@ if (! empty($search_code_journal)) {
|
|||||||
* Mode List
|
* Mode List
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0);
|
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0);
|
||||||
if ($nbtotalofrecords < 0) {
|
if ($nbtotalofrecords < 0) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -17,9 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/class/accountancycategory.class.php
|
* \file htdocs/accountancy/class/accountancycategory.class.php
|
||||||
* \ingroup Advanced accountancy
|
* \ingroup Advanced accountancy
|
||||||
* \brief File of class to manage categories of an accounting category_type
|
* \brief File of class to manage categories of an accounting category_type
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Class
|
// Class
|
||||||
@ -72,7 +72,6 @@ class AccountancyCategory
|
|||||||
$this->lines_display[] = $obj;
|
$this->lines_display[] = $obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $num;
|
return $num;
|
||||||
} else {
|
} else {
|
||||||
$this->error = "Error " . $this->db->lasterror();
|
$this->error = "Error " . $this->db->lasterror();
|
||||||
@ -84,7 +83,7 @@ class AccountancyCategory
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to select accountiing category of an accounting account present in chart of accounts
|
* Function to select accounting category of an accounting account present in chart of accounts
|
||||||
*
|
*
|
||||||
* @param int $id Id category
|
* @param int $id Id category
|
||||||
*
|
*
|
||||||
|
|||||||
@ -357,7 +357,7 @@ class AccountancyExport
|
|||||||
$Tab['libelle_ecriture'] = str_pad(self::trunc($data->doc_ref . ' ' . $data->label_compte, 20), 20);
|
$Tab['libelle_ecriture'] = str_pad(self::trunc($data->doc_ref . ' ' . $data->label_compte, 20), 20);
|
||||||
$Tab['sens'] = $data->sens; // C or D
|
$Tab['sens'] = $data->sens; // C or D
|
||||||
$Tab['signe_montant'] = '+';
|
$Tab['signe_montant'] = '+';
|
||||||
$Tab['montant'] = str_pad(abs($data->montant) * 100, 12, '0', STR_PAD_LEFT); // TODO manage negative amount
|
$Tab['montant'] = str_pad(abs($data->montant), 12, '0', STR_PAD_LEFT); // TODO manage negative amount
|
||||||
$Tab['contrepartie'] = str_repeat(' ', 8);
|
$Tab['contrepartie'] = str_repeat(' ', 8);
|
||||||
if (! empty($data->date_echeance))
|
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, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||||
|
|||||||
@ -83,6 +83,8 @@ class FormVentilation extends Form
|
|||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
|
||||||
|
$out = '';
|
||||||
|
|
||||||
$options = array();
|
$options = array();
|
||||||
if ($usecache && ! empty($this->options_cache[$usecache]))
|
if ($usecache && ! empty($this->options_cache[$usecache]))
|
||||||
{
|
{
|
||||||
@ -109,7 +111,7 @@ class FormVentilation extends Form
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$out = ajax_combobox($htmlname, $event);
|
$out .= ajax_combobox($htmlname, $event);
|
||||||
|
|
||||||
$selected = 0;
|
$selected = 0;
|
||||||
while ($obj = $this->db->fetch_object($resql))
|
while ($obj = $this->db->fetch_object($resql))
|
||||||
|
|||||||
@ -29,6 +29,7 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
// Langs
|
// Langs
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
@ -47,7 +48,7 @@ if (! $user->rights->accounting->bind->write)
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
// Filter
|
// Filter
|
||||||
$year = $_GET["year"];
|
$year = GETPOST("year",'int');
|
||||||
if ($year == 0) {
|
if ($year == 0) {
|
||||||
$year_current = strftime("%Y", time());
|
$year_current = strftime("%Y", time());
|
||||||
$year_start = $year_current;
|
$year_start = $year_current;
|
||||||
@ -57,7 +58,7 @@ if ($year == 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Validate History
|
// Validate History
|
||||||
$action = GETPOST('action');
|
$action = GETPOST('action','alpha');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -179,7 +180,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '<a class="butActionDelete" hr
|
|||||||
$sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
$sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||||
$sql .= " , " . MAIN_DB_PREFIX . "facture as f";
|
$sql .= " , " . MAIN_DB_PREFIX . "facture as f";
|
||||||
$sql .= " WHERE fd.fk_code_ventilation = 0";
|
$sql .= " WHERE fd.fk_code_ventilation = 0";
|
||||||
$sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;";
|
$sql .= " AND f.rowid = fd.fk_facture";
|
||||||
|
$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_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -222,6 +230,11 @@ $sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'
|
|||||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
$sql .= " AND aa.account_number IS NULL";
|
$sql .= " AND aa.account_number IS NULL";
|
||||||
|
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_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
||||||
|
|
||||||
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
||||||
@ -273,6 +286,11 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid
|
|||||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
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_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
$sql .= " AND aa.account_number IS NOT NULL";
|
$sql .= " AND aa.account_number IS NOT NULL";
|
||||||
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
||||||
|
|
||||||
@ -301,97 +319,105 @@ print "</table>\n";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
|
||||||
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
|
||||||
|
print "<br>\n";
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
print "<br>\n";
|
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
|
||||||
print '<table class="noborder" width="100%">';
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
|
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
}
|
||||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
|
|
||||||
|
$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS total,";
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
|
}
|
||||||
|
$sql .= " SUM(fd.total_ht) as total";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||||
|
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
|
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
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_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
dol_syslog('htdocs/accountancy/customer/index.php');
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$i = 0;
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
while ($row = $db->fetch_row($resql)) {
|
||||||
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
$i ++;
|
||||||
|
}
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
print $db->lasterror(); // Show last sql error
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
|
|
||||||
|
if (! empty($conf->margin->enabled)) {
|
||||||
|
print "<br>\n";
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre"><td width="400">' . $langs->trans("TotalMarge") . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
|
|
||||||
|
$sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,";
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
|
}
|
||||||
|
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||||
|
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
|
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
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_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
while ($row = $db->fetch_row($resql)) {
|
||||||
|
|
||||||
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td align="right">' . price(price2num($row[$i])) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right"><b>' . price(price2num($row[13])) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
print $db->lasterror(); // Show last sql error
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS total,";
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
|
||||||
}
|
|
||||||
$sql .= " SUM(fd.total_ht) as total";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
|
||||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
|
||||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
|
||||||
|
|
||||||
dol_syslog('htdocs/accountancy/customer/index.php');
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
$i = 0;
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
while ($row = $db->fetch_row($resql)) {
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
$i ++;
|
|
||||||
}
|
|
||||||
$db->free($resql);
|
|
||||||
} else {
|
|
||||||
print $db->lasterror(); // Show last sql error
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
if (! empty($conf->margin->enabled)) {
|
|
||||||
print "<br>\n";
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
print '<tr class="liste_titre"><td width="400">' . $langs->trans("TotalMarge") . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,";
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
|
||||||
}
|
|
||||||
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
|
||||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
|
||||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
|
||||||
|
|
||||||
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
while ($row = $db->fetch_row($resql)) {
|
|
||||||
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td align="right">' . price(price2num($row[$i])) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td align="right"><b>' . price(price2num($row[13])) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
$db->free($resql);
|
|
||||||
} else {
|
|
||||||
print $db->lasterror(); // Show last sql error
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
print '</td></tr></table>';
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -200,7 +200,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't sha
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -210,12 +210,17 @@ if (strlen(trim($search_account))) {
|
|||||||
if (strlen(trim($search_vat))) {
|
if (strlen(trim($search_vat))) {
|
||||||
$sql .= natural_search("l.tva_tx",$search_vat,1);
|
$sql .= natural_search("l.tva_tx",$search_vat,1);
|
||||||
}
|
}
|
||||||
|
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.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -45,7 +45,7 @@ if (! $user->rights->accounting->bind->write)
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
// Filter
|
// Filter
|
||||||
$year = $_GET["year"];
|
$year = GETPOST('year', 'int');
|
||||||
if ($year == 0) {
|
if ($year == 0) {
|
||||||
$year_current = strftime("%Y", time());
|
$year_current = strftime("%Y", time());
|
||||||
$year_start = $year_current;
|
$year_start = $year_current;
|
||||||
@ -68,9 +68,9 @@ if ($action == 'validatehistory') {
|
|||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
// First clean corrupted data
|
// First clean corrupted data
|
||||||
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
|
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
$sqlclean .= " SET fd.fk_code_ventilation = 0";
|
$sqlclean .= " SET erd.fk_code_ventilation = 0";
|
||||||
$sqlclean .= ' WHERE fd.fk_code_ventilation NOT IN ';
|
$sqlclean .= ' WHERE erd.fk_code_ventilation NOT IN ';
|
||||||
$sqlclean .= ' (SELECT accnt.rowid ';
|
$sqlclean .= ' (SELECT accnt.rowid ';
|
||||||
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||||
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||||
@ -79,18 +79,18 @@ if ($action == 'validatehistory') {
|
|||||||
|
|
||||||
// Now make the binding
|
// Now make the binding
|
||||||
if ($db->type == 'pgsql') {
|
if ($db->type == 'pgsql') {
|
||||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det";
|
||||||
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
$sql1 .= " FROM " . MAIN_DB_PREFIX . "c_type_fees as t, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||||
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facture_fourn_det.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "expensereport_det.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
|
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code = accnt.account_number";
|
||||||
$sql1 .= " AND " . MAIN_DB_PREFIX . "facture_fourn_det.fk_code_ventilation = 0";
|
$sql1 .= " AND " . MAIN_DB_PREFIX . "expensereport_det.fk_code_ventilation = 0";
|
||||||
} else {
|
} else {
|
||||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd, " . MAIN_DB_PREFIX . "c_type_fees as t, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||||
$sql1 .= " SET fd.fk_code_ventilation = accnt.rowid";
|
$sql1 .= " SET erd.fk_code_ventilation = accnt.rowid";
|
||||||
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
$sql1 .= " WHERE erd.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
|
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code=accnt.account_number";
|
||||||
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
$sql1 .= " AND erd.fk_code_ventilation = 0";
|
||||||
}
|
}
|
||||||
|
|
||||||
$resql1 = $db->query($sql1);
|
$resql1 = $db->query($sql1);
|
||||||
@ -106,9 +106,9 @@ if ($action == 'validatehistory') {
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
|
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
$sql1 .= " SET fd.fk_code_ventilation = 0";
|
$sql1 .= " SET erd.fk_code_ventilation = 0";
|
||||||
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
|
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN ';
|
||||||
$sql1 .= ' (SELECT accnt.rowid ';
|
$sql1 .= ' (SELECT accnt.rowid ';
|
||||||
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||||
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||||
@ -129,12 +129,12 @@ if ($action == 'validatehistory') {
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
|
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
$sql1.= " SET fd.fk_code_ventilation = 0";
|
$sql1.= " SET erd.fk_code_ventilation = 0";
|
||||||
$sql1.= " WHERE fd.fk_facture_fourn IN ( SELECT f.rowid FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
$sql1.= " WHERE erd.fk_expensereport IN ( SELECT er.rowid FROM " . MAIN_DB_PREFIX . "expensereport as er";
|
||||||
$sql1.= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($year_current, 1, false)) . "'";
|
$sql1.= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($year_current, 1, false)) . "'";
|
||||||
$sql1.= " AND f.datef <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "'";
|
$sql1.= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "'";
|
||||||
$sql1.= " AND f.entity IN (" . getEntity("accountancy", 1) . ")";
|
$sql1.= " AND er.entity IN (" . getEntity("accountancy", 1) . ")";
|
||||||
$sql1.=")";
|
$sql1.=")";
|
||||||
|
|
||||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||||
@ -197,16 +197,17 @@ print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></
|
|||||||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
|
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
|
||||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
|
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
}
|
}
|
||||||
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
|
||||||
$sql .= " WHERE er.date_create >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
$sql .= " AND er.date_create <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
$sql .= " AND er.fk_statut > 0 ";
|
$sql .= " AND er.fk_statut > 0 ";
|
||||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||||
|
$sql .= " AND aa.account_number IS NULL";
|
||||||
$sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
|
$sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
|
||||||
|
|
||||||
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
||||||
@ -250,17 +251,17 @@ print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></
|
|||||||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
|
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
|
||||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
|
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
}
|
}
|
||||||
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
|
||||||
$sql .= " WHERE er.date_create >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
$sql .= " AND er.date_create <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
$sql .= " AND er.fk_statut > 0 ";
|
$sql .= " AND er.fk_statut > 0 ";
|
||||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||||
$sql .= " AND aa.account_number IS NULL";
|
$sql .= " AND aa.account_number IS NOT NULL";
|
||||||
$sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
|
$sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
|
||||||
|
|
||||||
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
||||||
@ -289,55 +290,55 @@ print "</table>\n";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<br>';
|
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
|
||||||
print '<br>';
|
{
|
||||||
|
print '<br>';
|
||||||
|
print '<br>';
|
||||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
|
||||||
|
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||||
|
|
||||||
|
print "<br>\n";
|
||||||
print "<br>\n";
|
print '<table class="noborder" width="100%">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
||||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
}
|
||||||
|
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
|
|
||||||
|
$sql = "SELECT '" . $langs->trans("TotalExpenseReport") . "' AS label,";
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
|
}
|
||||||
|
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||||
|
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
|
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
|
$sql .= " AND er.fk_statut > 0 ";
|
||||||
|
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
|
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
while ( $row = $db->fetch_row($resql)) {
|
||||||
|
|
||||||
|
|
||||||
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
print $db->lasterror(); // Show last sql error
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
}
|
}
|
||||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("TotalExpenseReport") . "' AS label,";
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
|
||||||
}
|
|
||||||
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
|
||||||
$sql .= " WHERE er.date_create >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
|
||||||
$sql .= " AND er.date_create <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
|
||||||
$sql .= " AND er.fk_statut > 0 ";
|
|
||||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
|
||||||
|
|
||||||
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
while ( $row = $db->fetch_row($resql)) {
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->free($resql);
|
|
||||||
} else {
|
|
||||||
print $db->lasterror(); // Show last sql error
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -178,7 +178,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -208,7 +208,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -36,9 +37,6 @@ $langs->load("accountancy");
|
|||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
// Validate History
|
|
||||||
$action = GETPOST('action');
|
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
$langs->load("dict");
|
$langs->load("dict");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@ -73,11 +71,11 @@ print "<br>\n";
|
|||||||
|
|
||||||
// STEPS
|
// STEPS
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'</strong>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'</strong>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'</strong>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'</strong>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
@ -86,16 +84,16 @@ print "<br>\n";
|
|||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescMisc", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>')."<br>\n";
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescMisc", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>')."<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
$step++;
|
$step++;
|
||||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong>';
|
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong>';
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
if (! empty($conf->tax->enabled))
|
if (! empty($conf->tax->enabled))
|
||||||
{
|
{
|
||||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong>';
|
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong>';
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
@ -104,7 +102,7 @@ if (! empty($conf->tax->enabled))
|
|||||||
/*if (! empty($conf->salaries->enabled))
|
/*if (! empty($conf->salaries->enabled))
|
||||||
{
|
{
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||||
// htdocs/admin/salaries.php
|
// htdocs/admin/salaries.php
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
@ -112,14 +110,14 @@ if (! empty($conf->tax->enabled))
|
|||||||
if (! empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
if (! empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||||
{
|
{
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
if (! empty($conf->loan->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
if (! empty($conf->loan->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||||
{
|
{
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuLoanAccounts").'</strong>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").'-'.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
@ -127,7 +125,7 @@ if (! empty($conf->loan->enabled)) // TODO Move this in the default account pag
|
|||||||
if (! empty($conf->don->enabled))
|
if (! empty($conf->don->enabled))
|
||||||
{
|
{
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDonationAccounts").'</strong>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDonationAccounts").'</strong>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}*/
|
}*/
|
||||||
@ -138,7 +136,7 @@ print "<br>\n";
|
|||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>')."<br>\n";
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>')."<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
@ -148,14 +146,21 @@ print "<br>\n";
|
|||||||
$step = 0;
|
$step = 0;
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescCustomer", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."<br>\n";
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescCustomer", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSupplier", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."<br>\n";
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSupplier", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."<br>\n";
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
|
$step++;
|
||||||
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", $step)."<br>\n";
|
||||||
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", $step)."<br>\n";
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", $step)."<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|||||||
@ -86,14 +86,14 @@ $idpays = $p[0];
|
|||||||
|
|
||||||
$sql = "SELECT er.rowid, er.ref, er.date_debut as de,";
|
$sql = "SELECT er.rowid, er.ref, er.date_debut as de,";
|
||||||
$sql .= " erd.rowid as erdid, erd.comments, erd.total_ttc, erd.tva_tx, erd.total_ht, erd.total_tva, erd.fk_code_ventilation,";
|
$sql .= " erd.rowid as erdid, erd.comments, erd.total_ttc, erd.tva_tx, erd.total_ht, erd.total_tva, erd.fk_code_ventilation,";
|
||||||
$sql .= " u.rowid as uid, u.firstname, u.lastname, u.accountancy_code as user_accountancy_code,";
|
$sql .= " u.rowid as uid, u.firstname, u.lastname, u.accountancy_code as user_accountancy_account,";
|
||||||
$sql .= " f.accountancy_code, ct.accountancy_code_buy as account_tva, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
|
$sql .= " f.accountancy_code, ct.accountancy_code_buy as account_tva, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva as ct ON erd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva as ct ON erd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
|
||||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
$sql .= " JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "user as u ON u.rowid = er.fk_user_valid";
|
$sql .= " JOIN " . MAIN_DB_PREFIX . "user as u ON u.rowid = er.fk_user_author";
|
||||||
$sql .= " WHERE er.fk_statut > 0 ";
|
$sql .= " WHERE er.fk_statut > 0 ";
|
||||||
$sql .= " AND erd.fk_code_ventilation > 0 ";
|
$sql .= " AND erd.fk_code_ventilation > 0 ";
|
||||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|||||||
@ -43,7 +43,7 @@ $rowid = GETPOST('rowid', 'int');
|
|||||||
$cancel = GETPOST('cancel');
|
$cancel = GETPOST('cancel');
|
||||||
|
|
||||||
// Filter
|
// Filter
|
||||||
$year = $_GET["year"];
|
$year = GETPOST('year','int');
|
||||||
if ($year == 0) {
|
if ($year == 0) {
|
||||||
$year_current = strftime("%Y", time());
|
$year_current = strftime("%Y", time());
|
||||||
$year_start = $year_current;
|
$year_start = $year_current;
|
||||||
@ -64,9 +64,11 @@ if (! $user->rights->accounting->comptarapport->lire)
|
|||||||
|
|
||||||
$AccCat = new AccountancyCategory($db);
|
$AccCat = new AccountancyCategory($db);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxheader('', $langs->trans('ReportInOut'));
|
llxheader('', $langs->trans('ReportInOut'));
|
||||||
|
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|||||||
@ -45,7 +45,7 @@ if (! $user->rights->accounting->bind->write)
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
// Filter
|
// Filter
|
||||||
$year = $_GET["year"];
|
$year = GETPOST("year",'int');
|
||||||
if ($year == 0) {
|
if ($year == 0) {
|
||||||
$year_current = strftime("%Y", time());
|
$year_current = strftime("%Y", time());
|
||||||
$year_start = $year_current;
|
$year_start = $year_current;
|
||||||
@ -55,7 +55,7 @@ if ($year == 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Validate History
|
// Validate History
|
||||||
$action = GETPOST('action');
|
$action = GETPOST('action', 'alpha');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -289,58 +289,56 @@ print "</table>\n";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
|
||||||
print '<br>';
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||||
|
|
||||||
|
print "<br>\n";
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
print "<br>\n";
|
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
print '<table class="noborder" width="100%">';
|
}
|
||||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,";
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
|
}
|
||||||
|
$sql .= " ROUND(SUM(ffd.total_ht),2) as total";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
||||||
|
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
|
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
|
$sql .= " AND ff.fk_statut > 0 ";
|
||||||
|
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
|
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
while ( $row = $db->fetch_row($resql)) {
|
||||||
|
|
||||||
|
|
||||||
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
print $db->lasterror(); // Show last sql error
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
}
|
}
|
||||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,";
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
|
||||||
}
|
|
||||||
$sql .= " ROUND(SUM(ffd.total_ht),2) as total";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
|
||||||
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
|
||||||
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
|
||||||
$sql .= " AND ff.fk_statut > 0 ";
|
|
||||||
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
|
||||||
|
|
||||||
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
while ( $row = $db->fetch_row($resql)) {
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->free($resql);
|
|
||||||
} else {
|
|
||||||
print $db->lasterror(); // Show last sql error
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -182,7 +182,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -217,7 +217,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -108,7 +108,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top"><?php echo $langs->trans("Note"); ?></td>
|
<td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
|
||||||
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
|
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@ -117,7 +117,7 @@ echo $this->control->tpl['ajax_selectcountry'];
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top"><?php echo $langs->trans("Note"); ?></td>
|
<td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
|
||||||
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
|
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@ -102,7 +102,7 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top"><?php echo $langs->trans("Note"); ?></td>
|
<td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
|
||||||
<td colspan="3"><?php echo $this->control->tpl['note']; ?></td>
|
<td colspan="3"><?php echo $this->control->tpl['note']; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@ -873,7 +873,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
print '<tr><td valign="top">'.$langs->trans("Address").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
|
||||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOST('address','alpha')?GETPOST('address','alpha'):$object->address).'</textarea>';
|
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOST('address','alpha')?GETPOST('address','alpha'):$object->address).'</textarea>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -1818,18 +1818,16 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
// Positionne le modele sur le nom du modele a utiliser
|
if (! dol_strlen($modele)) {
|
||||||
if (! dol_strlen($modele))
|
|
||||||
{
|
$modele = 'standard';
|
||||||
if (! empty($conf->global->ADHERENT_ADDON_PDF))
|
|
||||||
{
|
if ($this->modelpdf) {
|
||||||
$modele = $conf->global->ADHERENT_ADDON_PDF;
|
$modele = $this->modelpdf;
|
||||||
}
|
} elseif (! empty($conf->global->ADHERENT_ADDON_PDF)) {
|
||||||
else
|
$modele = $conf->global->ADHERENT_ADDON_PDF;
|
||||||
{
|
}
|
||||||
$modele = 'standard';
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$modelpath = "core/modules/member/doc/";
|
$modelpath = "core/modules/member/doc/";
|
||||||
|
|
||||||
|
|||||||
@ -170,8 +170,8 @@ class Members extends DolibarrApi
|
|||||||
foreach($request_data as $field => $value) {
|
foreach($request_data as $field => $value) {
|
||||||
$member->$field = $value;
|
$member->$field = $value;
|
||||||
}
|
}
|
||||||
if($member->create(DolibarrApiAccess::$user) < 0) {
|
if ($member->create(DolibarrApiAccess::$user) < 0) {
|
||||||
throw new RestException(503, 'Error when create member : '.$member->error);
|
throw new RestException(500, 'Error creating member', array_merge(array($member->error), $member->errors));
|
||||||
}
|
}
|
||||||
return $member->id;
|
return $member->id;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -162,8 +162,8 @@ class Subscriptions extends DolibarrApi
|
|||||||
foreach($request_data as $field => $value) {
|
foreach($request_data as $field => $value) {
|
||||||
$subscription->$field = $value;
|
$subscription->$field = $value;
|
||||||
}
|
}
|
||||||
if($subscription->create(DolibarrApiAccess::$user) < 0) {
|
if ($subscription->create(DolibarrApiAccess::$user) < 0) {
|
||||||
throw new RestException(503, 'Error when create subscription : '.$subscription->error);
|
throw new RestException(500, 'Error when creating subscription', array_merge(array($subscription->error), $subscription->errors));
|
||||||
}
|
}
|
||||||
return $subscription->id;
|
return $subscription->id;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -293,7 +293,6 @@ class Subscription extends CommonObject
|
|||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
* @param int $statut Id statut
|
* @param int $statut Id statut
|
||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut)
|
function LibStatut($statut)
|
||||||
|
|||||||
@ -250,7 +250,7 @@ $sql.=$hookmanager->resPrint;
|
|||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
// Count total nb of records with no order and no limits
|
// Count total nb of records with no order and no limits
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -375,7 +375,7 @@ if (! empty($moreforfilter))
|
|||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
||||||
|
|||||||
@ -1039,7 +1039,7 @@ if ($rowid > 0)
|
|||||||
//print '<tr><td colspan="2"><b>'.$langs->trans("Payment").'</b></td></tr>';
|
//print '<tr><td colspan="2"><b>'.$langs->trans("Payment").'</b></td></tr>';
|
||||||
|
|
||||||
// No more action
|
// No more action
|
||||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans('MoreActions');
|
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('MoreActions');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice)?' checked':'').'> '.$langs->trans("None").'<br>';
|
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice)?' checked':'').'> '.$langs->trans("None").'<br>';
|
||||||
|
|||||||
@ -110,7 +110,7 @@ if ($search_account > 0) $sql.= " AND b.fk_account = ".$search_account;
|
|||||||
if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1);
|
if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1);
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -91,10 +91,10 @@ if ($action == 'add' && $user->rights->adherent->configurer)
|
|||||||
$object = new AdherentType($db);
|
$object = new AdherentType($db);
|
||||||
|
|
||||||
$object->libelle = trim($label);
|
$object->libelle = trim($label);
|
||||||
$object->subscription = trim($subscription);
|
$object->subscription = (int) trim($subscription);
|
||||||
$object->note = trim($comment);
|
$object->note = trim($comment);
|
||||||
$object->mail_valid = trim($mail_valid);
|
$object->mail_valid = (boolean) trim($mail_valid);
|
||||||
$object->vote = trim($vote);
|
$object->vote = (boolean) trim($vote);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
@ -129,10 +129,10 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
|||||||
$object = new AdherentType($db);
|
$object = new AdherentType($db);
|
||||||
$object->id = $rowid;
|
$object->id = $rowid;
|
||||||
$object->libelle = trim($label);
|
$object->libelle = trim($label);
|
||||||
$object->subscription = trim($subscription);
|
$object->subscription = (int) trim($subscription);
|
||||||
$object->note = trim($comment);
|
$object->note = trim($comment);
|
||||||
$object->mail_valid = trim($mail_valid);
|
$object->mail_valid = (boolean) trim($mail_valid);
|
||||||
$object->vote = trim($vote);
|
$object->vote = (boolean) trim($vote);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
@ -251,10 +251,10 @@ if ($action == 'create')
|
|||||||
print $form->selectyesno("vote",0,1);
|
print $form->selectyesno("vote",0,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
print '<textarea name="comment" wrap="soft" class="centpercent" rows="3"></textarea></td></tr>';
|
print '<textarea name="comment" wrap="soft" class="centpercent" rows="3"></textarea></td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,'90%');
|
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,'90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
@ -314,10 +314,10 @@ if ($rowid > 0)
|
|||||||
print yn($object->vote);
|
print yn($object->vote);
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
print nl2br($object->note)."</td></tr>";
|
print nl2br($object->note)."</td></tr>";
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||||
print nl2br($object->mail_valid)."</td></tr>";
|
print nl2br($object->mail_valid)."</td></tr>";
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
@ -407,7 +407,7 @@ if ($rowid > 0)
|
|||||||
$sql.=" AND datefin < '".$db->idate($now)."'";
|
$sql.=" AND datefin < '".$db->idate($now)."'";
|
||||||
}
|
}
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -647,10 +647,10 @@ if ($rowid > 0)
|
|||||||
print $form->selectyesno("vote",$object->vote,1);
|
print $form->selectyesno("vote",$object->vote,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
print '<textarea name="comment" wrap="soft" class="centpercent" rows="3">'.$object->note.'</textarea></td></tr>';
|
print '<textarea name="comment" wrap="soft" class="centpercent" rows="3">'.$object->note.'</textarea></td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,'90%');
|
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,'90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
*
|
*
|
||||||
@ -375,7 +375,7 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
|||||||
print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").'</td>'."\n";
|
print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").'</td>'."\n";
|
||||||
print '<td align="center"> </td>'."\n";
|
print '<td align="center"> </td>'."\n";
|
||||||
print '<td align="right" class="nowrap">'."\n";
|
print '<td align="right" class="nowrap">'."\n";
|
||||||
$formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", '', 0, 1);
|
$formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", 'systemauto', 0, 1);
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -407,6 +407,37 @@ $tmplist=array('show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->tran
|
|||||||
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
|
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
|
// AGENDA NOTIFICATION
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL > 0)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'>'."\n";
|
||||||
|
print '<td>'.$langs->trans('AGENDA_NOTIFICATION').'</td>'."\n";
|
||||||
|
print '<td align="center"> </td>'."\n";
|
||||||
|
print '<td align="right">'."\n";
|
||||||
|
|
||||||
|
if (empty($conf->global->AGENDA_NOTIFICATION)) {
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_NOTIFICATION">'.img_picto($langs->trans('Disabled'),'switch_off').'</a>';
|
||||||
|
print '</td></tr>'."\n";
|
||||||
|
} else {
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_NOTIFICATION">'.img_picto($langs->trans('Enabled'),'switch_on').'</a>';
|
||||||
|
print '</td></tr>'."\n";
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'>'."\n";
|
||||||
|
print '<td>'.$langs->trans('AGENDA_NOTIFICATION_SOUND').'</td>'."\n";
|
||||||
|
print '<td align="center"> </td>'."\n";
|
||||||
|
print '<td align="right">'."\n";
|
||||||
|
|
||||||
|
if (empty($conf->global->AGENDA_NOTIFICATION_SOUND)) {
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_NOTIFICATION_SOUND">'.img_picto($langs->trans('Disabled'),'switch_off').'</a>';
|
||||||
|
} else {
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_NOTIFICATION_SOUND">'.img_picto($langs->trans('Enabled'),'switch_on').'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</td></tr>'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
@ -415,7 +446,6 @@ print '<div class="center"><input class="button" type="submit" name="save" value
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -329,7 +329,10 @@ print load_fiche_titre($langs->trans("BoxesAvailable"));
|
|||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
|
||||||
print '<input type="hidden" name="action" value="add">'."\n";
|
print '<input type="hidden" name="action" value="add">'."\n";
|
||||||
print '<table class="noborder" width="100%">'."\n";
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="tagtable liste centpercent">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="300">'.$langs->trans("Box").'</td>';
|
print '<td width="300">'.$langs->trans("Box").'</td>';
|
||||||
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
||||||
@ -375,6 +378,8 @@ foreach($boxtoadd as $box)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="right">';
|
print '<div class="right">';
|
||||||
print '<input type="submit" class="button"'.(count($boxtoadd)?'':' disabled').' value="'.$langs->trans("Activate").'">';
|
print '<input type="submit" class="button"'.(count($boxtoadd)?'':' disabled').' value="'.$langs->trans("Activate").'">';
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
@ -388,7 +393,9 @@ $boxactivated=InfoBox::listBoxes($db,'activated',-1,null);
|
|||||||
print "<br>\n\n";
|
print "<br>\n\n";
|
||||||
print load_fiche_titre($langs->trans("BoxesActivated"));
|
print load_fiche_titre($langs->trans("BoxesActivated"));
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="tagtable liste">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="300">'.$langs->trans("Box").'</td>';
|
print '<td width="300">'.$langs->trans("Box").'</td>';
|
||||||
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
||||||
@ -441,7 +448,9 @@ foreach($boxactivated as $key => $box)
|
|||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table><br>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
// Other parameters
|
// Other parameters
|
||||||
|
|||||||
@ -786,7 +786,7 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td valign="top">'.$langs->trans("Note").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '</td></tr>';
|
print '<tr '.$bc[$var].'><td class="tdtop">'.$langs->trans("Note").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
@ -952,7 +952,7 @@ else
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td valign="top">'.$langs->trans("CompanyObject").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '</td></tr>';
|
print '<tr '.$bc[$var].'><td class="tdtop">'.$langs->trans("CompanyObject").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -182,6 +182,7 @@ print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" id="action" name="action" value="">';
|
print '<input type="hidden" id="action" name="action" value="">';
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Name").'</td>';
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
@ -297,6 +298,7 @@ if ($result)
|
|||||||
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
@ -311,6 +313,7 @@ if ($conf->use_javascript_ajax)
|
|||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -112,7 +112,12 @@ $modules=array(
|
|||||||
array(
|
array(
|
||||||
'code' => 'MAIN_DELAY_EXPENSEREPORTS',
|
'code' => 'MAIN_DELAY_EXPENSEREPORTS',
|
||||||
'img' => 'trip'
|
'img' => 'trip'
|
||||||
)
|
),
|
||||||
|
/* TODO Enable this
|
||||||
|
array(
|
||||||
|
'code' => 'MAIN_DELAY_EXPENSEREPORTS_TO_PAY',
|
||||||
|
'img' => 'trip'
|
||||||
|
)*/
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -188,7 +188,7 @@ $tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX
|
|||||||
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
|
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
|
||||||
$tabsql[23]= "SELECT t.rowid as rowid, t.taux, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
|
$tabsql[23]= "SELECT t.rowid as rowid, t.taux, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
|
||||||
$tabsql[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
|
$tabsql[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
|
||||||
$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates WHERE entity IN (".getEntity('email_template',1).")";
|
$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content_lines, content, active FROM ".MAIN_DB_PREFIX."c_email_templates WHERE entity IN (".getEntity('email_template',1).")";
|
||||||
$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
||||||
$tabsql[27]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
$tabsql[27]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
||||||
$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||||
@ -262,7 +262,7 @@ $tabfield[21]= "code,label";
|
|||||||
$tabfield[22]= "code,label";
|
$tabfield[22]= "code,label";
|
||||||
$tabfield[23]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note";
|
$tabfield[23]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note";
|
||||||
$tabfield[24]= "code,label";
|
$tabfield[24]= "code,label";
|
||||||
$tabfield[25]= "label,type_template,private,position,topic,content";
|
$tabfield[25]= "label,type_template,private,position,topic,content_lines,content";
|
||||||
$tabfield[26]= "code,label,short_label";
|
$tabfield[26]= "code,label,short_label";
|
||||||
$tabfield[27]= "code,libelle";
|
$tabfield[27]= "code,libelle";
|
||||||
$tabfield[28]= "code,label,affect,delay,newbymonth,country_id,country";
|
$tabfield[28]= "code,label,affect,delay,newbymonth,country_id,country";
|
||||||
@ -299,7 +299,7 @@ $tabfieldvalue[21]= "code,label";
|
|||||||
$tabfieldvalue[22]= "code,label";
|
$tabfieldvalue[22]= "code,label";
|
||||||
$tabfieldvalue[23]= "country,taux,accountancy_code_sell,accountancy_code_buy,note";
|
$tabfieldvalue[23]= "country,taux,accountancy_code_sell,accountancy_code_buy,note";
|
||||||
$tabfieldvalue[24]= "code,label";
|
$tabfieldvalue[24]= "code,label";
|
||||||
$tabfieldvalue[25]= "label,type_template,private,position,topic,content";
|
$tabfieldvalue[25]= "label,type_template,private,position,topic,content_lines,content";
|
||||||
$tabfieldvalue[26]= "code,label,short_label";
|
$tabfieldvalue[26]= "code,label,short_label";
|
||||||
$tabfieldvalue[27]= "code,libelle";
|
$tabfieldvalue[27]= "code,libelle";
|
||||||
$tabfieldvalue[28]= "code,label,affect,delay,newbymonth,country";
|
$tabfieldvalue[28]= "code,label,affect,delay,newbymonth,country";
|
||||||
@ -336,7 +336,7 @@ $tabfieldinsert[21]= "code,label";
|
|||||||
$tabfieldinsert[22]= "code,label";
|
$tabfieldinsert[22]= "code,label";
|
||||||
$tabfieldinsert[23]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note";
|
$tabfieldinsert[23]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note";
|
||||||
$tabfieldinsert[24]= "code,label";
|
$tabfieldinsert[24]= "code,label";
|
||||||
$tabfieldinsert[25]= "label,type_template,private,position,topic,content,entity";
|
$tabfieldinsert[25]= "label,type_template,private,position,topic,content_lines,content,entity";
|
||||||
$tabfieldinsert[26]= "code,label,short_label";
|
$tabfieldinsert[26]= "code,label,short_label";
|
||||||
$tabfieldinsert[27]= "code,libelle";
|
$tabfieldinsert[27]= "code,libelle";
|
||||||
$tabfieldinsert[28]= "code,label,affect,delay,newbymonth,fk_country";
|
$tabfieldinsert[28]= "code,label,affect,delay,newbymonth,fk_country";
|
||||||
@ -449,7 +449,7 @@ $tabhelp[21] = array('code'=>$langs->trans("EnterAnyCode"));
|
|||||||
$tabhelp[22] = array('code'=>$langs->trans("EnterAnyCode"));
|
$tabhelp[22] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||||
$tabhelp[23] = array();
|
$tabhelp[23] = array();
|
||||||
$tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
|
$tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||||
$tabhelp[25] = array('topic'=>$langs->trans('SeeSubstitutionVars'),'content'=>$langs->trans('SeeSubstitutionVars'),'type_template'=>$langs->trans("TemplateForElement"),'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList"));
|
$tabhelp[25] = array('topic'=>$langs->trans('SeeSubstitutionVars'),'content'=>$langs->trans('SeeSubstitutionVars'),'content_lines'=>$langs->trans('SeeSubstitutionVars'),'type_template'=>$langs->trans("TemplateForElement"),'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||||
$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||||
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"));
|
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||||
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically"));
|
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically"));
|
||||||
@ -557,6 +557,7 @@ if ($id == 25)
|
|||||||
if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder');
|
if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder');
|
||||||
if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice');
|
if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice');
|
||||||
if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty');
|
if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty');
|
||||||
|
if ($conf->contrat->enabled) $elementList['contract']=$langs->trans('MailToSendContract');
|
||||||
|
|
||||||
$parameters=array('elementList'=>$elementList);
|
$parameters=array('elementList'=>$elementList);
|
||||||
$reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
@ -1062,6 +1063,7 @@ if ($id)
|
|||||||
if ($fieldlist[$field]=='custom_x') { $valuetoshow=$langs->trans("CustomX"); }
|
if ($fieldlist[$field]=='custom_x') { $valuetoshow=$langs->trans("CustomX"); }
|
||||||
if ($fieldlist[$field]=='custom_y') { $valuetoshow=$langs->trans("CustomY"); }
|
if ($fieldlist[$field]=='custom_y') { $valuetoshow=$langs->trans("CustomY"); }
|
||||||
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); }
|
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); }
|
||||||
|
if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); }
|
||||||
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
|
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
|
||||||
if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("Info"); }
|
if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("Info"); }
|
||||||
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
||||||
@ -1253,6 +1255,7 @@ if ($id)
|
|||||||
if ($fieldlist[$field]=='custom_x') { $valuetoshow=$langs->trans("CustomX"); }
|
if ($fieldlist[$field]=='custom_x') { $valuetoshow=$langs->trans("CustomX"); }
|
||||||
if ($fieldlist[$field]=='custom_y') { $valuetoshow=$langs->trans("CustomY"); }
|
if ($fieldlist[$field]=='custom_y') { $valuetoshow=$langs->trans("CustomY"); }
|
||||||
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); }
|
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); }
|
||||||
|
if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); }
|
||||||
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
|
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
|
||||||
if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("Info"); }
|
if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("Info"); }
|
||||||
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
||||||
@ -1274,6 +1277,7 @@ if ($id)
|
|||||||
|
|
||||||
// Title line with search boxes
|
// Title line with search boxes
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
$filterfound=0;
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value)
|
||||||
{
|
{
|
||||||
$showfield=1; // By defaut
|
$showfield=1; // By defaut
|
||||||
@ -1284,21 +1288,25 @@ if ($id)
|
|||||||
{
|
{
|
||||||
if ($value == 'country')
|
if ($value == 'country')
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
$filterfound++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($id == 4) print '<td></td>';
|
if ($id == 4) print '<td></td>';
|
||||||
print '<td></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre" colspan="2" align="right">';
|
print '<td class="liste_titre" colspan="2" align="right">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
if ($filterfound)
|
||||||
print $searchpitco;
|
{
|
||||||
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
|
print $searchpitco;
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -1314,19 +1322,17 @@ if ($id)
|
|||||||
print '<tr '.$bc[$var].' id="rowid-'.$obj->rowid.'">';
|
print '<tr '.$bc[$var].' id="rowid-'.$obj->rowid.'">';
|
||||||
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
|
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
|
||||||
{
|
{
|
||||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
|
||||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
|
||||||
|
|
||||||
$tmpaction='edit';
|
$tmpaction='edit';
|
||||||
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||||
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||||
|
|
||||||
|
// Show fields
|
||||||
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
|
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
|
||||||
|
|
||||||
print '<td colspan="3" align="center">';
|
print '<td colspan="3" align="center">';
|
||||||
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||||
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||||
print '<div name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'"></div>';
|
print '<div name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'"></div>';
|
||||||
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
||||||
@ -1767,6 +1773,24 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
|||||||
elseif (in_array($fieldlist[$field], array('libelle_facture'))) {
|
elseif (in_array($fieldlist[$field], array('libelle_facture'))) {
|
||||||
print '<td><textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea></td>';
|
print '<td><textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea></td>';
|
||||||
}
|
}
|
||||||
|
elseif (in_array($fieldlist[$field], array('content_lines')))
|
||||||
|
{
|
||||||
|
if ($tabname == MAIN_DB_PREFIX.'c_email_templates')
|
||||||
|
{
|
||||||
|
print '<td colspan="4"></td></tr><tr class="pair nohover"><td colspan="5">'; // To create an artificial CR for the current tr we are on
|
||||||
|
}
|
||||||
|
else print '<td>';
|
||||||
|
if ($context != 'hide')
|
||||||
|
{
|
||||||
|
//print '<input type="text" size="100" class="flat" value="'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
|
||||||
|
$okforextended=true;
|
||||||
|
if ($tabname == MAIN_DB_PREFIX.'c_email_templates' && empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended=false;
|
||||||
|
$doleditor = new DolEditor($fieldlist[$field], (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), '', 100, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_1, '90%');
|
||||||
|
print $doleditor->Create(1);
|
||||||
|
}
|
||||||
|
else print ' ';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
elseif (in_array($fieldlist[$field], array('content')))
|
elseif (in_array($fieldlist[$field], array('content')))
|
||||||
{
|
{
|
||||||
if ($tabname == MAIN_DB_PREFIX.'c_email_templates')
|
if ($tabname == MAIN_DB_PREFIX.'c_email_templates')
|
||||||
@ -1779,7 +1803,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
|||||||
//print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
|
//print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
|
||||||
$okforextended=true;
|
$okforextended=true;
|
||||||
if ($tabname == MAIN_DB_PREFIX.'c_email_templates' && empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended=false;
|
if ($tabname == MAIN_DB_PREFIX.'c_email_templates' && empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended=false;
|
||||||
$doleditor = new DolEditor($fieldlist[$field], (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_5, '90%');
|
$doleditor = new DolEditor($fieldlist[$field], (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_8, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
}
|
}
|
||||||
else print ' ';
|
else print ' ';
|
||||||
|
|||||||
@ -404,7 +404,7 @@ if ($action == 'edit')
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
$liste = array();
|
$liste = array();
|
||||||
$liste['user'] = $langs->trans('UserEmail');
|
$liste['user'] = $langs->trans('UserEmail');
|
||||||
$liste['company'] = $langs->trans('CompanyEmail');
|
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?$langs->trans("NotDefined"):$conf->global->MAIN_INFO_SOCIETE_MAIL).')';
|
||||||
|
|
||||||
print '<tr '.$bc[$var?1:0].'><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td><td>';
|
print '<tr '.$bc[$var?1:0].'><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td><td>';
|
||||||
print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE',$liste,$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE,0);
|
print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE',$liste,$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE,0);
|
||||||
@ -619,6 +619,12 @@ else
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||||
|
{
|
||||||
|
$text = $langs->trans("WarningPHPMail");
|
||||||
|
print info_admin($text);
|
||||||
|
}
|
||||||
|
|
||||||
// Run the test to connect
|
// Run the test to connect
|
||||||
if ($action == 'testconnect')
|
if ($action == 'testconnect')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -203,7 +203,7 @@ foreach ($modulesdir as $dir)
|
|||||||
}
|
}
|
||||||
ksort($arrayofnatures);
|
ksort($arrayofnatures);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define array $categ with categ with at least one qualified module
|
// Define array $categ with categ with at least one qualified module
|
||||||
if ($modulequalified > 0)
|
if ($modulequalified > 0)
|
||||||
{
|
{
|
||||||
@ -319,7 +319,7 @@ if ($mode != 'marketplace')
|
|||||||
$moreforfilter.= $langs->trans('Keyword') . ': <input type="text" name="search_keyword" value="'.dol_escape_htmltag($search_keyword).'">';
|
$moreforfilter.= $langs->trans('Keyword') . ': <input type="text" name="search_keyword" value="'.dol_escape_htmltag($search_keyword).'">';
|
||||||
$moreforfilter.= '</div>';
|
$moreforfilter.= '</div>';
|
||||||
$moreforfilter.='<div class="divsearchfield">';
|
$moreforfilter.='<div class="divsearchfield">';
|
||||||
$moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, $search_nature, 1);
|
$moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1);
|
||||||
$moreforfilter.= '</div>';
|
$moreforfilter.= '</div>';
|
||||||
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||||
{
|
{
|
||||||
@ -398,7 +398,7 @@ if ($mode != 'marketplace')
|
|||||||
if ($search_keyword)
|
if ($search_keyword)
|
||||||
{
|
{
|
||||||
$qualified=0;
|
$qualified=0;
|
||||||
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
|
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
|
||||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc)
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc)
|
||||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong)
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong)
|
||||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor)
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor)
|
||||||
@ -417,7 +417,7 @@ if ($mode != 'marketplace')
|
|||||||
{
|
{
|
||||||
//print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher());
|
//print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher());
|
||||||
$publisher=dol_escape_htmltag($objMod->getPublisher());
|
$publisher=dol_escape_htmltag($objMod->getPublisher());
|
||||||
if ($reg[1] && $reg[1] != $publisher) continue;
|
if ($reg[1] && dol_escape_htmltag($reg[1]) != $publisher) continue;
|
||||||
if (! $reg[1] && ! empty($publisher)) continue;
|
if (! $reg[1] && ! empty($publisher)) continue;
|
||||||
}
|
}
|
||||||
if ($search_nature == 'core' && $objMod->isCoreOrExternalModule() == 'external') continue;
|
if ($search_nature == 'core' && $objMod->isCoreOrExternalModule() == 'external') continue;
|
||||||
@ -485,22 +485,23 @@ if ($mode != 'marketplace')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
print '<td valign="top">'.$objMod->getName();
|
print '<td class="tdtop">'.$objMod->getName();
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Desc
|
// Desc
|
||||||
print '<td valign="top">';
|
print '<td class="tdtop">';
|
||||||
print nl2br($objMod->getDesc());
|
print nl2br($objMod->getDesc());
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Help
|
// Help
|
||||||
print '<td align="center" valign="top" class="nowrap" style="width: 82px;">';
|
print '<td align="center" valign="top" class="nowrap" style="width: 82px;">';
|
||||||
$text='';
|
$text='';
|
||||||
|
|
||||||
if ($objMod->getDescLong()) $text.='<div class="titre">'.$objMod->getDesc().'</div><br>'.$objMod->getDescLong().'<br>';
|
if ($objMod->getDescLong()) $text.='<div class="titre">'.$objMod->getDesc().'</div><br>'.$objMod->getDescLong().'<br>';
|
||||||
else $text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
|
else $text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
|
||||||
|
|
||||||
$textexternal='';
|
$textexternal='';
|
||||||
$imginfo="info";
|
$imginfo="info";
|
||||||
if ($objMod->isCoreOrExternalModule() == 'external')
|
if ($objMod->isCoreOrExternalModule() == 'external')
|
||||||
{
|
{
|
||||||
$imginfo="info_black";
|
$imginfo="info_black";
|
||||||
@ -647,6 +648,7 @@ if ($mode != 'marketplace')
|
|||||||
$text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
|
||||||
$text.=$langs->trans("DetectionNotPossible");
|
$text.=$langs->trans("DetectionNotPossible");
|
||||||
|
|
||||||
|
|
||||||
print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20');
|
print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20');
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -183,20 +183,19 @@ print '<td>'.$langs->trans("Parameters").'</td>'."\n";
|
|||||||
print '<td align="center" width="20"> </td>';
|
print '<td align="center" width="20"> </td>';
|
||||||
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
|
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
|
||||||
|
|
||||||
/* TODO uncomment when the functionality will integrated
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_useRateOnInvoiceDate").'</td>';
|
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_useRateOnDocumentDate").'</td>';
|
||||||
print '<td align="center" width="20"> </td>';
|
print '<td align="center" width="20"> </td>';
|
||||||
print '<td align="right" width="400">';
|
print '<td align="right" width="400">';
|
||||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="set_MULTICURRENCY_USE_RATE_ON_INVOICE_DATE">';
|
print '<input type="hidden" name="action" value="set_MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE">';
|
||||||
print $form->selectyesno("MULTICURRENCY_USE_RATE_ON_INVOICE_DATE",$conf->global->MULTICURRENCY_USE_RATE_ON_INVOICE_DATE,1);
|
print $form->selectyesno("MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE",$conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE,1);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
*/
|
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
|
|||||||
@ -104,6 +104,11 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Define $urlwithroot
|
||||||
|
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||||
|
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||||
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
llxHeader('',$langs->trans("PrintingSetup"));
|
llxHeader('',$langs->trans("PrintingSetup"));
|
||||||
@ -127,70 +132,179 @@ if ($mode == 'setup' && $user->admin)
|
|||||||
if (in_array($key[0], array_keys($supportedoauth2array))) $supported=1;
|
if (in_array($key[0], array_keys($supportedoauth2array))) $supported=1;
|
||||||
if (! $supported) continue; // show only supported
|
if (! $supported) continue; // show only supported
|
||||||
|
|
||||||
|
|
||||||
|
$OAUTH_SERVICENAME='Unknown';
|
||||||
|
if ($key[0] == 'OAUTH_GITHUB_NAME')
|
||||||
|
{
|
||||||
|
$OAUTH_SERVICENAME='GitHub';
|
||||||
|
$urltorenew=$urlwithroot.'/core/modules/oauth/github_oauthcallback.php?state=user,public_repo&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
|
$urltodelete=$urlwithroot.'/core/modules/oauth/github_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
|
$urltocheckperms='https://github.com/settings/applications/';
|
||||||
|
}
|
||||||
|
if ($key[0] == 'OAUTH_GOOGLE_NAME')
|
||||||
|
{
|
||||||
|
$OAUTH_SERVICENAME='Google';
|
||||||
|
$urltorenew=$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?state=userinfo_email,userinfo_profile,cloud_print&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
|
$urltodelete=$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
|
$urltocheckperms='https://security.google.com/settings/security/permissions';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show value of token
|
||||||
|
$tokenobj=null;
|
||||||
|
// Token
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
|
||||||
|
// Dolibarr storage
|
||||||
|
$storage = new DoliStorage($db, $conf);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME);
|
||||||
|
}
|
||||||
|
catch(Exception $e)
|
||||||
|
{
|
||||||
|
// Return an error if token not found
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set other properties
|
||||||
|
$refreshtoken=false;
|
||||||
|
$expiredat='';
|
||||||
|
|
||||||
|
$expire = false;
|
||||||
|
// Is token expired or will token expire in the next 30 seconds
|
||||||
|
if (is_object($tokenobj)) {
|
||||||
|
$expire = ($tokenobj->getEndOfLife() !== $tokenobj::EOL_NEVER_EXPIRES && $tokenobj->getEndOfLife() !== $tokenobj::EOL_UNKNOWN && time() > ($tokenobj->getEndOfLife() - 30));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($key[1] != '' && $key[2] != '') {
|
||||||
|
if (is_object($tokenobj)) {
|
||||||
|
$refreshtoken = $tokenobj->getRefreshToken();
|
||||||
|
|
||||||
|
$endoflife = $tokenobj->getEndOfLife();
|
||||||
|
if ($endoflife == $tokenobj::EOL_NEVER_EXPIRES)
|
||||||
|
{
|
||||||
|
$expiredat = $langs->trans("Never");
|
||||||
|
}
|
||||||
|
elseif ($endoflife == $tokenobj::EOL_UNKNOWN)
|
||||||
|
{
|
||||||
|
$expiredat = $langs->trans("Unknown");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$expiredat=dol_print_date($endoflife, "dayhour");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$submit_enabled=0;
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=setup&driver='.$driver.'" autocomplete="off">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=setup&driver='.$driver.'" autocomplete="off">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="setconst">';
|
print '<input type="hidden" name="action" value="setconst">';
|
||||||
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">'."\n";
|
print '<table class="noborder" width="100%">'."\n";
|
||||||
$var=true;
|
|
||||||
|
$var=false;
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th>'.$langs->trans("Parameters").'</th>';
|
print '<th class="titlefieldcreate">'.$langs->trans($key[0]).'</th>';
|
||||||
print '<th>'.$langs->trans("Value").'</th>';
|
print '<th></th>';
|
||||||
print '<th> </th>';
|
print '<th></th>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$submit_enabled=0;
|
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td'.($key['required']?' class=required':'').'>'.$langs->trans($key['varname']).'</td>';
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
print '<td>'.$langs->trans($key['info']).'</td>';
|
//var_dump($key);
|
||||||
|
print $langs->trans("OAuthIDSecret").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $langs->trans("SeePreviousTab");
|
||||||
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($key['varname'] == 'PRINTGCP_TOKEN_ACCESS')
|
|
||||||
{
|
|
||||||
// Delete remote tokens
|
|
||||||
if (! empty($key['delete'])) print '<a class="button" href="'.$key['delete'].'">'.$langs->trans('DeleteAccess').'</a><br><br>';
|
|
||||||
// Request remote token
|
|
||||||
print '<a class="button" href="'.$key['renew'].'">'.$langs->trans('RequestAccess').'</a><br><br>';
|
|
||||||
// Check remote access
|
|
||||||
print $langs->trans("ToCheckDeleteTokenOnProvider", $OAUTH_SERVICENAME_GOOGLE).': <a href="https://security.google.com/settings/security/permissions" target="_google">https://security.google.com/settings/security/permissions</a>';
|
|
||||||
}
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
// Show value of token
|
$var = ! $var;
|
||||||
if ($key['varname'] == 'PRINTGCP_TOKEN_ACCESS')
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("IsTokenGenerated");
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
if (is_object($tokenobj)) print $langs->trans("HasAccessToken");
|
||||||
|
else print $langs->trans("NoAccessToken");
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
// Links to delete/checks token
|
||||||
|
if (is_object($tokenobj))
|
||||||
{
|
{
|
||||||
// Token
|
//test on $storage->hasAccessToken($OAUTH_SERVICENAME) ?
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<a class="button" href="'.$urltodelete.'">'.$langs->trans('DeleteAccess').'</a><br><br>';
|
||||||
print '<td>'.$langs->trans("Token").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
// Dolibarr storage
|
|
||||||
$storage = new DoliStorage($db, $conf);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME_GOOGLE);
|
|
||||||
}
|
|
||||||
catch(Exception $e)
|
|
||||||
{
|
|
||||||
// Return an error if token not found
|
|
||||||
}
|
|
||||||
if (is_object($tokenobj))
|
|
||||||
{
|
|
||||||
//var_dump($tokenobj);
|
|
||||||
print $tokenobj->getAccessToken().'<br>';
|
|
||||||
//print 'Refresh: '.$tokenobj->getRefreshToken().'<br>';
|
|
||||||
//print 'EndOfLife: '.$tokenobj->getEndOfLife().'<br>';
|
|
||||||
//var_dump($tokenobj->getExtraParams());
|
|
||||||
/*print '<br>Extra: <br><textarea class="quatrevingtpercent">';
|
|
||||||
print ''.join(',',$tokenobj->getExtraParams());
|
|
||||||
print '</textarea>';*/
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>'."\n";
|
|
||||||
}
|
}
|
||||||
|
// Request remote token
|
||||||
|
print '<a class="button" href="'.$urltorenew.'">'.$langs->trans('RequestAccess').'</a><br><br>';
|
||||||
|
// Check remote access
|
||||||
|
if ($urltocheckperms)
|
||||||
|
{
|
||||||
|
print $langs->trans("ToCheckDeleteTokenOnProvider", $OAUTH_SERVICENAME).': <a href="'.$urltocheckperms.'" target="_'.strtolower($OAUTH_SERVICENAME).'">'.$urltocheckperms.'</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("Token").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
if (is_object($tokenobj))
|
||||||
|
{
|
||||||
|
//var_dump($tokenobj);
|
||||||
|
print $tokenobj->getAccessToken().'<br>';
|
||||||
|
//print 'Refresh: '.$tokenobj->getRefreshToken().'<br>';
|
||||||
|
//print 'EndOfLife: '.$tokenobj->getEndOfLife().'<br>';
|
||||||
|
//var_dump($tokenobj->getExtraParams());
|
||||||
|
/*print '<br>Extra: <br><textarea class="quatrevingtpercent">';
|
||||||
|
print ''.join(',',$tokenobj->getExtraParams());
|
||||||
|
print '</textarea>';*/
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
if (is_object($tokenobj))
|
||||||
|
{
|
||||||
|
// Token refresh
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("TOKEN_REFRESH").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print yn($refreshtoken);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Token expired
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("TOKEN_EXPIRED").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print yn($expire);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Token expired at
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("TOKEN_EXPIRE_AT").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print $expiredat;
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
if (! empty($driver))
|
if (! empty($driver))
|
||||||
@ -199,7 +313,8 @@ if ($mode == 'setup' && $user->admin)
|
|||||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Modify")).'"></div>';
|
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Modify")).'"></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -124,7 +124,7 @@ dol_fiche_head($head, 'default', $langs->trans("Security"));
|
|||||||
// Show warning about external users
|
// Show warning about external users
|
||||||
print info_admin(showModulesExludedForExternal($modules)).'<br>'."\n";
|
print info_admin(showModulesExludedForExternal($modules)).'<br>'."\n";
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
// Affiche lignes des permissions
|
// Affiche lignes des permissions
|
||||||
@ -215,8 +215,9 @@ if ($result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -86,12 +86,12 @@ if ($sfurl)
|
|||||||
}
|
}
|
||||||
print ')';
|
print ')';
|
||||||
}
|
}
|
||||||
print ' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b><br>';
|
print ' ('.$langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b>)<br>';
|
||||||
}
|
}
|
||||||
|
print ' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
|
||||||
|
|
||||||
|
|
||||||
print '</ul>';
|
print '</ul>';
|
||||||
|
|||||||
@ -48,6 +48,7 @@ $tmp=getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);
|
|||||||
|
|
||||||
// Browser
|
// Browser
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -71,10 +72,10 @@ print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("Screen").'</td><td col
|
|||||||
print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
|
print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -81,7 +81,8 @@ else
|
|||||||
{
|
{
|
||||||
if ($base == 1)
|
if ($base == 1)
|
||||||
{
|
{
|
||||||
print '<table class="noborder">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TableName").'</td>';
|
print '<td>'.$langs->trans("TableName").'</td>';
|
||||||
print '<td colspan="2">'.$langs->trans("Type").'</td>';
|
print '<td colspan="2">'.$langs->trans("Type").'</td>';
|
||||||
@ -134,11 +135,13 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($base == 2)
|
if ($base == 2)
|
||||||
{
|
{
|
||||||
print '<table class="noborder">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TableName").'</td>';
|
print '<td>'.$langs->trans("TableName").'</td>';
|
||||||
print '<td>Nb of tuples</td>';
|
print '<td>Nb of tuples</td>';
|
||||||
@ -173,12 +176,14 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($base == 4)
|
if ($base == 4)
|
||||||
{
|
{
|
||||||
// Sqlite by PDO or by Sqlite3
|
// Sqlite by PDO or by Sqlite3
|
||||||
print '<table class="noborder">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TableName").'</td>';
|
print '<td>'.$langs->trans("TableName").'</td>';
|
||||||
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
||||||
@ -207,6 +212,8 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,7 @@ llxHeader();
|
|||||||
print load_fiche_titre($langs->trans("InfoDatabase"),'','title_setup');
|
print load_fiche_titre($langs->trans("InfoDatabase"),'','title_setup');
|
||||||
|
|
||||||
// Database
|
// Database
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Database").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Database").'</td></tr>'."\n";
|
||||||
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Version").'</td><td>'.$db::LABEL.' '.$db->getVersion().'</td></tr>'."\n";
|
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Version").'</td><td>'.$db::LABEL.' '.$db->getVersion().'</td></tr>'."\n";
|
||||||
@ -54,14 +55,16 @@ print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Password").'</td><td>'.pr
|
|||||||
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase().'</td></tr>'."\n";
|
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase().'</td></tr>'."\n";
|
||||||
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase().'</td></tr>'."\n";
|
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase().'</td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
// Tables
|
// Tables
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Tables").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Tables").'</td></tr>'."\n";
|
||||||
print '<tr '.$bc[0].'><td width="300"><a href="'.DOL_URL_ROOT.'/admin/system/database-tables.php?mainmenu=home">'.$langs->trans("List").'</a></td></tr>'."\n";
|
print '<tr '.$bc[0].'><td width="300"><a href="'.DOL_URL_ROOT.'/admin/system/database-tables.php?mainmenu=home">'.$langs->trans("List").'</a></td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
$listofvars=$db->getServerParametersValues();
|
$listofvars=$db->getServerParametersValues();
|
||||||
$listofstatus=$db->getServerStatusValues();
|
$listofstatus=$db->getServerStatusValues();
|
||||||
@ -76,6 +79,7 @@ else
|
|||||||
foreach($arraylist as $listname)
|
foreach($arraylist as $listname)
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="300">'.$langs->trans("Parameters").'</td>';
|
print '<td width="300">'.$langs->trans("Parameters").'</td>';
|
||||||
@ -120,6 +124,7 @@ else
|
|||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,7 @@ print load_fiche_titre($title,'','title_setup');
|
|||||||
|
|
||||||
// Version
|
// Version
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -69,10 +70,12 @@ else
|
|||||||
}
|
}
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Session
|
// Session
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -107,6 +110,7 @@ foreach($_SESSION as $key => $val)
|
|||||||
}
|
}
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
@ -116,6 +120,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
|||||||
$shmoparray=dol_listshmop();
|
$shmoparray=dol_listshmop();
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="titlefield">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
|
print '<td class="titlefield">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
|
||||||
@ -133,12 +138,14 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Localisation
|
// Localisation
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -234,6 +241,7 @@ if (! empty($conf->global->MAIN_FILESYSTEM_ENCODING)) $tmp=$conf->global->MAIN_F
|
|||||||
print '<tr '.$bc[$var].'><td> => '.$langs->trans("File encoding").'</td><td>'.$tmp.'</td></tr>'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
|
print '<tr '.$bc[$var].'><td> => '.$langs->trans("File encoding").'</td><td>'.$tmp.'</td></tr>'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
@ -292,6 +300,7 @@ $configfileparameters=array(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="titlefield">'.$langs->trans("Parameters").' ';
|
print '<td class="titlefield">'.$langs->trans("Parameters").' ';
|
||||||
@ -353,11 +362,13 @@ foreach($configfileparameters as $key => $value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Parameters in database
|
// Parameters in database
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
|
print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
|
||||||
@ -407,7 +418,7 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -75,33 +75,40 @@ $file_list = array('missing' => array(), 'updated' => array());
|
|||||||
|
|
||||||
// File to analyze
|
// File to analyze
|
||||||
//$xmlfile = DOL_DOCUMENT_ROOT.'/install/filelist-'.DOL_VERSION.'.xml';
|
//$xmlfile = DOL_DOCUMENT_ROOT.'/install/filelist-'.DOL_VERSION.'.xml';
|
||||||
$xmlshortfile = '/install/filelist-'.DOL_VERSION.'.xml';
|
$xmlshortfile = GETPOST('xmlshortfile')?GETPOST('xmlshortfile'):'/install/filelist-'.DOL_VERSION.'.xml';
|
||||||
$xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile;
|
$xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile;
|
||||||
$xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
|
$xmlremote = GETPOST('xmlremote')?GETPOST('xmlremote'):'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
|
||||||
|
|
||||||
|
|
||||||
// Test if remote test is ok
|
// Test if remote test is ok
|
||||||
$enableremotecheck = True;
|
$enableremotecheck = True;
|
||||||
if (preg_match('/beta|alpha/i', DOL_VERSION)) $enableremotecheck=False;
|
if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=False;
|
||||||
|
$enableremotecheck = true;
|
||||||
|
|
||||||
print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
|
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
|
||||||
|
print '<!-- for a local check target=local&xmlshortfile=... -->'."\n";
|
||||||
if (dol_is_file($xmlfile))
|
if (dol_is_file($xmlfile))
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="local"'.((! GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"':'').'"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.'<br>';
|
print '<input type="radio" name="target" value="local"'.((! GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"':'').'"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.'<br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span><br>';
|
print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile;
|
||||||
|
if (! GETPOST('xmlshortfile')) print ' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span>';
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
|
||||||
if ($enableremotecheck)
|
if ($enableremotecheck)
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = '.$xmlremote.'<br>';
|
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = ';
|
||||||
|
print '<input name="xmlremote" class="flat quatrevingtpercent" value="'.$xmlremote.'"><br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote.' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span><br>';
|
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote;
|
||||||
|
if (! GETPOST('xmlremote')) print ' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span>';
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
print '<br><div class="center"><input type="submit" name="check" class="button" value="'.$langs->trans("Check").'"></div>';
|
print '<br><div class="center"><input type="submit" name="check" class="button" value="'.$langs->trans("Check").'"></div>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -128,7 +135,8 @@ if (GETPOST('target') == 'remote')
|
|||||||
if (! $xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404')
|
if (! $xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404')
|
||||||
{
|
{
|
||||||
$xmlfile = $xmlarray['content'];
|
$xmlfile = $xmlarray['content'];
|
||||||
$xml = simplexml_load_file($xmlfile);
|
//print "eee".$xmlfile."eee";
|
||||||
|
$xml = simplexml_load_string($xmlfile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -141,24 +149,33 @@ if (GETPOST('target') == 'remote')
|
|||||||
|
|
||||||
if ($xml)
|
if ($xml)
|
||||||
{
|
{
|
||||||
|
$checksumconcat = array();
|
||||||
|
|
||||||
|
// Scan htdocs
|
||||||
if (is_object($xml->dolibarr_htdocs_dir[0]))
|
if (is_object($xml->dolibarr_htdocs_dir[0]))
|
||||||
{
|
{
|
||||||
$file_list = array();
|
$file_list = array();
|
||||||
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0]); // Fill array $file_list
|
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', DOL_DOCUMENT_ROOT, $checksumconcat); // Fill array $file_list
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("FilesMissing"));
|
||||||
|
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>' . $langs->trans("FilesMissing") . '</td>';
|
print '<td>#</td>';
|
||||||
|
print '<td>' . $langs->trans("Filename") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
$var = true;
|
$var = true;
|
||||||
$tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
|
$tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
|
||||||
if (is_array($tmpfilelist) && count($tmpfilelist))
|
if (is_array($tmpfilelist) && count($tmpfilelist))
|
||||||
{
|
{
|
||||||
|
$i = 0;
|
||||||
foreach ($tmpfilelist as $file)
|
foreach ($tmpfilelist as $file)
|
||||||
{
|
{
|
||||||
|
$i++;
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
print '<tr ' . $bc[$var] . '>';
|
print '<tr ' . $bc[$var] . '>';
|
||||||
|
print '<td>'.$i.'</td>' . "\n";
|
||||||
print '<td>'.$file['filename'].'</td>' . "\n";
|
print '<td>'.$file['filename'].'</td>' . "\n";
|
||||||
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -166,28 +183,34 @@ if ($xml)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr ' . $bc[false] . '><td colspan="2" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
print '<tr ' . $bc[false] . '><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("FilesUpdated"));
|
||||||
|
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>' . $langs->trans("FilesUpdated") . '</td>';
|
print '<td>#</td>';
|
||||||
|
print '<td>' . $langs->trans("Filename") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("CurrentChecksum") . '</td>';
|
print '<td align="center">' . $langs->trans("CurrentChecksum") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("Size") . '</td>';
|
print '<td align="right">' . $langs->trans("Size") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("DateModification") . '</td>';
|
print '<td align="right">' . $langs->trans("DateModification") . '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
$var = true;
|
$var = true;
|
||||||
$tmpfilelist = dol_sort_array($file_list['updated'], 'filename');
|
$tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename');
|
||||||
if (is_array($tmpfilelist) && count($tmpfilelist))
|
if (is_array($tmpfilelist2) && count($tmpfilelist2))
|
||||||
{
|
{
|
||||||
foreach ($tmpfilelist as $file)
|
$i = 0;
|
||||||
|
foreach ($tmpfilelist2 as $file)
|
||||||
{
|
{
|
||||||
|
$i++;
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
print '<tr ' . $bc[$var] . '>';
|
print '<tr ' . $bc[$var] . '>';
|
||||||
|
print '<td>'.$i.'</td>' . "\n";
|
||||||
print '<td>'.$file['filename'].'</td>' . "\n";
|
print '<td>'.$file['filename'].'</td>' . "\n";
|
||||||
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
||||||
print '<td align="center">'.$file['md5'].'</td>' . "\n";
|
print '<td align="center">'.$file['md5'].'</td>' . "\n";
|
||||||
@ -201,12 +224,42 @@ if ($xml)
|
|||||||
print '<tr ' . $bc[false] . '><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
print '<tr ' . $bc[false] . '><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
if (empty($tmpfilelist) && empty($tmpfilelist2))
|
||||||
|
{
|
||||||
|
setEventMessage($langs->trans("FileIntegrityIsStrictlyConformedWithReference"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessage($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), 'warnings');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile;
|
print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Scan scripts
|
||||||
|
/*
|
||||||
|
if (is_object($xml->dolibarr_script_dir[0]))
|
||||||
|
{
|
||||||
|
$file_list = array();
|
||||||
|
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', ???, $checksumconcat); // Fill array $file_list
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
asort($checksumconcat); // Sort list of checksum
|
||||||
|
//var_dump($checksumconcat);
|
||||||
|
$checksumget = md5(join(',',$checksumconcat));
|
||||||
|
$checksumtoget = $xml->dolibarr_htdocs_dir_checksum;
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("GlobalChecksum")).'<br>';
|
||||||
|
print $langs->trans("ExpectedChecksum").' = '. ($checksumtoget ? $checksumtoget : $langs->trans("Unknown")) .'<br>';
|
||||||
|
print $langs->trans("CurrentChecksum").' = '.$checksumget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -223,12 +276,14 @@ exit($error);
|
|||||||
* Function to get list of updated or modified files.
|
* Function to get list of updated or modified files.
|
||||||
* $file_list is used as global variable
|
* $file_list is used as global variable
|
||||||
*
|
*
|
||||||
* @param array $file_list Array for response
|
* @param array $file_list Array for response
|
||||||
* @param SimpleXMLElement $dir SimpleXMLElement of files to test
|
* @param SimpleXMLElement $dir SimpleXMLElement of files to test
|
||||||
* @param string $path Path of file
|
* @param string $path Path of files relative to $pathref. We start with ''. Used by recursive calls.
|
||||||
* @return array Array of filenames
|
* @param string $pathref Path ref (DOL_DOCUMENT_ROOT)
|
||||||
|
* @param array $checksumconcat Array of checksum
|
||||||
|
* @return array Array of filenames
|
||||||
*/
|
*/
|
||||||
function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '')
|
function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathref = '', &$checksumconcat = array())
|
||||||
{
|
{
|
||||||
$exclude = 'install';
|
$exclude = 'install';
|
||||||
|
|
||||||
@ -236,20 +291,21 @@ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '')
|
|||||||
{
|
{
|
||||||
$filename = $path.$file['name'];
|
$filename = $path.$file['name'];
|
||||||
|
|
||||||
if (preg_match('#'.$exclude.'#', $filename)) continue;
|
//if (preg_match('#'.$exclude.'#', $filename)) continue;
|
||||||
|
|
||||||
if (!file_exists(DOL_DOCUMENT_ROOT.'/'.$filename))
|
if (!file_exists($pathref.'/'.$filename))
|
||||||
{
|
{
|
||||||
$file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file);
|
$file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$md5_local = md5_file(DOL_DOCUMENT_ROOT.'/'.$filename);
|
$md5_local = md5_file($pathref.'/'.$filename);
|
||||||
if ($md5_local != (string) $file) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file, 'md5'=>(string) $md5_local);
|
if ($md5_local != (string) $file) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file, 'md5'=>(string) $md5_local);
|
||||||
}
|
$checksumconcat[] = $md5_local;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($dir->dir as $subdir) getFilesUpdated($file_list, $subdir, $path.$subdir['name'].'/');
|
foreach ($dir->dir as $subdir) getFilesUpdated($file_list, $subdir, $path.$subdir['name'].'/', $pathref, $checksumconcat);
|
||||||
|
|
||||||
return $file_list;
|
return $file_list;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,6 +102,8 @@ foreach($modulesdir as $dir)
|
|||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Modules").'</td>';
|
print '<td>'.$langs->trans("Modules").'</td>';
|
||||||
@ -148,6 +150,7 @@ foreach($sortorder as $numero=>$name)
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
sort($rights_ids);
|
sort($rights_ids);
|
||||||
$old='';
|
$old='';
|
||||||
|
|||||||
@ -68,8 +68,8 @@ print '<br>';
|
|||||||
$phparray=phpinfo_array();
|
$phparray=phpinfo_array();
|
||||||
foreach($phparray as $key => $value)
|
foreach($phparray as $key => $value)
|
||||||
{
|
{
|
||||||
//print load_fiche_titre($key);
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
//print '<td width="220px">'.$langs->trans("Parameter").'</td>';
|
//print '<td width="220px">'.$langs->trans("Parameter").'</td>';
|
||||||
print '<td width="220px">'.$key.'</td>';
|
print '<td width="220px">'.$key.'</td>';
|
||||||
@ -114,7 +114,9 @@ foreach($phparray as $key => $value)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</table><br>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -145,7 +145,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
|
|||||||
?>
|
?>
|
||||||
<table class="centpercent">
|
<table class="centpercent">
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">
|
<td class="tdtop">
|
||||||
|
|
||||||
<div id="div_container_exportoptions">
|
<div id="div_container_exportoptions">
|
||||||
<fieldset id="exportoptions"><legend><?php echo $langs->trans("ExportMethod"); ?></legend>
|
<fieldset id="exportoptions"><legend><?php echo $langs->trans("ExportMethod"); ?></legend>
|
||||||
@ -179,7 +179,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td valign="top">
|
<td class="tdtop">
|
||||||
|
|
||||||
|
|
||||||
<div id="div_container_sub_exportoptions">
|
<div id="div_container_sub_exportoptions">
|
||||||
|
|||||||
@ -86,7 +86,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
|
|||||||
|
|
||||||
<?php print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b>'; ?><br><br>
|
<?php print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b>'; ?><br><br>
|
||||||
|
|
||||||
<table><tr><td valign="top">
|
<table><tr><td class="tdtop">
|
||||||
|
|
||||||
<?php if ($conf->use_javascript_ajax) { ?>
|
<?php if ($conf->use_javascript_ajax) { ?>
|
||||||
<div id="div_container_exportoptions">
|
<div id="div_container_exportoptions">
|
||||||
@ -120,7 +120,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
|
|||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</td><td valign="top">
|
</td><td class="tdtop">
|
||||||
|
|
||||||
|
|
||||||
<div id="div_container_sub_exportoptions">
|
<div id="div_container_sub_exportoptions">
|
||||||
|
|||||||
@ -174,6 +174,15 @@ if ($search_user) { $usefilter++; $sql.=natural_search("u.login", $search_user,
|
|||||||
if ($search_desc) { $usefilter++; $sql.=natural_search("e.description", $search_desc, 0); }
|
if ($search_desc) { $usefilter++; $sql.=natural_search("e.description", $search_desc, 0); }
|
||||||
if ($search_ua) { $usefilter++; $sql.=natural_search("e.user_agent", $search_ua, 0); }
|
if ($search_ua) { $usefilter++; $sql.=natural_search("e.user_agent", $search_ua, 0); }
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
|
// Count total nb of records
|
||||||
|
$nbtotalofrecords = '';
|
||||||
|
/*if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
|
{
|
||||||
|
$result = $db->query($sql);
|
||||||
|
$nbtotalofrecords = $db->num_rows($result);
|
||||||
|
}*/
|
||||||
|
|
||||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -195,7 +204,7 @@ if ($result)
|
|||||||
$center='<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=purge">'.$langs->trans("Purge").'</a>';
|
$center='<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=purge">'.$langs->trans("Purge").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print_barre_liste($langs->trans("ListOfSecurityEvents").' ('.$num.')', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, 0, 'setup');
|
print_barre_liste($langs->trans("ListOfSecurityEvents"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $nbtotalofrecords, 'setup');
|
||||||
|
|
||||||
if ($action == 'purge')
|
if ($action == 'purge')
|
||||||
{
|
{
|
||||||
@ -204,6 +213,8 @@ if ($result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="liste" width="100%">';
|
print '<table class="liste" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder);
|
||||||
@ -303,7 +314,10 @@ if ($result)
|
|||||||
if ($usefilter) print '<tr><td colspan="6">'.$langs->trans("NoEventFoundWithCriteria").'</td></tr>';
|
if ($usefilter) print '<tr><td colspan="6">'.$langs->trans("NoEventFoundWithCriteria").'</td></tr>';
|
||||||
else print '<tr><td colspan="6">'.$langs->trans("NoEventOrNoAuditSetup").'</td></tr>';
|
else print '<tr><td colspan="6">'.$langs->trans("NoEventOrNoAuditSetup").'</td></tr>';
|
||||||
}
|
}
|
||||||
print "</table></form>";
|
print "</table>";
|
||||||
|
print "</div>";
|
||||||
|
|
||||||
|
print "</form>";
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -39,7 +39,7 @@ if (GETPOST('msg','alpha')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$urldolibarr='http://www.dolibarr.org/downloads/';
|
$urldolibarr='https://www.dolibarr.org/downloads/';
|
||||||
$urldolibarrmodules='https://www.dolistore.com/';
|
$urldolibarrmodules='https://www.dolistore.com/';
|
||||||
$urldolibarrthemes='https://www.dolistore.com/';
|
$urldolibarrthemes='https://www.dolistore.com/';
|
||||||
$dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT);
|
$dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT);
|
||||||
|
|||||||
@ -105,7 +105,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update'))
|
|||||||
}
|
}
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue) VALUE ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."')";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -52,6 +52,7 @@ $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/';
|
|||||||
$interfaces = new Interfaces($db);
|
$interfaces = new Interfaces($db);
|
||||||
$triggers = $interfaces->getTriggersList();
|
$triggers = $interfaces->getTriggersList();
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder">
|
print '<table class="noborder">
|
||||||
<tr class="liste_titre">
|
<tr class="liste_titre">
|
||||||
<td colspan="2">'.$langs->trans("File").'</td>
|
<td colspan="2">'.$langs->trans("File").'</td>
|
||||||
@ -66,9 +67,9 @@ foreach ($triggers as $trigger)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td valign="top" width="14" align="center">'.$trigger['picto'].'</td>';
|
print '<td valign="top" width="14" align="center">'.$trigger['picto'].'</td>';
|
||||||
print '<td valign="top">'.$trigger['file'].'</td>';
|
print '<td class="tdtop">'.$trigger['file'].'</td>';
|
||||||
print '<td valign="top" align="center">'.$trigger['status'].'</td>';
|
print '<td valign="top" align="center">'.$trigger['status'].'</td>';
|
||||||
print '<td valign="top">';
|
print '<td class="tdtop">';
|
||||||
$text=$trigger['info'];
|
$text=$trigger['info'];
|
||||||
$text.="<br>\n<strong>".$langs->trans("File")."</strong>:<br>\n".$trigger['relpath'];
|
$text.="<br>\n<strong>".$langs->trans("File")."</strong>:<br>\n".$trigger['relpath'];
|
||||||
//$text.="\n".$langs->trans("ExternalModule",$trigger['isocreorexternal']);
|
//$text.="\n".$langs->trans("ExternalModule",$trigger['isocreorexternal']);
|
||||||
@ -78,6 +79,7 @@ foreach ($triggers as $trigger)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
|||||||
@ -76,12 +76,34 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
|
|
||||||
$userClass = Defaults::$userIdentifierClass;
|
$userClass = Defaults::$userIdentifierClass;
|
||||||
|
|
||||||
|
/*foreach ($_SERVER as $key => $val)
|
||||||
|
{
|
||||||
|
dol_syslog($key.' - '.$val);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// api key can be provided in url with parameter api_key=xxx or ni header with header DOLAPIKEY:xxx
|
||||||
|
$api_key = '';
|
||||||
if (isset($_GET['api_key']))
|
if (isset($_GET['api_key']))
|
||||||
|
{
|
||||||
|
// TODO Add option to disable use of api key on url. Return errors if used.
|
||||||
|
$api_key = $_GET['api_key']; // For backward compatibility
|
||||||
|
}
|
||||||
|
if (isset($_GET['DOLAPIKEY']))
|
||||||
|
{
|
||||||
|
// TODO Add option to disable use of api key on url. Return errors if used.
|
||||||
|
$api_key = $_GET['DOLAPIKEY']; // With GET method
|
||||||
|
}
|
||||||
|
if (isset($_SERVER['HTTP_DOLAPIKEY']))
|
||||||
|
{
|
||||||
|
$api_key = $_SERVER['HTTP_DOLAPIKEY']; // With header method (recommanded)
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($api_key)
|
||||||
{
|
{
|
||||||
$sql = "SELECT u.login, u.datec, u.api_key, ";
|
$sql = "SELECT u.login, u.datec, u.api_key, ";
|
||||||
$sql.= " u.tms as date_modification, u.entity";
|
$sql.= " u.tms as date_modification, u.entity";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql.= " WHERE u.api_key = '".$db->escape($_GET['api_key'])."'";
|
$sql.= " WHERE u.api_key = '".$db->escape($api_key)."'";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -97,8 +119,8 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
throw new RestException(503, 'Error when fetching user api_key :'.$db->error_msg);
|
throw new RestException(503, 'Error when fetching user api_key :'.$db->error_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($stored_key != $_GET['api_key']) {
|
if ($stored_key != $api_key) {
|
||||||
$userClass::setCacheIdentifier($_GET['api_key']);
|
$userClass::setCacheIdentifier($api_key);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +143,7 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new RestException(401, "Failed to login to API. No parameter 'api_key' provided");
|
throw new RestException(401, "Failed to login to API. No parameter 'DOLAPIKEY' on HTTP header (neither in URL).");
|
||||||
}
|
}
|
||||||
|
|
||||||
$userClass::setCacheIdentifier(static::$role);
|
$userClass::setCacheIdentifier(static::$role);
|
||||||
|
|||||||
@ -34,12 +34,14 @@ class Login
|
|||||||
/**
|
/**
|
||||||
* Login
|
* Login
|
||||||
*
|
*
|
||||||
* Log user with username and password
|
* Request the API token for a couple username / password.
|
||||||
*
|
* Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file).
|
||||||
* @param string $login Username
|
* Both method are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "api_key" into field at the top right of page (Note: "api_key" can be found/set on the user page).
|
||||||
|
*
|
||||||
|
* @param string $login User login
|
||||||
* @param string $password User password
|
* @param string $password User password
|
||||||
* @param int $entity Entity (when multicompany module is used). Empty means 1=first company.
|
* @param int $entity Entity (when multicompany module is used). Empty means 1=first company.
|
||||||
* @param int $reset Reset token (0=get current token, 1=ask a new token, meaning that all future access using current token will failed)
|
* @param int $reset Reset token (0=get current token, 1=ask a new token and canceled old token. This means access using current existing API token of user will fails: new token will be required for new access)
|
||||||
* @return array Response status and user token
|
* @return array Response status and user token
|
||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
|
|||||||
@ -56,6 +56,16 @@ if (empty($conf->global->MAIN_MODULE_API))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test if explorer is not disabled
|
||||||
|
if (preg_match('/api\/index\.php\/explorer/', $_SERVER["PHP_SELF"]) && ! empty($conf->global->API_EXPLORER_DISABLED))
|
||||||
|
{
|
||||||
|
$langs->load("admin");
|
||||||
|
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
||||||
|
print $langs->trans("WarningAPIExplorerDisabled").'.<br><br>';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$api = new DolibarrApi($db);
|
$api = new DolibarrApi($db);
|
||||||
|
|
||||||
|
|||||||
@ -85,10 +85,10 @@ if (! isset($conf->global->ASTERISK_PRIORITY)) $conf->global->ASTERISK_PRIORITY
|
|||||||
if (! isset($conf->global->ASTERISK_MAX_RETRY)) $conf->global->ASTERISK_MAX_RETRY="2";
|
if (! isset($conf->global->ASTERISK_MAX_RETRY)) $conf->global->ASTERISK_MAX_RETRY="2";
|
||||||
|
|
||||||
|
|
||||||
$login = $_GET['login'];
|
$login = GETPOST('login');
|
||||||
$password = $_GET['password'];
|
$password = GETPOST('password');
|
||||||
$caller = $_GET['caller'];
|
$caller = GETPOST('caller');
|
||||||
$called = $_GET['called'];
|
$called = GETPOST('called');
|
||||||
|
|
||||||
// IP address of Asterisk server
|
// IP address of Asterisk server
|
||||||
$strHost = $conf->global->ASTERISK_HOST;
|
$strHost = $conf->global->ASTERISK_HOST;
|
||||||
|
|||||||
@ -44,7 +44,7 @@ $userid=GETPOST("userid","int");
|
|||||||
$position=GETPOST("position","int");
|
$position=GETPOST("position","int");
|
||||||
$backtopage=GETPOST('backtopage','alpha');
|
$backtopage=GETPOST('backtopage','alpha');
|
||||||
|
|
||||||
$bookmark=new Bookmark($db);
|
$object=new Bookmark($db);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -69,14 +69,14 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'update') $bookmark->fetch(GETPOST("id",'int'));
|
if ($action == 'update') $object->fetch(GETPOST("id",'int'));
|
||||||
// Check if null because user not admin can't set an user and send empty value here.
|
// Check if null because user not admin can't set an user and send empty value here.
|
||||||
if(!empty($userid))
|
if(!empty($userid))
|
||||||
$bookmark->fk_user=$userid;
|
$object->fk_user=$userid;
|
||||||
$bookmark->title=$title;
|
$object->title=$title;
|
||||||
$bookmark->url=$url;
|
$object->url=$url;
|
||||||
$bookmark->target=$target;
|
$object->target=$target;
|
||||||
$bookmark->position=$position;
|
$object->position=$position;
|
||||||
|
|
||||||
if (! $title) {
|
if (! $title) {
|
||||||
$error++;
|
$error++;
|
||||||
@ -90,10 +90,10 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$bookmark->favicon='none';
|
$object->favicon='none';
|
||||||
|
|
||||||
if ($action == 'update') $res=$bookmark->update();
|
if ($action == 'update') $res=$object->update();
|
||||||
else $res=$bookmark->create();
|
else $res=$object->create();
|
||||||
|
|
||||||
if ($res > 0)
|
if ($res > 0)
|
||||||
{
|
{
|
||||||
@ -103,14 +103,14 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($bookmark->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
if ($object->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->transnoentities("WarningBookmarkAlreadyExists"), null, 'warnings');
|
setEventMessages($langs->transnoentities("WarningBookmarkAlreadyExists"), null, 'warnings');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($bookmark->error, $bookmark->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
$action = $invertedaction;
|
$action = $invertedaction;
|
||||||
}
|
}
|
||||||
@ -133,7 +133,7 @@ $form=new Form($db);
|
|||||||
$head = array();
|
$head = array();
|
||||||
$h=1;
|
$h=1;
|
||||||
|
|
||||||
$head[$h][0] = $_SERVER["PHP_SELF"].($bookmark->id?'id='.$bookmark->id:'');
|
$head[$h][0] = $_SERVER["PHP_SELF"].($object->id?'id='.$object->id:'');
|
||||||
$head[$h][1] = $langs->trans("Card");
|
$head[$h][1] = $langs->trans("Card");
|
||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
$h++;
|
$h++;
|
||||||
@ -157,7 +157,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input class="flat" name="title" size="30" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
|
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input class="flat" name="title" size="30" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("UrlOrLink").'</td><td><input class="flat" name="url" size="50" value="'.$url.'"></td><td class="hideonsmartphone">'.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'</td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("UrlOrLink").'</td><td><input class="flat" name="url" size="50" value="'.$url.'"></td><td class="hideonsmartphone">'.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'</td></tr>';
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Position
|
// Position
|
||||||
print '<tr><td>'.$langs->trans("Position").'</td><td>';
|
print '<tr><td>'.$langs->trans("Position").'</td><td>';
|
||||||
print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$bookmark->position).'">';
|
print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$object->position).'">';
|
||||||
print '</td><td class="hideonsmartphone"> </td></tr>';
|
print '</td><td class="hideonsmartphone"> </td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -193,8 +193,9 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
/*
|
/*
|
||||||
* Fact bookmark mode or visually edition
|
* Fact bookmark mode or visually edition
|
||||||
*/
|
*/
|
||||||
$bookmark->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
|
$hselected = 'card';
|
||||||
$head = array(
|
$head = array(
|
||||||
array(
|
array(
|
||||||
'',
|
'',
|
||||||
@ -208,18 +209,22 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
print '<form name="edit" method="POST" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data">';
|
print '<form name="edit" method="POST" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="id" value="'.$bookmark->id.'">';
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
print '<input type="hidden" name="urlsource" value="'.DOL_URL_ROOT.'/bookmarks/card.php?id='.$bookmark->id.'">';
|
print '<input type="hidden" name="urlsource" value="'.DOL_URL_ROOT.'/bookmarks/card.php?id='.$object->id.'">';
|
||||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
|
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
|
||||||
|
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0);
|
||||||
|
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$bookmark->ref.'</td></tr>';
|
print '<tr><td class="titlefield">';
|
||||||
|
|
||||||
print '<tr><td>';
|
|
||||||
if ($action == 'edit') {
|
if ($action == 'edit') {
|
||||||
print '<span class="fieldrequired">';
|
print '<span class="fieldrequired">';
|
||||||
}
|
}
|
||||||
@ -231,8 +236,8 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'edit') print '<input class="flat minwidth200" name="title" value="'.(isset($_POST["title"])?GETPOST("title",'',2):$bookmark->title).'">';
|
if ($action == 'edit') print '<input class="flat minwidth200" name="title" value="'.(isset($_POST["title"])?GETPOST("title",'',2):$object->title).'">';
|
||||||
else print $bookmark->title;
|
else print $object->title;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
@ -244,34 +249,34 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
print '</span>';
|
print '</span>';
|
||||||
}
|
}
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$bookmark->url).'">';
|
if ($action == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$object->url).'">';
|
||||||
else print '<a href="'.(preg_match('/^http/i',$bookmark->url)?$bookmark->url:DOL_URL_ROOT.$bookmark->url).'"'.($bookmark->target?' target="_blank"':'').'>'.$bookmark->url.'</a>';
|
else print '<a href="'.(preg_match('/^http/i',$object->url)?$object->url:DOL_URL_ROOT.$object->url).'"'.($object->target?' target="_blank"':'').'>'.$object->url.'</a>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
$liste=array(1=>$langs->trans("OpenANewWindow"),0=>$langs->trans("ReplaceWindow"));
|
$liste=array(1=>$langs->trans("OpenANewWindow"),0=>$langs->trans("ReplaceWindow"));
|
||||||
print $form->selectarray('target',$liste,isset($_POST["target"])?$_POST["target"]:$bookmark->target);
|
print $form->selectarray('target',$liste,isset($_POST["target"])?$_POST["target"]:$object->target);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($bookmark->target == 0) print $langs->trans("ReplaceWindow");
|
if ($object->target == 0) print $langs->trans("ReplaceWindow");
|
||||||
if ($bookmark->target == 1) print $langs->trans("OpenANewWindow");
|
if ($object->target == 1) print $langs->trans("OpenANewWindow");
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
|
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
|
||||||
if ($action == 'edit' && $user->admin)
|
if ($action == 'edit' && $user->admin)
|
||||||
{
|
{
|
||||||
print $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:($bookmark->fk_user?$bookmark->fk_user:''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
print $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:($object->fk_user?$object->fk_user:''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($bookmark->fk_user)
|
if ($object->fk_user)
|
||||||
{
|
{
|
||||||
$fuser=new User($db);
|
$fuser=new User($db);
|
||||||
$fuser->fetch($bookmark->fk_user);
|
$fuser->fetch($object->fk_user);
|
||||||
print $fuser->getNomUrl(1);
|
print $fuser->getNomUrl(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -283,12 +288,12 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
|
|
||||||
// Position
|
// Position
|
||||||
print '<tr><td>'.$langs->trans("Position").'</td><td>';
|
print '<tr><td>'.$langs->trans("Position").'</td><td>';
|
||||||
if ($action == 'edit') print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$bookmark->position).'">';
|
if ($action == 'edit') print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$object->position).'">';
|
||||||
else print $bookmark->position;
|
else print $object->position;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date creation
|
// Date creation
|
||||||
print '<tr><td>'.$langs->trans("DateCreation").'</td><td>'.dol_print_date($bookmark->datec,'dayhour').'</td></tr>';
|
print '<tr><td>'.$langs->trans("DateCreation").'</td><td>'.dol_print_date($object->datec,'dayhour').'</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
@ -302,19 +307,19 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
|
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
|
|
||||||
print "<div class=\"tabsAction\">\n";
|
print "<div class=\"tabsAction\">\n";
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
if ($user->rights->bookmark->creer && $action != 'edit')
|
if ($user->rights->bookmark->creer && $action != 'edit')
|
||||||
{
|
{
|
||||||
print " <a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?id=".$bookmark->id."&action=edit\">".$langs->trans("Edit")."</a>\n";
|
print " <a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?id=".$object->id."&action=edit\">".$langs->trans("Edit")."</a>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove
|
// Remove
|
||||||
if ($user->rights->bookmark->supprimer && $action != 'edit')
|
if ($user->rights->bookmark->supprimer && $action != 'edit')
|
||||||
{
|
{
|
||||||
print " <a class=\"butActionDelete\" href=\"list.php?bid=".$bookmark->id."&action=delete\">".$langs->trans("Delete")."</a>\n";
|
print " <a class=\"butActionDelete\" href=\"list.php?bid=".$object->id."&action=delete\">".$langs->trans("Delete")."</a>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -26,8 +26,13 @@
|
|||||||
/**
|
/**
|
||||||
* Class to manage bookmarks
|
* Class to manage bookmarks
|
||||||
*/
|
*/
|
||||||
class Bookmark
|
class Bookmark extends CommonObject
|
||||||
{
|
{
|
||||||
|
public $element='bookmark';
|
||||||
|
public $table_element='bookmark';
|
||||||
|
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
|
public $picto = 'bookmark';
|
||||||
|
|
||||||
var $db;
|
var $db;
|
||||||
|
|
||||||
var $id;
|
var $id;
|
||||||
@ -228,4 +233,15 @@ class Bookmark
|
|||||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return label of contact status
|
||||||
|
*
|
||||||
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
|
* @return string Label of contact status
|
||||||
|
*/
|
||||||
|
function getLibStatut($mode)
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,6 +34,8 @@ if ( $_SESSION['uid'] <= 0 )
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$langs->load("companies");
|
||||||
|
$langs->load("compta");
|
||||||
$langs->load("cashdesk");
|
$langs->load("cashdesk");
|
||||||
|
|
||||||
|
|
||||||
@ -41,6 +43,8 @@ $langs->load("cashdesk");
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
//header("Content-type: text/html; charset=UTF-8");
|
//header("Content-type: text/html; charset=UTF-8");
|
||||||
//header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
//header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
||||||
|
|
||||||
|
|||||||
@ -22,8 +22,21 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
<!-- affPied.php -->
|
||||||
<div class="pied">
|
<div class="pied">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
// Wrapper to show tooltips
|
||||||
|
if (! empty($conf->use_javascript_ajax) && empty($conf->dol_no_mouse_hover))
|
||||||
|
{
|
||||||
|
print "\n<!-- JS CODE TO ENABLE tipTip on all object with class classfortooltip -->\n";
|
||||||
|
print '<script type="text/javascript">
|
||||||
|
jQuery(document).ready(function () {
|
||||||
|
jQuery(".classfortooltip").tipTip({maxWidth: "'.dol_size(($conf->browser->layout == 'phone' ? 400 : 700),'width').'px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50});
|
||||||
|
});
|
||||||
|
</script>' . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
printCommonFooter('private');
|
printCommonFooter('private');
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class Facturation
|
|||||||
* int $prix => Prix HT du produit en cours
|
* int $prix => Prix HT du produit en cours
|
||||||
* int $tva => 'rowid' du taux de tva dans llx_c_tva
|
* int $tva => 'rowid' du taux de tva dans llx_c_tva
|
||||||
*/
|
*/
|
||||||
var $id;
|
public $id;
|
||||||
protected $ref;
|
protected $ref;
|
||||||
protected $qte;
|
protected $qte;
|
||||||
protected $stock;
|
protected $stock;
|
||||||
|
|||||||
@ -19,7 +19,6 @@ body {
|
|||||||
color: #333;
|
color: #333;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
@ -115,7 +114,7 @@ li.menu_choix0 {
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------- R<EFBFBD>capitulatif des articles ------------------- */
|
/* ------------------- Remind of products ------------------- */
|
||||||
.liste_articles {
|
.liste_articles {
|
||||||
min-width: 215px;
|
min-width: 215px;
|
||||||
float: right;
|
float: right;
|
||||||
@ -212,6 +211,10 @@ p.titre {
|
|||||||
max-width: 900px;
|
max-width: 900px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.blocksellfinished {
|
||||||
|
min-width: 215px;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
.titre1 {
|
.titre1 {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #ff9900;
|
color: #ff9900;
|
||||||
|
|||||||
61
htdocs/cashdesk/css/ticket.css
Normal file
61
htdocs/cashdesk/css/ticket.css
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* TPV ticket.css
|
||||||
|
*/
|
||||||
|
body {
|
||||||
|
font-size: 1.5em;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.entete { /* position: relative; */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.address { /* float: left; */
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date_heure {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infos {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.liste_articles {
|
||||||
|
width: 100%;
|
||||||
|
border-bottom: 1px solid #000;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.liste_articles tr.titres th {
|
||||||
|
border-bottom: 1px solid #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.liste_articles td.total {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totaux {
|
||||||
|
margin-top: 20px;
|
||||||
|
width: 30%;
|
||||||
|
float: right;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lien {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
.lien {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -28,11 +28,13 @@ require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
|
||||||
|
$action = GETPOST('action','alpha');
|
||||||
|
|
||||||
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
|
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
|
||||||
unset ($_SESSION['serObjFacturation']);
|
unset ($_SESSION['serObjFacturation']);
|
||||||
|
|
||||||
|
|
||||||
switch ( $_GET['action'] )
|
switch($action)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
if ( $_POST['hdnSource'] != 'NULL' )
|
if ( $_POST['hdnSource'] != 'NULL' )
|
||||||
@ -162,6 +164,16 @@ switch ( $_GET['action'] )
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'change_thirdparty': // We have clicked on button "Modify" a thirdparty
|
||||||
|
$newthirdpartyid = GETPOST('CASHDESK_ID_THIRDPARTY','int');
|
||||||
|
if ($newthirdpartyid > 0)
|
||||||
|
{
|
||||||
|
$_SESSION["CASHDESK_ID_THIRDPARTY"] = $newthirdpartyid;
|
||||||
|
}
|
||||||
|
|
||||||
|
$redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation';
|
||||||
|
break;
|
||||||
|
|
||||||
case 'ajout_article': // We have clicked on button "Add product"
|
case 'ajout_article': // We have clicked on button "Add product"
|
||||||
|
|
||||||
if (! empty($obj_facturation->id)) // A product was previously selected and stored in session, so we can add it
|
if (! empty($obj_facturation->id)) // A product was previously selected and stored in session, so we can add it
|
||||||
|
|||||||
@ -59,7 +59,18 @@ top_htmlhead('','',0,0,'',$arrayofcss);
|
|||||||
<div class="conteneur_img_droite">
|
<div class="conteneur_img_droite">
|
||||||
|
|
||||||
<div class="menu_principal hideonsmartphone">
|
<div class="menu_principal hideonsmartphone">
|
||||||
<div class="logo"><?php print '<img class="logopos" alt="Logo company" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('/thumbs/'.$mysoc->logo_small).'">'; ?></div>
|
<div class="logo">
|
||||||
|
<?php
|
||||||
|
if (! empty($mysoc->logo_small))
|
||||||
|
{
|
||||||
|
print '<img class="logopos" alt="Logo company" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('/thumbs/'.$mysoc->logo_small).'">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<div class="logopos">'.$mysoc->name.'</div>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="contenu">
|
<div class="contenu">
|
||||||
|
|||||||
@ -106,42 +106,32 @@ $langs->load("cashdesk");
|
|||||||
<th><?php echo $langs->trans("VATRate"); ?></th>
|
<th><?php echo $langs->trans("VATRate"); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input class="texte1" type="text" id="txtQte" name="txtQte" value="1" onkeyup="javascript: modif();" onfocus="javascript: this.select();" />
|
<td><input class="texte1 maxwidth50onsmartphone" type="text" id="txtQte" name="txtQte" value="1" onkeyup="javascript: modif();" onfocus="javascript: this.select();" />
|
||||||
<?php print genkeypad("txtQte", "frmQte");?>
|
<?php print genkeypad("txtQte", "frmQte");?>
|
||||||
</td>
|
</td>
|
||||||
<!-- Affichage du stock pour l'article courant -->
|
<!-- Affichage du stock pour l'article courant -->
|
||||||
<td>
|
<td>
|
||||||
<input class="texte1_off" type="text" name="txtStock" value="<?php echo $obj_facturation->stock() ?>" disabled />
|
<input class="texte1_off maxwidth50onsmartphone" type="text" name="txtStock" value="<?php echo $obj_facturation->stock() ?>" disabled />
|
||||||
</td>
|
</td>
|
||||||
<!-- Show unit price -->
|
<!-- Show unit price -->
|
||||||
<?php // TODO Remove the disabled and use this value when adding product into cart ?>
|
<?php // TODO Remove the disabled and use this value when adding product into cart ?>
|
||||||
<td><input class="texte1_off" type="text" name="txtPrixUnit" value="<?php echo price2num($obj_facturation->prix(), 'MU'); ?>" onchange="javascript: modif();" disabled /></td>
|
<td><input class="texte1_off maxwidth50onsmartphone" type="text" name="txtPrixUnit" value="<?php echo price2num($obj_facturation->prix(), 'MU'); ?>" onchange="javascript: modif();" disabled /></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<!-- Choix de la remise -->
|
<!-- Choix de la remise -->
|
||||||
<td><input class="texte1" type="text" id="txtRemise" name="txtRemise" value="0" onkeyup="javascript: modif();" onfocus="javascript: this.select();"/>
|
<td><input class="texte1 maxwidth50onsmartphone" type="text" id="txtRemise" name="txtRemise" value="0" onkeyup="javascript: modif();" onfocus="javascript: this.select();"/>
|
||||||
<?php print genkeypad("txtRemise", "frmQte");?>
|
<?php print genkeypad("txtRemise", "frmQte");?>
|
||||||
</td>
|
</td>
|
||||||
<!-- Affichage du total HT -->
|
<!-- Affichage du total HT -->
|
||||||
<td><input class="texte1_off" type="text" name="txtTotal" value="" disabled /></td><td></td>
|
<td><input class="texte1_off maxwidth50onsmartphone" type="text" name="txtTotal" value="" disabled /></td><td></td>
|
||||||
<!-- Choix du taux de TVA -->
|
<!-- Choix du taux de TVA -->
|
||||||
<td class="select_tva">
|
<td class="select_tva">
|
||||||
<?php //var_dump($tab_tva); ?>
|
<?php //var_dump($tab_tva);
|
||||||
<select name="selTva" onchange="javascript: modif();" >
|
$tva_tx = $obj_facturation->tva(); // Try to get a previously entered VAT rowid. First time, this will return empty.
|
||||||
<?php
|
$buyer = new Societe($db);
|
||||||
$tva_tx = $obj_facturation->tva(); // Try to get a previously entered VAT rowid. First time, this will return empty.
|
if ($_SESSION["CASHDESK_ID_THIRDPARTY"] > 0) $buyer->fetch($_SESSION["CASHDESK_ID_THIRDPARTY"]);
|
||||||
|
|
||||||
$tab_tva_size=count($tab_tva); // $tab_tva contains list of possible vat array('rowid'=> , 'taux'=> )
|
echo $form->load_tva('selTva', (isset($_POST["selTva"])?GETPOST("selTva",'alpha',2):-1), $mysoc, $buyer, 0, 0, '', false, -1);
|
||||||
for ($i=0;$i < $tab_tva_size;$i++)
|
?>
|
||||||
{
|
|
||||||
if ($tva_tx == $tab_tva[$i]['rowid'])
|
|
||||||
$selected = 'selected';
|
|
||||||
else
|
|
||||||
$selected = '';
|
|
||||||
|
|
||||||
echo '<option '.$selected.' value="'.$tab_tva[$i]['rowid'].'">'.$tab_tva[$i]['taux'].'</option>'."\n ";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -155,17 +145,17 @@ $langs->load("cashdesk");
|
|||||||
<input type="hidden" name="hdnChoix" value="" />
|
<input type="hidden" name="hdnChoix" value="" />
|
||||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
||||||
<fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Amount"); ?></legend>
|
<fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Amount"); ?></legend>
|
||||||
<table>
|
<table class="centpercent">
|
||||||
<tr><th class="label1"><?php echo $langs->trans("TotalTicket"); ?></th><th class="label1"><?php echo $langs->trans("Received"); ?></th><th class="label1"><?php echo $langs->trans("Change"); ?></th></tr>
|
<tr><th class="label1"><?php echo $langs->trans("TotalTicket"); ?></th><th class="label1"><?php echo $langs->trans("Received"); ?></th><th class="label1"><?php echo $langs->trans("Change"); ?></th></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<!-- Affichage du montant du -->
|
<!-- Affichage du montant du -->
|
||||||
<td><input class="texte2_off" type="text" name="txtDu" value="<?php echo price2num($obj_facturation->prixTotalTtc(), 'MT'); ?>" disabled /></td>
|
<td><input class="texte2_off maxwidthonsmartphone" type="text" name="txtDu" value="<?php echo price2num($obj_facturation->prixTotalTtc(), 'MT'); ?>" disabled /></td>
|
||||||
<!-- Choix du montant encaisse -->
|
<!-- Choix du montant encaisse -->
|
||||||
<td><input class="texte2" type="text" id="txtEncaisse" name="txtEncaisse" value="" onkeyup="javascript: verifDifference();" onfocus="javascript: this.select();" />
|
<td><input class="texte2 maxwidthonsmartphone" type="text" id="txtEncaisse" name="txtEncaisse" value="" onkeyup="javascript: verifDifference();" onfocus="javascript: this.select();" />
|
||||||
<?php print genkeypad("txtEncaisse", "frmDifference");?>
|
<?php print genkeypad("txtEncaisse", "frmDifference");?>
|
||||||
</td>
|
</td>
|
||||||
<!-- Affichage du montant rendu -->
|
<!-- Affichage du montant rendu -->
|
||||||
<td><input class="texte2_off" type="text" name="txtRendu" value="0" disabled /></td>
|
<td><input class="texte2_off maxwidthonsmartphone" type="text" name="txtRendu" value="0" disabled /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@ -23,12 +23,12 @@ include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||||
|
|
||||||
if (!empty($_SESSION["CASHDESK_ID_THIRDPARTY"]))
|
/*if (!empty($_SESSION["CASHDESK_ID_THIRDPARTY"]))
|
||||||
{
|
{
|
||||||
$company=new Societe($db);
|
$company=new Societe($db);
|
||||||
$company->fetch($_SESSION["CASHDESK_ID_THIRDPARTY"]);
|
$company->fetch($_SESSION["CASHDESK_ID_THIRDPARTY"]);
|
||||||
$companyLink = $company->getNomUrl(1);
|
$companyLink = $company->getNomUrl(1);
|
||||||
}
|
}*/
|
||||||
if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]))
|
if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]))
|
||||||
{
|
{
|
||||||
$bankcash=new Account($db);
|
$bankcash=new Account($db);
|
||||||
@ -59,6 +59,7 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)
|
|||||||
$langs->load("cashdesk");
|
$langs->load("cashdesk");
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
|
|
||||||
|
print "\n".'<!-- menu.tpl.php -->'."\n";
|
||||||
print '<div class="menu_bloc">';
|
print '<div class="menu_bloc">';
|
||||||
print '<ul class="menu">';
|
print '<ul class="menu">';
|
||||||
// Link to new sell
|
// Link to new sell
|
||||||
@ -68,7 +69,13 @@ print '<li class="menu_choix2"><a href=".." target="backoffice"><span class="hid
|
|||||||
// Disconnect
|
// Disconnect
|
||||||
print '<li class="menu_choix0">'.$langs->trans("User").': '.$_SESSION['firstname'].' '.$_SESSION['lastname'];
|
print '<li class="menu_choix0">'.$langs->trans("User").': '.$_SESSION['firstname'].' '.$_SESSION['lastname'];
|
||||||
print ' <a href="deconnexion.php">'.img_picto($langs->trans('Logout'), 'logout.png').'</a><br>';
|
print ' <a href="deconnexion.php">'.img_picto($langs->trans('Logout'), 'logout.png').'</a><br>';
|
||||||
print $langs->trans("CashDeskThirdParty").': '.$companyLink.'<br>';
|
print '<form id="frmThirdparty" class="formulaire1 inline-block" method="post" action="facturation_verif.php?action=change_thirdparty">';
|
||||||
|
print $langs->trans("CashDeskThirdParty").': ';
|
||||||
|
print $form->select_company($_SESSION["CASHDESK_ID_THIRDPARTY"], 'CASHDESK_ID_THIRDPARTY', 's.client IN (1,3)', '', 0, 0, null, 0, 'valignmiddle inline-block');
|
||||||
|
print '<input class="button bouton_change_thirdparty inline-block valignmiddle" type="submit" id="bouton_change_thirdparty" value="'.$langs->trans("Modify").'">';
|
||||||
|
//print $companyLink;
|
||||||
|
print '<br>';
|
||||||
|
print '</form>';
|
||||||
/*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'<br>';
|
/*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'<br>';
|
||||||
print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'<br>';
|
print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'<br>';
|
||||||
print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'<br>';*/
|
print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'<br>';*/
|
||||||
@ -78,3 +85,4 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)
|
|||||||
}
|
}
|
||||||
print '</li></ul>';
|
print '</li></ul>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
print "\n".'<!-- menu.tpl.php end -->'."\n";
|
||||||
|
|||||||
@ -28,130 +28,84 @@ $object->fetch($facid);
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title><?php echo $langs->trans('PrintTicket') ?></title>
|
<title><?php echo $langs->trans('PrintTicket') ?></title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="<?php echo DOL_URL_ROOT;?>/cashdesk/css/ticket.css">
|
||||||
<style type="text/css">
|
|
||||||
body {
|
|
||||||
font-size: 1.5em;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.entete { /* position: relative; */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.address { /* float: left; */
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.date_heure {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.infos {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.liste_articles {
|
|
||||||
width: 100%;
|
|
||||||
border-bottom: 1px solid #000;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.liste_articles tr.titres th {
|
|
||||||
border-bottom: 1px solid #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.liste_articles td.total {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.totaux {
|
|
||||||
margin-top: 20px;
|
|
||||||
width: 30%;
|
|
||||||
float: right;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lien {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media print {
|
|
||||||
.lien {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="entete">
|
<div class="entete">
|
||||||
<div class="logo"><?php print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('/thumbs/'.$mysoc->logo_small).'">'; ?>
|
<div class="logo">
|
||||||
</div>
|
<?php print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('/thumbs/'.$mysoc->logo_small).'">'; ?>
|
||||||
<div class="infos">
|
</div>
|
||||||
<p class="address"><?php echo $mysoc->name; ?><br>
|
<div class="infos">
|
||||||
<?php print dol_nl2br(dol_format_address($mysoc)); ?><br>
|
<p class="address"><?php echo $mysoc->name; ?><br>
|
||||||
</p>
|
<?php print dol_nl2br(dol_format_address($mysoc)); ?><br>
|
||||||
|
</p>
|
||||||
|
|
||||||
<p class="date_heure"><?php
|
<p class="date_heure"><?php
|
||||||
// Recuperation et affichage de la date et de l'heure
|
// Recuperation et affichage de la date et de l'heure
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
print dol_print_date($now,'dayhourtext').'<br>';
|
print dol_print_date($now,'dayhourtext').'<br>';
|
||||||
print $object->ref;
|
print $object->ref;
|
||||||
?></p>
|
?></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<table class="liste_articles">
|
<table class="liste_articles">
|
||||||
|
<thead>
|
||||||
<tr class="titres">
|
<tr class="titres">
|
||||||
<th><?php print $langs->trans("Code"); ?></th>
|
<th><?php print $langs->trans("Code"); ?></th>
|
||||||
<th><?php print $langs->trans("Label"); ?></th>
|
<th><?php print $langs->trans("Label"); ?></th>
|
||||||
<th><?php print $langs->trans("Qty"); ?></th>
|
<th><?php print $langs->trans("Qty"); ?></th>
|
||||||
<th><?php print $langs->trans("Discount").' (%)'; ?></th>
|
<th><?php print $langs->trans("Discount").' (%)'; ?></th>
|
||||||
<th><?php print $langs->trans("TotalHT"); ?></th>
|
<th><?php print $langs->trans("TotalHT"); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
|
||||||
<?php
|
$tab=array();
|
||||||
|
|
||||||
$tab=array();
|
|
||||||
$tab = $_SESSION['poscart'];
|
$tab = $_SESSION['poscart'];
|
||||||
|
|
||||||
$tab_size=count($tab);
|
$tab_size=count($tab);
|
||||||
for($i=0;$i < $tab_size;$i++)
|
for($i=0;$i < $tab_size;$i++)
|
||||||
{
|
{
|
||||||
$remise = $tab[$i]['remise'];
|
$remise = $tab[$i]['remise'];
|
||||||
echo ('<tr><td>'.$tab[$i]['ref'].'</td><td>'.$tab[$i]['label'].'</td><td>'.$tab[$i]['qte'].'</td><td>'.$tab[$i]['remise_percent'].'</td><td class="total">'.price(price2num($tab[$i]['total_ht'],'MT'),0,$langs,0,0,-1,$conf->currency).'</td></tr>'."\n");
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo $tab[$i]['ref'];?></td>
|
||||||
|
<td><?php echo $tab[$i]['label'];?></td>
|
||||||
|
<td><?php echo $tab[$i]['qte'];?></td>
|
||||||
|
<td><?php echo $tab[$i]['remise_percent'];?></td>
|
||||||
|
<td class="total"><?php echo price(price2num($tab[$i]['total_ht'],'MT'),0,$langs,0,0,-1,$conf->currency);?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
?>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<table class="totaux">
|
<table class="totaux">
|
||||||
<?php
|
<tr>
|
||||||
echo '<tr><th class="nowrap">'.$langs->trans("TotalHT").'</th><td class="nowrap">'.price(price2num($obj_facturation->prixTotalHt(),'MT'),'',$langs,0,-1,-1,$conf->currency)."</td></tr>\n";
|
<th class="nowrap"><?php echo $langs->trans("TotalHT");?></th>
|
||||||
echo '<tr><th class="nowrap">'.$langs->trans("TotalVAT").'</th><td class="nowrap">'.price(price2num($obj_facturation->montantTva(),'MT'),'',$langs,0,-1,-1,$conf->currency)."</td></tr>\n";
|
<td class="nowrap"><?php echo price(price2num($obj_facturation->prixTotalHt(),'MT'),'',$langs,0,-1,-1,$conf->currency)."\n";?></td>
|
||||||
echo '<tr><th class="nowrap">'.$langs->trans("TotalTTC").'</th><td class="nowrap">'.price(price2num($obj_facturation->prixTotalTtc(),'MT'),'',$langs,0,-1,-1,$conf->currency)."</td></tr>\n";
|
</tr>
|
||||||
?>
|
<tr>
|
||||||
|
<th class="nowrap"><?php echo $langs->trans("TotalVAT").'</th><td class="nowrap">'.price(price2num($obj_facturation->montantTva(),'MT'),'',$langs,0,-1,-1,$conf->currency)."\n";?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="nowrap"><?php echo ''.$langs->trans("TotalTTC").'</th><td class="nowrap">'.price(price2num($obj_facturation->prixTotalTtc(),'MT'),'',$langs,0,-1,-1,$conf->currency)."\n";?></td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.print();
|
window.print();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a class="lien" href="#"
|
<a class="lien" href="#" onclick="javascript: window.close(); return(false);"><?php echo $langs->trans("Close"); ?></a>
|
||||||
onclick="javascript: window.close(); return(false);"><?php echo $langs->trans("Close"); ?></a>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
$langs->load("banks");
|
||||||
|
|
||||||
// Object $form must de defined
|
// Object $form must de defined
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user