Compare commits
No commits in common. "12.0" and "12.0.3" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,7 +16,6 @@ default.properties
|
||||
.DS_Store
|
||||
.idea
|
||||
*.iml
|
||||
*.orig
|
||||
Thumbs.db
|
||||
/dolibarr_genesis.mp4
|
||||
# Log files
|
||||
|
||||
78
.travis.yml
78
.travis.yml
@ -5,7 +5,7 @@
|
||||
# We use dist: xenial to have php 5.6+ available
|
||||
os: linux
|
||||
dist: xenial
|
||||
#dist: bionic
|
||||
sudo: required
|
||||
|
||||
language: php
|
||||
|
||||
@ -31,25 +31,53 @@ addons:
|
||||
# We need pgloader for import mysql database into pgsql
|
||||
- pgloader
|
||||
|
||||
php:
|
||||
- '5.6'
|
||||
- '7.0'
|
||||
- '7.1'
|
||||
- '7.2'
|
||||
- '7.3'
|
||||
- '7.4'
|
||||
- nightly
|
||||
|
||||
env:
|
||||
global:
|
||||
# Set to true for very verbose output
|
||||
- DEBUG=false
|
||||
jobs:
|
||||
# MariaDB overrides MySQL installation so it's not possible to test both yet
|
||||
#- DB=mariadb
|
||||
- DB=mysql
|
||||
- DB=postgresql
|
||||
# See https://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
|
||||
#- WS=apache
|
||||
# See https://github.com/DracoBlue/travis-ci-nginx-php-fpm-test
|
||||
#- WS=nginx
|
||||
|
||||
jobs:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- php: nightly
|
||||
include:
|
||||
- if: type = push
|
||||
php: '5.6'
|
||||
env: DB=postgresql
|
||||
- if: type = pull_request OR type = push
|
||||
php: '7.4'
|
||||
env: DB=mysql
|
||||
- if: type = push AND branch = develop
|
||||
php: nightly
|
||||
env: DB=mysql
|
||||
# We exclude some combinations not usefull to save Travis CPU
|
||||
exclude:
|
||||
- php: '7.0'
|
||||
env: DB=mysql
|
||||
- php: '7.1'
|
||||
env: DB=mysql
|
||||
- php: '7.2'
|
||||
env: DB=mysql
|
||||
- php: '7.3'
|
||||
env: DB=mysql
|
||||
- php: '7.0'
|
||||
env: DB=postgresql
|
||||
- php: '7.1'
|
||||
env: DB=postgresql
|
||||
- php: '7.2'
|
||||
env: DB=postgresql
|
||||
- php: '7.3'
|
||||
env: DB=postgresql
|
||||
- php: nightly
|
||||
env: DB=postgresql
|
||||
|
||||
notifications:
|
||||
email:
|
||||
@ -82,11 +110,11 @@ install:
|
||||
echo "Updating Composer"
|
||||
rm $TRAVIS_BUILD_DIR/composer.json
|
||||
rm $TRAVIS_BUILD_DIR/composer.lock
|
||||
composer -V
|
||||
composer self-update
|
||||
# To have composer making parallel downloads
|
||||
composer global require hirak/prestissimo
|
||||
composer -n init
|
||||
composer -n config vendor-dir htdocs/includes
|
||||
composer -n config -g vendor-dir htdocs/includes
|
||||
echo
|
||||
|
||||
- |
|
||||
@ -115,9 +143,6 @@ install:
|
||||
- |
|
||||
echo "Adding path of binaries tools installed by composer to the PATH"
|
||||
export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH"
|
||||
echo $PATH
|
||||
ls $TRAVIS_BUILD_DIR/vendor
|
||||
ls $TRAVIS_BUILD_DIR/htdocs/includes/bin
|
||||
echo
|
||||
|
||||
|
||||
@ -144,20 +169,15 @@ before_script:
|
||||
|
||||
- |
|
||||
echo "Versions information"
|
||||
echo
|
||||
# Check PHP
|
||||
echo "PHP version"
|
||||
php -i | head -
|
||||
# Check Parallel-lint version
|
||||
echo "Parallel-lint version"
|
||||
which parallel-lint
|
||||
parallel-lint -V
|
||||
# Check PHP CodeSniffer version
|
||||
# Check PHP CodeSniffer installation
|
||||
echo "PHPCS version"
|
||||
which phpcs
|
||||
phpcs --version | head -
|
||||
phpcs -i | head -
|
||||
# Check PHPUnit version
|
||||
# Check PHPUnit installation
|
||||
echo "PHPUnit version"
|
||||
which phpunit
|
||||
phpunit --version | head -
|
||||
@ -262,18 +282,17 @@ script:
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
#parallel-lint --exclude htdocs/includes --blame .
|
||||
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/webmozart --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/ --exclude htdocs/includes/composer/autoload_static.php --blame .
|
||||
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/myclabs --exclude htdocs/includes/webmozart --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/ --exclude htdocs/includes/composer/autoload_static.php --blame .
|
||||
set +e
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Checking coding style (excluding Pull Requests builds to not overload travis, excluding also some jobs to avoid duplicate tests)"
|
||||
echo "Checking coding style (excluding Pull Requests builds)"
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ] && [ "$DB" = "mysql" ]; then
|
||||
phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .;
|
||||
fi
|
||||
#phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi
|
||||
set +e
|
||||
echo
|
||||
|
||||
@ -385,7 +404,6 @@ script:
|
||||
php upgrade.php 11.0.0 12.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade11001200.log
|
||||
php upgrade2.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-2.log
|
||||
php step5.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-3.log
|
||||
|
||||
# Enable modules not enabled into original dump
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
echo $?
|
||||
@ -406,7 +424,7 @@ script:
|
||||
|
||||
after_script:
|
||||
- |
|
||||
echo "After script - Output last lines of dolibarr.log"
|
||||
echo "After script - Output lines of dolibarr.log"
|
||||
ls $TRAVIS_BUILD_DIR/documents
|
||||
#cat $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||
sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||
|
||||
151
ChangeLog
151
ChangeLog
@ -2,157 +2,6 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 12.0.5 compared to 12.0.4 *****
|
||||
FIX: before crediting a withdrawal receipt, check whether it has been credited already
|
||||
FIX: mandatory extrafields of type sellist
|
||||
FIX: when a mandatory extrafield of type sellist contains '0' it should be considered empty and trigger an error message upon insertion
|
||||
FIX: when a new intervention is created from an object, a new $extrafields object is instantiated but not initialized
|
||||
FIX: "openall" filter on ticket list does not include read tickets
|
||||
FIX: ticket - extrafields of type 'date' are not saved
|
||||
FIX: ticket - the "openall" filter on the ticket list does not include tickets with status READ
|
||||
FIX: #14290 #15900
|
||||
FIX: #15388 #15891
|
||||
FIX: #15465 External user sees last 5 shipments to other customers in the dashboard
|
||||
FIX: #15629
|
||||
FIX: #15751 Miscellaneous payment type change to 0 after updating subledger account
|
||||
FIX: #15946
|
||||
FIX: #15966 #15967
|
||||
FIX: Accountancy - Fix some problems on CEGID export
|
||||
FIX: Accountancy - label_operation is used instead of label_compte
|
||||
FIX: Accountancy - Retire entire opening balance feature
|
||||
FIX: add autofix of count of email target when data is corrupted
|
||||
FIX: add categories params on llxHeader filter
|
||||
FIX: Add critical price patch from 12 to 11.
|
||||
FIX: Bad cleaning of VAT rate when numbers are into code
|
||||
FIX: Bad dates filtering in the ticket list causes sql error
|
||||
FIX: balance starting and ending fiscal month #14197
|
||||
FIX: bom line unit display #13831
|
||||
FIX: cash fence for takepos with multientity
|
||||
FIX: Check of customer/vendor code fails in some cases
|
||||
FIX: create ticket : thirdparty/contact notification #15629
|
||||
FIX: Creation of thirdparty when setup is empty
|
||||
FIX: Dates of sales start in TakePOS
|
||||
FIX: dupliacete customer or supplier code must be error dipslayed with new code proposed
|
||||
FIX: Export FEC - Force Carriage Return Line Feed
|
||||
FIX: Facture Situation Out : status condition
|
||||
FIX: Filter on date of next generation on template invoices
|
||||
FIX: Fix detect dispatched product and set to received completely when the supplier order have services (support STOCK_SUPPORTS_SERVICES)
|
||||
FIX: Invoice Situation Out : status condition
|
||||
FIX: issue 15659 : Missing test if supplier conf is enabled
|
||||
FIX: link to create event when task is in a project with a thirdparty
|
||||
FIX: Localtax must be converted with price2num
|
||||
FIX: manage price min for PRODUIT_CUSTOMER_PRICES
|
||||
FIX: missing GETPOST parameters on card_presend.tpl.php
|
||||
FIX: missing socid into link to create event from project agenda tab
|
||||
FIX: Must delete extrafields before main table on product deletion.
|
||||
FIX: (path) htdocs removed
|
||||
FIX: php alert sms.php
|
||||
FIX: right to show VAT rate in product list
|
||||
FIX: select default mail template
|
||||
FIX: Timeout during import
|
||||
FIX: update order by api
|
||||
FIX: useless tracking number displayed on pdf if empty issue #14501
|
||||
FIX: Visible date of payment
|
||||
FIX: warning when adding a line if $remise_percent is an empty string
|
||||
FIX: When creating a new POS sell, the creation date must be modified.
|
||||
FIX: wrong name for search status param issue #15516
|
||||
|
||||
***** ChangeLog for 12.0.4 compared to 12.0.3 *****
|
||||
FIX: make formConfirm an addreplace-type hook
|
||||
FIX: regex to remove 'action' parameter: taking feedback from PR#15213 into account
|
||||
FIX: remove 'action' parameter from redirect URL when reordering lines on a document
|
||||
FIX: error when displaying lines on order after adding a line if both MAIN_MULTILANGS and MAIN_DISABLE_PDF_AUTOUPDATE are activated
|
||||
FIX: on survey creation, entity is always set to 1 ⇒ set it to $conf->entity
|
||||
FIX: set entity to $conf->entity (instead of 1 by default) when creating a survey; otherwise the survey cannot be listed from the entity it was created on unless it is the main entity
|
||||
FIX: the stringent XSS protection provided by 'alphanohtml' causes problems with some clients who used basic tags (bold, italic, underline) in product labels. Using 'restricthtml' instead could be a good compromise.
|
||||
FIX: third party of object is not always fetched when initiating the e-mail presend action (e.g. from an order)
|
||||
FIX: when the cronjob 'params' field is empty, the cron method is called with one empty string param instead of no params at all
|
||||
FIX: XSS protection too stringent -> replace 'alphanohtml' with 'restricthtml'
|
||||
FIX: #13067 including opening balance in calculation of displayed balance
|
||||
FIX: #14326
|
||||
FIX: #14649
|
||||
FIX: #14901
|
||||
FIX: #14927 Change ContratLigne property type to product_type
|
||||
FIX: #14979
|
||||
FIX: #15074
|
||||
FIX: #15111 Fix special characters output in PDF
|
||||
FIX: #15161 MO translation conflict
|
||||
FIX: #15163
|
||||
FIX: #15199
|
||||
FIX: #15208
|
||||
FIX: #15303
|
||||
FIX: #15365 export of extrafields for user and resources
|
||||
FIX: #15374 : "New" doesn't clear total amounts
|
||||
FIX: #15501
|
||||
FIX: #15572
|
||||
FIX: #15590
|
||||
FIX: #15618
|
||||
FIX: supplier proposals as linked objects of events are not correctly fetched
|
||||
FIX: when users create an event from a supplier proposal, the "linked objects" section says "Deleted"
|
||||
FIX: Accountancy - Some ajustments on length of the account (general & auxiliary)
|
||||
FIX: admin conf selected
|
||||
FIX: also check if there is a method $object->fetch_thirdparty() before calling it
|
||||
FIX: autofocus on first setup
|
||||
FIX: Bad rigths to send contract
|
||||
FIX: Better error message with IMAP when connection fails
|
||||
FIX: Can create user but not update user with activedirectory
|
||||
FIX: Can receipt of a product that required lot after disabling stock and
|
||||
FIX: Can't create shipment for virtual product. Add
|
||||
FIX: cant empty action comm desc
|
||||
FIX: CA report by product/service : subcategory filter
|
||||
FIX: Clean orphan records in llx_ecm_files into repair script.
|
||||
FIX: default accountancy values and posted values
|
||||
FIX: Deletion of expensereport + other generated object not complete.
|
||||
FIX: disabled users must not be available in sales representative list on societe edit mode
|
||||
FIX: Dol print error : conf usage thirdparty propagate extrafields to
|
||||
FIX: Don't display inactive users in birthday box and company card
|
||||
FIX: empty value is needed on filter list
|
||||
FIX: enable HTML in product labels depending on conf MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML
|
||||
FIX: error 500 on cash closure
|
||||
FIX: excess comma
|
||||
FIX: Export FEC - Remove line at zero
|
||||
FIX: extrafield required error after submit
|
||||
FIX: filter on project list
|
||||
FIX: force payment mode to withdraw
|
||||
FIX: formating of prices with foreign languages
|
||||
FIX: handling $heightforinfotot when he's superior to a page height
|
||||
FIX: if no PDF default model in admin for expense report, do not create a PDF
|
||||
FIX: invoice payment terms edition: error management
|
||||
FIX: list of fields in list of recurring invoices was empty
|
||||
FIX: load default linked options for linked sellist extra fields
|
||||
FIX: Loan - Return on list when you cancel create form or delete a loan
|
||||
FIX: Missing lang trans
|
||||
FIX: no empty value in required extrafield
|
||||
FIX: Param joinfiles not sanitized
|
||||
FIX: Payment by BankTransfer
|
||||
FIX: pdf_getlinetotalwithtax must show total incl tax
|
||||
FIX: Problem on supplier payment card
|
||||
FIX: product auto volume calculation
|
||||
FIX: product customer prices: missing triggers in CRUD class
|
||||
FIX: Request on purchase orders in timeout even on very small databases
|
||||
FIX: set paid on total discount of a product in cash desk
|
||||
FIX: several warning with the barcode use in ODT templates
|
||||
FIX: SHIP MODE install v12 bug insert
|
||||
FIX: stripe for connect mode
|
||||
FIX: subcat filter
|
||||
FIX: supplier invoice: automatically calculate payment term when modifying payment condition
|
||||
FIX: SUPPLIER PROPOSAL v12 bug add
|
||||
FIX: table making extrafield input too small on advance target mailing
|
||||
FIX: table making extrafield too small advtagertmailing
|
||||
FIX: Unable to edit extrafields in expense report
|
||||
FIX: update margins rates on object line edit
|
||||
FIX: uses price2numjs
|
||||
FIX: various payments: bad data handling for subledger account + useless db commit/rollback
|
||||
FIX: virtual products: displayed value is by unit
|
||||
FIX: virtual products: supplier discount was not applied in component list
|
||||
FIX: warning for purchase order delivery late.
|
||||
FIX: Warning on late purchase order delivery
|
||||
FIX: WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING must not consider services while STOCK_SUPPORTS_SERVICES is empty
|
||||
FIX: wrong tab
|
||||
FIX: Yogosha report 4425 (backport)
|
||||
FIX: Yogosha report 4434 (backport)
|
||||
|
||||
***** ChangeLog for 12.0.3 compared to 12.0.2 *****
|
||||
FIX: 10.0 - when the mime file name is different from the filesystem name, the attachment name should be the mime filename
|
||||
FIX: 11.0 - expenses lines overlapping the total amounts frame
|
||||
|
||||
@ -542,7 +542,7 @@ $cfg['ThemePerServer'] = FALSE; // allow diferent theme for each co
|
||||
* %f will be replaced by a list of field names.
|
||||
* (%t and %f only applies to DefaultQueryTable)
|
||||
*/
|
||||
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1 = 1';
|
||||
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
|
||||
$cfg['DefaultQueryDatabase'] = '';
|
||||
|
||||
/**
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
"vendor-dir" : "htdocs/includes"
|
||||
},
|
||||
"require" : {
|
||||
"php" : ">=5.6.0",
|
||||
"php" : ">=5.5.0",
|
||||
"ext-curl" : "*",
|
||||
"ckeditor/ckeditor" : "4.12.1",
|
||||
"mike42/escpos-php" : "2.2",
|
||||
|
||||
@ -175,18 +175,6 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
|
||||
- protected $default_monospaced_font = 'courier';
|
||||
+ protected $default_monospaced_font = 'freemono';
|
||||
|
||||
* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
|
||||
of the function, replace:
|
||||
|
||||
$roman = '';
|
||||
|
||||
with:
|
||||
|
||||
$roman = '';
|
||||
if ($number >= 4000) {
|
||||
// do not represent numbers above 4000 in Roman numerals
|
||||
return strval($number);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -332,7 +320,7 @@ SELECT2
|
||||
Edit CSS to restore line removed between 4.0.5 and 4.0.6. It generates this bug: https://github.com/select2/select2/issues/5832
|
||||
|
||||
.select2-hidden-accessible {
|
||||
margin: -10000px !important; /* line to restore */
|
||||
margin: -1px !important; /* line to restore */
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -17,6 +17,8 @@ on Internet on web following sites:<br>
|
||||
<br>
|
||||
* <a href="https://demo.dolibarr.org">Dolibarr demo (online)</a><br>
|
||||
<br>
|
||||
* <a href="https://www.nltechno.com/pages/dolibarrwinbin.php">DoliWamp, the Dolibarr for Windows</a><br>
|
||||
<br>
|
||||
* <a href="https://www.dolistore.com">DoliStore (official addons/plugins market place)</a><br>
|
||||
|
||||
</body>
|
||||
|
||||
@ -19,7 +19,7 @@ Download
|
||||
Install
|
||||
--------------------------------
|
||||
|
||||
* For a Quick guide, take a look at README.md file into root directory.
|
||||
* For a Quick guide, take a look at README file into root directory.
|
||||
|
||||
* More complete documentations are also available on line on the Dolibarr Wiki:
|
||||
https://wiki.dolibarr.org
|
||||
|
||||
@ -22,7 +22,7 @@ Download / Herunterladen
|
||||
Installation
|
||||
--------------------------------
|
||||
|
||||
* Für eine kurze Einleitung, schau auf die README.md Datei im Hauptverzeichnis.
|
||||
* Für eine kurze Einleitung, schau auf die README Datei im Hauptverzeichnis.
|
||||
|
||||
* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden:
|
||||
https://wiki.dolibarr.org/index.php/Hauptseite
|
||||
|
||||
@ -19,7 +19,9 @@ https://www.dolistore.org
|
||||
Documentation utilisateur
|
||||
--------------------------------
|
||||
|
||||
* Pour une prise en main et installation rapide, consultez le fichier README-FR.md à la racine.
|
||||
* Pour une prise en main et installation rapide, consultez le fichier
|
||||
README-FR à la racine.
|
||||
|
||||
* Une documentation utilisateur francophone plus consistante est disponible en ligne sur le wiki de Dolibarr à l'adresse:
|
||||
https://wiki.dolibarr.org
|
||||
* Une documentation utilisateur francophone plus consistante est disponible en
|
||||
ligne sur le wiki de Dolibarr à l'adresse:
|
||||
https://wiki.dolibarr.org
|
||||
|
||||
@ -4,5 +4,4 @@ User guide
|
||||
--------------------------------
|
||||
|
||||
* All Dolibarr guides are available, on line, on the Dolibarr Web site:
|
||||
|
||||
https://www.dolibarr.org
|
||||
|
||||
@ -3,6 +3,9 @@ README (french)
|
||||
Documentation utilisateur
|
||||
--------------------------------
|
||||
|
||||
La documentation utilisateur francophone est disponible en ligne sur le site Web de Dolibarr à l'adresse:
|
||||
* Pour une prise en main et installation rapide, consultez le fichier
|
||||
README-FR à la racine.
|
||||
|
||||
* Une documentation utilisateur francophone plus consistante est disponible en
|
||||
ligne sur le site Web de Dolibarr à l'adresse:
|
||||
https://www.dolibarr.fr
|
||||
|
||||
@ -618,7 +618,7 @@ if ($result)
|
||||
if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy;
|
||||
$codesell = length_accountg($obj->accountancy_code_buy);
|
||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
||||
print '</td>';
|
||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||
// Accounting account buy intra (In EEC)
|
||||
@ -628,7 +628,7 @@ if ($result)
|
||||
$codesell = length_accountg($obj->accountancy_code_buy_intra);
|
||||
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
||||
print '</td>';
|
||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||
// Accounting account buy export (Out of EEC)
|
||||
@ -638,7 +638,7 @@ if ($result)
|
||||
$codesell = length_accountg($obj->accountancy_code_buy_export);
|
||||
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
||||
print '</td>';
|
||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
||||
// Accounting account sell
|
||||
@ -648,7 +648,7 @@ if ($result)
|
||||
$codesell = length_accountg($obj->accountancy_code_sell);
|
||||
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
||||
print '</td>';
|
||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
||||
// Accounting account sell intra (In EEC)
|
||||
@ -658,7 +658,7 @@ if ($result)
|
||||
$codesell = length_accountg($obj->accountancy_code_sell_intra);
|
||||
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
||||
print '</td>';
|
||||
} else {
|
||||
// Accounting account sell export (Out of EEC)
|
||||
@ -667,13 +667,13 @@ if ($result)
|
||||
if (empty($defaultvalue)) $defaultvalue = $compta_prodsell;
|
||||
$codesell = length_accountg($obj->accountancy_code_sell_export);
|
||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Checkbox select
|
||||
print '<td class="center">';
|
||||
print '<input type="checkbox" class="checkforselect productforselectcodeventil_'.$product_static->id.'" name="chk_prod[]" value="'.$obj->rowid.'"/></td>';
|
||||
print '<input type="checkbox" class="checkforselect" name="chk_prod[]" value="'.$obj->rowid.'"/></td>';
|
||||
print "</tr>";
|
||||
$i++;
|
||||
}
|
||||
@ -697,17 +697,7 @@ if ($result)
|
||||
if (atleastoneselected) jQuery("#changeaccount").attr(\'class\',\'button\');
|
||||
else jQuery("#changeaccount").attr(\'class\',\'button\');
|
||||
}
|
||||
|
||||
jQuery(".checkforselect").change(function() {
|
||||
init_savebutton();
|
||||
});
|
||||
jQuery(".productforselect").change(function() {
|
||||
console.log($(this).attr("id")+" "+$(this).val());
|
||||
if ($(this).val() && $(this).val() != -1) {
|
||||
$(".productforselect"+$(this).attr("id")).prop(\'checked\', true);
|
||||
} else {
|
||||
$(".productforselect"+$(this).attr("id")).prop(\'checked\', false);
|
||||
}
|
||||
jQuery(".checkforselect, #checkallactions").click(function() {
|
||||
init_savebutton();
|
||||
});
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ $form = new Form($db);
|
||||
if (empty($search_date_start) && !GETPOSTISSET('formfilteraction'))
|
||||
{
|
||||
$sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
|
||||
$sql .= " WHERE date_start < '".$db->idate(dol_now())."' AND date_end > '".$db->idate(dol_now())."'";
|
||||
$sql .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";
|
||||
$sql .= $db->plimit(1);
|
||||
$res = $db->query($sql);
|
||||
if ($res->num_rows > 0) {
|
||||
@ -87,7 +87,6 @@ if (empty($search_date_start) && !GETPOSTISSET('formfilteraction'))
|
||||
} else {
|
||||
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||
$year_start = dol_print_date(dol_now(), '%Y');
|
||||
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
|
||||
$year_end = $year_start + 1;
|
||||
$month_end = $month_start - 1;
|
||||
if ($month_end < 1)
|
||||
@ -158,11 +157,11 @@ if ($action == 'export_csv')
|
||||
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
print '"'.length_accountg($line->numero_compte).'"'.$sep;
|
||||
print '"'.$object->get_compte_desc($line->numero_compte).'"'.$sep;
|
||||
print '"'.price($line->debit).'"'.$sep;
|
||||
print '"'.price($line->credit).'"'.$sep;
|
||||
print '"'.price($line->debit - $line->credit).'"'.$sep;
|
||||
print length_accountg($line->numero_compte).$sep;
|
||||
print $object->get_compte_desc($line->numero_compte).$sep;
|
||||
print price($line->debit).$sep;
|
||||
print price($line->credit).$sep;
|
||||
print price($line->debit - $line->credit).$sep;
|
||||
print "\n";
|
||||
}
|
||||
|
||||
@ -238,8 +237,7 @@ if ($action != 'export_csv')
|
||||
print '<table class="liste '.($moreforfilter ? "listwithfilterbefore" : "").'">';
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
$colspan = (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE) ? 6 : 5);
|
||||
print '<td class="liste_titre" colspan="'.$colspan.'">';
|
||||
print '<td class="liste_titre" colspan="6">';
|
||||
print $langs->trans('From');
|
||||
print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, '');
|
||||
print ' ';
|
||||
@ -256,7 +254,7 @@ if ($action != 'export_csv')
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) print_liste_field_titre("OpeningBalance", $_SERVER['PHP_SELF'], "", $param, "", 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("OpeningBalance", $_SERVER['PHP_SELF'], "", $param, "", 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder);
|
||||
@ -267,28 +265,20 @@ if ($action != 'export_csv')
|
||||
$total_credit = 0;
|
||||
$sous_total_debit = 0;
|
||||
$sous_total_credit = 0;
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
$total_opening_balance = 0;
|
||||
$sous_total_opening_balance = 0;
|
||||
}
|
||||
$displayed_account = "";
|
||||
|
||||
// TODO Debug - In French accounting, this functionality is dangerous, it takes all the entries and adds all the accounts
|
||||
// without time and class limits (Class 6 and 7 accounts ???) and does not take into account the "a-nouveau" journal.
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
$sql = "SELECT t.numero_compte, (SUM(t.debit) - SUM(t.credit)) as opening_balance";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as t";
|
||||
$sql .= " WHERE t.entity = " . $conf->entity; // Never do sharing into accounting features
|
||||
$sql .= " AND t.doc_date < '" . $db->idate($search_date_start) . "'";
|
||||
$sql .= " GROUP BY t.numero_compte";
|
||||
$sql = "SELECT t.numero_compte, (SUM(t.debit) - SUM(t.credit)) as opening_balance";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as t";
|
||||
$sql .= " WHERE t.entity = ".$conf->entity; // Never do sharing into accounting features
|
||||
$sql .= " AND t.doc_date < '".$db->idate($search_date_start)."'";
|
||||
$sql .= " GROUP BY t.numero_compte";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$nrows = $resql->num_rows;
|
||||
$opening_balances = array();
|
||||
for ($i = 0; $i < $nrows; $i++) {
|
||||
$arr = $resql->fetch_array();
|
||||
$opening_balances["'" . $arr['numero_compte'] . "'"] = $arr['opening_balance'];
|
||||
}
|
||||
$resql = $db->query($sql);
|
||||
$nrows = $resql->num_rows;
|
||||
$opening_balances = array();
|
||||
for ($i = 0; $i < $nrows; $i++) {
|
||||
$arr = $resql->fetch_array();
|
||||
$opening_balances["'".$arr['numero_compte']."'"] = $arr['opening_balance'];
|
||||
}
|
||||
|
||||
foreach ($object->lines as $line)
|
||||
@ -298,10 +288,6 @@ if ($action != 'export_csv')
|
||||
$total_credit += $line->credit;
|
||||
$description = $object->get_compte_desc($line->numero_compte); // Search description of the account
|
||||
$root_account_description = $object->get_compte_racine($line->numero_compte);
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
$opening_balance = isset($opening_balances["'".$line->numero_compte."'"]) ? $opening_balances["'".$line->numero_compte."'"] : 0;
|
||||
$total_opening_balance += $opening_balance;
|
||||
}
|
||||
if (empty($description)) {
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?action=create&accountingaccount='.length_accountg($line->numero_compte).'">'.img_edit_add().'</a>';
|
||||
}
|
||||
@ -312,39 +298,29 @@ if ($action != 'export_csv')
|
||||
{
|
||||
// Display a sub-total per account
|
||||
if ($displayed_account != "") {
|
||||
print '<tr class="liste_total"><td class="right" colspan="2">'.$langs->trans("SubTotal").':</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) print '<td class="nowrap right">'.price($sous_total_opening_balance).'</td>';
|
||||
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
|
||||
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
|
||||
print '<td class="nowrap right">'.price(price2num($sous_total_credit - $sous_total_debit)).'</td>';
|
||||
print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("SubTotal").':</td><td class="nowrap right">'.price($sous_total_debit).'</td><td class="nowrap right">'.price($sous_total_credit).'</td><td class="nowrap right">'.price(price2num($sous_total_credit - $sous_total_debit)).'</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Show first line of a break
|
||||
print '<tr class="trforbreak">';
|
||||
$colspan = (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE) ? 7 : 6);
|
||||
print '<td colspan="'.$colspan.'" style="font-weight:bold; border-bottom: 1pt solid black;">'.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'</td>';
|
||||
print '<td colspan="7" style="font-weight:bold; border-bottom: 1pt solid black;">'.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$displayed_account = $root_account_description;
|
||||
$sous_total_debit = 0;
|
||||
$sous_total_credit = 0;
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) $sous_total_opening_balance = 0;
|
||||
}
|
||||
|
||||
// $object->get_compte_racine($line->numero_compte);
|
||||
|
||||
print '<td>'.length_accountg($line->numero_compte).'</td>';
|
||||
print '<td>'.$description.'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) print '<td class="nowraponall right">'.price($opening_balance).'</td>';
|
||||
print '<td class="nowraponall right">'.price($opening_balances["'".$line->numero_compte."'"]).'</td>';
|
||||
print '<td class="nowraponall right">'.price($line->debit).'</td>';
|
||||
print '<td class="nowraponall right">'.price($line->credit).'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowraponall right">'.price($opening_balance + $line->debit - $line->credit).'</td>';
|
||||
} else {
|
||||
print '<td class="nowraponall right">'.price($line->debit - $line->credit).'</td>';
|
||||
}
|
||||
print '<td class="nowraponall right">'.price($line->debit - $line->credit).'</td>';
|
||||
print '<td class="center">'.$link;
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
@ -352,30 +328,13 @@ if ($action != 'export_csv')
|
||||
// Records the sub-total
|
||||
$sous_total_debit += $line->debit;
|
||||
$sous_total_credit += $line->credit;
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) $sous_total_opening_balance += $opening_balance;
|
||||
}
|
||||
|
||||
print '<tr class="liste_total"><td class="right" colspan="2">'.$langs->trans("SubTotal").':</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) print '<td class="nowrap right">'.price($sous_total_opening_balance).'</td>';
|
||||
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
|
||||
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
||||
} else {
|
||||
print '<td class="nowrap right">' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
||||
}
|
||||
print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("SubTotal").':</td><td class="nowrap right">'.price($sous_total_debit).'</td><td class="nowrap right">'.price($sous_total_credit).'</td><td class="nowrap right">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_total"><td class="right" colspan="2">'.$langs->trans("AccountBalance").':</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) print '<td class="nowrap right">'.price($total_opening_balance).'</td>';
|
||||
print '<td class="nowrap right">'.price($total_debit).'</td>';
|
||||
print '<td class="nowrap right">'.price($total_credit).'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
|
||||
} else {
|
||||
print '<td class="nowrap right">' . price(price2num($total_debit - $total_credit, 'MT')) . '</td>';
|
||||
}
|
||||
print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("AccountBalance").':</td><td class="nowrap right">'.price($total_debit).'</td><td class="nowrap right">'.price($total_credit).'</td><td class="nowrap right">'.price(price2num($total_debit - $total_credit)).'</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -45,14 +45,14 @@ $search_mvt_num = GETPOST('search_mvt_num', 'int');
|
||||
$search_doc_type = GETPOST("search_doc_type", 'alpha');
|
||||
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||
$search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmonth', 'int'), GETPOST('date_creation_startday', 'int'), GETPOST('date_creation_startyear', 'int'));
|
||||
$search_date_creation_end = dol_mktime(23, 59, 59, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
|
||||
$search_date_creation_end = dol_mktime(0, 0, 0, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
|
||||
$search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int'));
|
||||
$search_date_modification_end = dol_mktime(23, 59, 59, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
|
||||
$search_date_modification_end = dol_mktime(0, 0, 0, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
|
||||
$search_date_export_start = dol_mktime(0, 0, 0, GETPOST('date_export_startmonth', 'int'), GETPOST('date_export_startday', 'int'), GETPOST('date_export_startyear', 'int'));
|
||||
$search_date_export_end = dol_mktime(23, 59, 59, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
|
||||
$search_date_export_end = dol_mktime(0, 0, 0, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
|
||||
|
||||
//var_dump($search_date_start);exit;
|
||||
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
|
||||
|
||||
@ -40,7 +40,7 @@ $langs->loadLangs(array("accountancy"));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||
|
||||
$search_accountancy_code = GETPOST("search_accountancy_code");
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
|
||||
* Copyright (C) 2016-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2017 Elarifr. Ari Elbaz <github@accedinfo.com>
|
||||
* Copyright (C) 2017-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
@ -332,9 +332,9 @@ class AccountancyExport
|
||||
print length_accountg($line->numero_compte).$separator;
|
||||
print length_accounta($line->subledger_account).$separator;
|
||||
print $line->sens.$separator;
|
||||
print price2fec(abs($line->montant)).$separator;
|
||||
print dol_string_unaccent($line->label_operation).$separator;
|
||||
print dol_string_unaccent($line->doc_ref);
|
||||
print price($line->montant).$separator;
|
||||
print $line->label_operation.$separator;
|
||||
print $line->doc_ref;
|
||||
print $end_line;
|
||||
}
|
||||
}
|
||||
@ -386,7 +386,6 @@ class AccountancyExport
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
|
||||
|
||||
print $date.$separator;
|
||||
print $line->code_journal.$separator;
|
||||
print length_accountg($line->numero_compte).$separator;
|
||||
@ -395,7 +394,7 @@ class AccountancyExport
|
||||
print price($line->debit).$separator;
|
||||
print price($line->credit).$separator;
|
||||
print 'E'.$separator;
|
||||
print length_accounta($line->subledger_account).$separator;
|
||||
print length_accountg($line->subledger_account).$separator;
|
||||
print $end_line;
|
||||
}
|
||||
}
|
||||
@ -439,43 +438,33 @@ class AccountancyExport
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : CIEL (Format XIMPORT)
|
||||
* Format since 2003 compatible CIEL version > 2002 / Sage50
|
||||
* Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
*
|
||||
* Help : https://sage50c.online-help.sage.fr/aide-technique/
|
||||
* In sage software | Use menu : "Exchange" > "Importing entries..."
|
||||
*
|
||||
* If you want to force filename to "XIMPORT.TXT" for automatically import file present in a directory :
|
||||
* use constant ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME
|
||||
* Export format : CIEL
|
||||
*
|
||||
* @param array $TData data
|
||||
* @return void
|
||||
*/
|
||||
public function exportCiel(&$TData)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$end_line = "\r\n";
|
||||
|
||||
$i = 1;
|
||||
|
||||
$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd
|
||||
foreach ($TData as $data) {
|
||||
$code_compta = length_accountg($data->numero_compte);
|
||||
if (!empty($data->subledger_account)) {
|
||||
$code_compta = length_accounta($data->subledger_account);
|
||||
}
|
||||
|
||||
$date_document = dol_print_date($data->doc_date, '%Y%m%d');
|
||||
$date_echeance = dol_print_date($data->date_lim_reglement, '%Y%m%d');
|
||||
$code_compta = $data->numero_compte;
|
||||
if (!empty($data->subledger_account))
|
||||
$code_compta = $data->subledger_account;
|
||||
|
||||
$Tab = array();
|
||||
$Tab['num_ecriture'] = str_pad($data->piece_num, 5);
|
||||
$Tab['num_ecriture'] = str_pad($i, 5);
|
||||
$Tab['code_journal'] = str_pad($data->code_journal, 2);
|
||||
$Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12);
|
||||
$Tab['date_ecriture'] = $date_ecriture;
|
||||
$Tab['date_ope'] = dol_print_date($data->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['num_piece'] = str_pad(self::trunc($data->piece_num, 12), 12);
|
||||
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 11), 11);
|
||||
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25);
|
||||
$Tab['montant'] = str_pad(price2fec(abs($data->montant)), 13, ' ', STR_PAD_LEFT);
|
||||
$Tab['montant'] = str_pad(abs($data->montant), 13, ' ', STR_PAD_LEFT);
|
||||
$Tab['type_montant'] = str_pad($data->sens, 1);
|
||||
$Tab['vide'] = str_repeat(' ', 18);
|
||||
$Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34);
|
||||
@ -529,8 +518,9 @@ class AccountancyExport
|
||||
$Tab['contrepartie'] = str_repeat(' ', 8);
|
||||
|
||||
// elarifr: date format must be fixed format : 6 char ddmmyy = %d%m%yand not defined by user / dolibarr setting
|
||||
if (!empty($data->date_lim_reglement))
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%y'); // elarifr: format must be ddmmyy
|
||||
if (!empty($data->date_echeance))
|
||||
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y'); // elarifr: format must be ddmmyy
|
||||
else
|
||||
$Tab['date_echeance'] = '000000';
|
||||
|
||||
@ -626,8 +616,9 @@ class AccountancyExport
|
||||
|
||||
$Tab['code_stat'] = str_repeat(' ', 4);
|
||||
|
||||
if (!empty($data->date_lim_reglement))
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%Y');
|
||||
if (!empty($data->date_echeance))
|
||||
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%Y');
|
||||
else
|
||||
$Tab['date_echeance'] = dol_print_date($data->doc_date, '%d%m%Y');
|
||||
|
||||
@ -793,7 +784,7 @@ class AccountancyExport
|
||||
public function exportFEC($objectLines)
|
||||
{
|
||||
$separator = "\t";
|
||||
$end_line = "\r\n";
|
||||
$end_line = "\n";
|
||||
|
||||
print "JournalCode".$separator;
|
||||
print "JournalLib".$separator;
|
||||
@ -816,70 +807,65 @@ class AccountancyExport
|
||||
print $end_line;
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
if ($line->debit == 0 && $line->credit == 0) {
|
||||
unset($array[$line]);
|
||||
} else {
|
||||
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
|
||||
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
|
||||
$date_lettering = dol_print_date($line->date_lettering, '%Y%m%d');
|
||||
$date_validation = dol_print_date($line->date_validated, '%Y%m%d');
|
||||
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
|
||||
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
|
||||
$date_validation = dol_print_date($line->date_validated, '%Y%m%d');
|
||||
|
||||
// FEC:JournalCode
|
||||
print $line->code_journal.$separator;
|
||||
// FEC:JournalCode
|
||||
print $line->code_journal.$separator;
|
||||
|
||||
// FEC:JournalLib
|
||||
print $line->journal_label.$separator;
|
||||
// FEC:JournalLib
|
||||
print $line->journal_label.$separator;
|
||||
|
||||
// FEC:EcritureNum
|
||||
print $line->piece_num.$separator;
|
||||
// FEC:EcritureNum
|
||||
print $line->piece_num.$separator;
|
||||
|
||||
// FEC:EcritureDate
|
||||
print $date_document . $separator;
|
||||
// FEC:EcritureDate
|
||||
print $date_document . $separator;
|
||||
|
||||
// FEC:CompteNum
|
||||
print $line->numero_compte.$separator;
|
||||
// FEC:CompteNum
|
||||
print $line->numero_compte.$separator;
|
||||
|
||||
// FEC:CompteLib
|
||||
print dol_string_unaccent($line->label_compte) . $separator;
|
||||
// FEC:CompteLib
|
||||
print dol_string_unaccent($line->label_compte) . $separator;
|
||||
|
||||
// FEC:CompAuxNum
|
||||
print $line->subledger_account.$separator;
|
||||
// FEC:CompAuxNum
|
||||
print $line->subledger_account.$separator;
|
||||
|
||||
// FEC:CompAuxLib
|
||||
print dol_string_unaccent($line->subledger_label).$separator;
|
||||
// FEC:CompAuxLib
|
||||
print dol_string_unaccent($line->subledger_label) . $separator;
|
||||
|
||||
// FEC:PieceRef
|
||||
print $line->doc_ref.$separator;
|
||||
// FEC:PieceRef
|
||||
print $line->doc_ref.$separator;
|
||||
|
||||
// FEC:PieceDate
|
||||
print $date_creation.$separator;
|
||||
// FEC:PieceDate
|
||||
print dol_string_unaccent($date_creation) . $separator;
|
||||
|
||||
// FEC:EcritureLib
|
||||
print dol_string_unaccent($line->label_operation).$separator;
|
||||
// FEC:EcritureLib
|
||||
print $line->label_operation.$separator;
|
||||
|
||||
// FEC:Debit
|
||||
print price2fec($line->debit).$separator;
|
||||
// FEC:Debit
|
||||
print price2fec($line->debit).$separator;
|
||||
|
||||
// FEC:Credit
|
||||
print price2fec($line->credit).$separator;
|
||||
// FEC:Credit
|
||||
print price2fec($line->credit).$separator;
|
||||
|
||||
// FEC:EcritureLet
|
||||
print $line->lettering_code.$separator;
|
||||
// FEC:EcritureLet
|
||||
print $line->lettering_code.$separator;
|
||||
|
||||
// FEC:DateLet
|
||||
print $date_lettering.$separator;
|
||||
// FEC:DateLet
|
||||
print $line->date_lettering.$separator;
|
||||
|
||||
// FEC:ValidDate
|
||||
print $date_validation.$separator;
|
||||
// FEC:ValidDate
|
||||
print $date_validation . $separator;
|
||||
|
||||
// FEC:Montantdevise
|
||||
print $line->multicurrency_amount.$separator;
|
||||
// FEC:Montantdevise
|
||||
print $line->multicurrency_amount.$separator;
|
||||
|
||||
// FEC:Idevise
|
||||
print $line->multicurrency_code;
|
||||
// FEC:Idevise
|
||||
print $line->multicurrency_code;
|
||||
|
||||
print $end_line;
|
||||
}
|
||||
print $end_line;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -365,7 +365,7 @@ class BookKeeping extends CommonObject
|
||||
$sql .= ", ".(!empty($this->subledger_account) ? ("'".$this->db->escape($this->subledger_account)."'") : "NULL");
|
||||
$sql .= ", ".(!empty($this->subledger_label) ? ("'".$this->db->escape($this->subledger_label)."'") : "NULL");
|
||||
$sql .= ", '".$this->db->escape($this->numero_compte)."'";
|
||||
$sql .= ", ".(!empty($this->label_compte) ? ("'".$this->db->escape($this->label_compte)."'") : "NULL");
|
||||
$sql .= ", ".(!empty($this->label_operation) ? ("'".$this->db->escape($this->label_operation)."'") : "NULL");
|
||||
$sql .= ", '".$this->db->escape($this->label_operation)."'";
|
||||
$sql .= ", ".$this->debit;
|
||||
$sql .= ", ".$this->credit;
|
||||
|
||||
@ -121,9 +121,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE rowid IN ('.implode(',', $changeaccount).')';
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
|
||||
|
||||
dol_syslog('accountancy/customer/lines.php::changeaccount sql= '.$sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
|
||||
@ -93,88 +93,87 @@ if ($conf->accounting->enabled)
|
||||
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
|
||||
print "<br>\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
||||
if (!empty($user->rights->accounting->chartofaccount)){
|
||||
print "<br>\n"; print "<br>\n";
|
||||
print "<br>\n"; print "<br>\n";
|
||||
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
|
||||
// STEPS
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
// STEPS
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
|
||||
print "<br>\n";
|
||||
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>')."\n";
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
||||
print "<br>\n";
|
||||
if (!empty($conf->tax->enabled))
|
||||
{
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
||||
print "<br>\n";
|
||||
}
|
||||
/*if (! empty($conf->salaries->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
// htdocs/admin/salaries.php
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}*/
|
||||
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
}
|
||||
/*
|
||||
if (! empty($conf->loan->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").' - '.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->adherents->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSubscription", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}*/
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>');
|
||||
print "<br>\n";
|
||||
|
||||
print '<br>';
|
||||
$step++;
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
||||
print "<br>\n";
|
||||
if (!empty($conf->tax->enabled))
|
||||
{
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
||||
print "<br>\n";
|
||||
}
|
||||
/*if (! empty($conf->salaries->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
// htdocs/admin/salaries.php
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}*/
|
||||
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
}
|
||||
/*
|
||||
if (! empty($conf->loan->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").' - '.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->adherents->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSubscription", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}*/
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>');
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Step A - E
|
||||
|
||||
|
||||
@ -863,7 +863,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["type_payment"].'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print " ".$sep;
|
||||
print '"'.$reflabel.'"'.$sep;
|
||||
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
||||
@ -893,7 +893,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"'.$key.'"'.$sep;
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["type_payment"].'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
if ($tabtype[$key] == 'payment_supplier') {
|
||||
print '"'.$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER.'"'.$sep;
|
||||
} elseif ($tabtype[$key] == 'payment') {
|
||||
@ -903,7 +903,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
} elseif ($tabtype[$key] == 'payment_salary') {
|
||||
print '"'.$conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT.'"'.$sep;
|
||||
} else {
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
}
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$reflabel.'"'.$sep;
|
||||
@ -926,7 +926,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["type_payment"].'"'.$sep;
|
||||
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE).'"'.$sep;
|
||||
print '"'.length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE).'"'.$sep;
|
||||
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE).'"'.$sep;
|
||||
print "".$sep;
|
||||
print '"'.$reflabel.'"'.$sep;
|
||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||
@ -1130,7 +1130,7 @@ if (empty($action) || $action == 'view') {
|
||||
if ($tabtype[$key] == 'payment_vat') $account_ledger = $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT;
|
||||
if ($tabtype[$key] == 'member') $account_ledger = $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT;
|
||||
if ($tabtype[$key] == 'payment_various') $account_ledger = $tabpay[$key]["account_various"];
|
||||
$accounttoshow = length_accountg($account_ledger);
|
||||
$accounttoshow = length_accounta($account_ledger);
|
||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
||||
{
|
||||
if ($tabtype[$key] == 'unknown')
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
@ -608,7 +608,7 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>".$expensereportstatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
|
||||
$accountoshow = length_accounta($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("MainAccountForUsersNotDefined").'</span>';
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
@ -92,7 +92,7 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))
|
||||
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
|
||||
}
|
||||
|
||||
$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlr, f.close_code,";
|
||||
$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,";
|
||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
|
||||
$sql .= " p.accountancy_code_buy , aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
|
||||
@ -628,7 +628,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"'.$val["refsologest"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER).'"'.$sep;
|
||||
print '"'.$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER.'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||
@ -694,9 +694,9 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["refsologest"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("VAT").' NPR"'.$sep;
|
||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||
@ -867,7 +867,7 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
|
||||
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("MainAccountForSuppliersNotDefined").'</span>';
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
@ -586,7 +586,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"'.$val["ref"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER).'"'.$sep;
|
||||
print '"'.$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER.'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||
@ -803,7 +803,7 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
|
||||
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("MainAccountForCustomersNotDefined").'</span>';
|
||||
|
||||
@ -123,9 +123,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det";
|
||||
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE rowid IN ('.implode(',', $changeaccount).')';
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
|
||||
|
||||
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= '.$sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
|
||||
@ -58,9 +58,9 @@ if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$
|
||||
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
|
||||
|
||||
$completefilename = $siren."FEC".$endaccountingperiod.".txt";
|
||||
} elseif ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_CIEL && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
|
||||
$completefilename = "XIMPORT.TXT";
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;
|
||||
}
|
||||
|
||||
|
||||
@ -286,7 +286,7 @@ if (empty($reshook))
|
||||
$object->firstname = trim(GETPOST("firstname", 'alphanohtml'));
|
||||
$object->lastname = trim(GETPOST("lastname", 'alphanohtml'));
|
||||
$object->gender = trim(GETPOST("gender", 'alphanohtml'));
|
||||
$object->login = trim(GETPOST("login", 'alphanohtml'));
|
||||
$object->login = trim(GETPOST("login", 'alpha'));
|
||||
$object->pass = trim(GETPOST("pass", 'alpha'));
|
||||
|
||||
$object->societe = trim(GETPOST("societe", 'alphanohtml')); // deprecated
|
||||
@ -326,7 +326,7 @@ if (empty($reshook))
|
||||
$object->public = GETPOST("public", 'alpha');
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
// Check if we need to also synchronize user information
|
||||
@ -459,7 +459,7 @@ if (empty($reshook))
|
||||
// $facebook=GETPOST("member_facebook", 'alpha');
|
||||
// $linkedin=GETPOST("member_linkedin", 'alpha');
|
||||
$email = preg_replace('/\s+/', '', GETPOST("member_email", 'alpha'));
|
||||
$login = GETPOST("member_login", 'alphanohtml');
|
||||
$login = GETPOST("member_login", 'alpha');
|
||||
$pass = GETPOST("password", 'alpha');
|
||||
$photo = GETPOST("photo", 'alpha');
|
||||
//$comment=GETPOST("comment",'none');
|
||||
@ -941,7 +941,7 @@ else
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" class="minwidth300" maxlength="50" value="'.(GETPOSTISSET("member_login") ? GETPOST("member_login", 'alphanohtml', 2) : $object->login).'" autofocus="autofocus"></td></tr>';
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" class="minwidth300" maxlength="50" value="'.(isset($_POST["member_login"]) ?GETPOST("member_login", 'alpha', 2) : $object->login).'" autofocus="autofocus"></td></tr>';
|
||||
}
|
||||
|
||||
// Password
|
||||
@ -1185,7 +1185,7 @@ else
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="login" class="minwidth300" maxlength="50" value="'.(GETPOSTISSET("login") ? GETPOST("login", 'alphanohtml', 2) : $object->login).'"></td></tr>';
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="login" class="minwidth300" maxlength="50" value="'.(isset($_POST["login"]) ?GETPOST("login", 'alpha', 2) : $object->login).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Password
|
||||
|
||||
@ -1380,7 +1380,7 @@ class Adherent extends CommonObject
|
||||
$this->first_subscription_amount = $obj->subscription;
|
||||
}
|
||||
$this->last_subscription_date = $this->db->jdate($obj->datec);
|
||||
$this->last_subscription_date_start = $this->db->jdate($obj->dateh);
|
||||
$this->last_subscription_date_start = $this->db->jdate($obj->datef);
|
||||
$this->last_subscription_date_end = $this->db->jdate($obj->datef);
|
||||
$this->last_subscription_amount = $obj->subscription;
|
||||
|
||||
|
||||
@ -257,18 +257,13 @@ class Subscription extends CommonObject
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
if (!is_numeric($this->amount)) {
|
||||
$this->error = 'BadValueForParameterAmount';
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
|
||||
$sql .= " fk_type = ".$this->fk_type.",";
|
||||
$sql .= " fk_adherent = ".$this->fk_adherent.",";
|
||||
$sql .= " note=".($this->note ? "'".$this->db->escape($this->note)."'" : 'null').",";
|
||||
$sql .= " subscription = ".price2num($this->amount).",";
|
||||
$sql .= " subscription = '".price2num($this->amount)."',";
|
||||
$sql .= " dateadh='".$this->db->idate($this->dateh)."',";
|
||||
$sql .= " datef='".$this->db->idate($this->datef)."',";
|
||||
$sql .= " datec='".$this->db->idate($this->datec)."',";
|
||||
|
||||
@ -865,7 +865,7 @@ while ($i < min($num, $limit))
|
||||
else
|
||||
{
|
||||
print '<td class="nowrap left">';
|
||||
if (!empty($obj->subscription))
|
||||
if ($obj->subscription == 'yes')
|
||||
{
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($obj->statut > 0) print " ".img_warning();
|
||||
|
||||
@ -175,7 +175,7 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
||||
$object->vote = (boolean) trim($vote);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
$ret = $object->update($user);
|
||||
@ -510,7 +510,7 @@ if ($rowid > 0)
|
||||
$sql .= " AND t.rowid = ".$object->id;
|
||||
if ($sall)
|
||||
{
|
||||
$sql .= natural_search(array("d.firstname", "d.lastname", "d.societe", "d.email", "d.login", "d.address", "d.town", "d.note_public", "d.note_private"), $sall);
|
||||
$sql .= natural_search(array("f.firstname", "d.lastname", "d.societe", "d.email", "d.login", "d.address", "d.town", "d.note_public", "d.note_private"), $sall);
|
||||
}
|
||||
if ($status != '')
|
||||
{
|
||||
@ -709,7 +709,7 @@ if ($rowid > 0)
|
||||
else
|
||||
{
|
||||
print '<td class="nowrap left">';
|
||||
if (!empty($objp->subscription))
|
||||
if ($objp->subscription == 'yes')
|
||||
{
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($objp->statut > 0) print " ".img_warning();
|
||||
|
||||
@ -66,7 +66,6 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
||||
|
||||
if ($action != 'updateedit' && !$error)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -256,7 +256,6 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
@ -422,7 +421,7 @@ print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans(
|
||||
|
||||
// Name
|
||||
print '<tr class="oddeven"><td class="fieldrequired wordbreak"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM ? $conf->global->MAIN_INFO_SOCIETE_NOM : GETPOST("nom", 'nohtml')).'"'.(empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? ' autofocus="autofocus"' : '').'></td></tr>'."\n";
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM ? $conf->global->MAIN_INFO_SOCIETE_NOM : GETPOST("nom", 'nohtml')).'"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
||||
|
||||
// Address
|
||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||
|
||||
@ -577,7 +577,6 @@ if ($id == 11)
|
||||
// 'contract' => $langs->trans('Contract'),
|
||||
'project' => $langs->trans('Project'),
|
||||
'project_task' => $langs->trans('Task'),
|
||||
'ticket' => $langs->trans('Ticket'),
|
||||
'agenda' => $langs->trans('Agenda'),
|
||||
'dolresource' => $langs->trans('Resource'),
|
||||
// old deprecated
|
||||
@ -758,11 +757,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$keycode = $listfieldvalue[$i];
|
||||
if (empty($keycode)) $keycode = $value;
|
||||
|
||||
if ($value == 'price' || preg_match('/^amount/i', $value)) {
|
||||
$_POST[$keycode] = price2num(GETPOST($keycode), 'MU');
|
||||
}
|
||||
elseif ($value == 'taux' || $value == 'localtax1' || $value == 'localtax2') {
|
||||
$_POST[$keycode] = price2num(GETPOST($keycode), 8);
|
||||
if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') {
|
||||
$_POST[$keycode] = price2num($_POST[$keycode], 'MU');
|
||||
}
|
||||
elseif ($value == 'entity') {
|
||||
$_POST[$keycode] = getEntity($tabname[$id]);
|
||||
@ -781,7 +777,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) {
|
||||
$sql .= (int) GETPOST($keycode, 'int');
|
||||
}
|
||||
else {
|
||||
else {
|
||||
$sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'";
|
||||
}
|
||||
|
||||
@ -794,7 +790,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
if ($result) // Add is ok
|
||||
{
|
||||
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
||||
$_POST = array('id'=>$id); // Clean $_POST array, we keep only id
|
||||
$_POST = array('id'=>$id); // Clean $_POST array, we keep only
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -827,11 +823,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$keycode = $listfieldvalue[$i];
|
||||
if (empty($keycode)) $keycode = $field;
|
||||
|
||||
if ($field == 'price' || preg_match('/^amount/i', $field)) {
|
||||
$_POST[$keycode] = price2num(GETPOST($keycode), 'MU');
|
||||
}
|
||||
elseif ($field == 'taux' || $field == 'localtax1' || $field == 'localtax2') {
|
||||
$_POST[$keycode] = price2num(GETPOST($keycode), 8);
|
||||
if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') {
|
||||
$_POST[$keycode] = price2num($_POST[$keycode], 'MU');
|
||||
}
|
||||
elseif ($field == 'entity') {
|
||||
$_POST[$keycode] = getEntity($tabname[$id]);
|
||||
@ -1048,7 +1041,6 @@ if ($id)
|
||||
elseif ($search_code != '' && $id == 28) $sql .= natural_search("h.code", $search_code);
|
||||
elseif ($search_code != '' && $id == 32) $sql .= natural_search("a.code", $search_code);
|
||||
elseif ($search_code != '' && $id == 3) $sql .= natural_search("r.code_region", $search_code);
|
||||
elseif ($search_code != '' && $id == 10) $sql .= natural_search("t.code", $search_code);
|
||||
elseif ($search_code != '' && $id != 9) $sql .= natural_search("code", $search_code);
|
||||
|
||||
if ($sortfield)
|
||||
@ -1462,7 +1454,6 @@ if ($id)
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
//var_dump($fieldlist);
|
||||
|
||||
$class = '';
|
||||
$showfield = 1;
|
||||
$valuetoshow = $obj->{$fieldlist[$field]};
|
||||
|
||||
@ -448,8 +448,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if (!$connection)
|
||||
{
|
||||
$morehtml .= 'Failed to open IMAP connection '.$connectstringsource;
|
||||
$morehtml .= '<br>'.imap_last_error();
|
||||
//var_dump(imap_errors())
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -104,7 +104,12 @@ $arrayAvailableType = array(
|
||||
Facture::TYPE_SITUATION => $langs->trans("InvoiceSituation"),
|
||||
Facture::TYPE_STANDARD.'+'.Facture::TYPE_SITUATION => $langs->trans("InvoiceSituation").' + '.$langs->trans("InvoiceStandard"),
|
||||
);
|
||||
$selected = $conf->global->$confkey;
|
||||
$selected = array();
|
||||
$implodeglue = '+';
|
||||
if (!empty($conf->global->{$confkey}) && !is_array($conf->global->{$confkey})) {
|
||||
$selected = explode('+', $conf->global->{$confkey});
|
||||
}
|
||||
|
||||
$curentInput = (empty($inputCount) ? 1 : ($inputCount + 1));
|
||||
$formSelectInvoiceType = $form->selectarray('value'.$curentInput, $arrayAvailableType, $selected, 1);
|
||||
_printInputFormPart($confkey, $langs->trans('AllowedInvoiceForRetainedWarranty'), '', array(), $formSelectInvoiceType);
|
||||
|
||||
@ -293,7 +293,7 @@ if (empty($mysoc->country_code))
|
||||
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
|
||||
print " x ".$langs->trans("Quantity").": ".$qty;
|
||||
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
||||
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||
|
||||
$s = 10 / 3; $qty = 2; $vat = 10;
|
||||
$tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
|
||||
|
||||
@ -125,7 +125,7 @@ print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MailingDelay").'</td><td>';
|
||||
print '<input class="width75" type="text" name="MAILING_DELAY" value="'.$conf->global->MAILING_DELAY.'">';
|
||||
print '<input size="32" type="text" name="MAILING_DELAY" value="'.$conf->global->MAILING_DELAY.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
@ -720,7 +720,7 @@ else
|
||||
{
|
||||
if (function_exists('fsockopen') && $port && $server)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect&date='.dol_now().'#formmailbeforetitle">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect#formmailbeforetitle">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -764,17 +764,11 @@ else
|
||||
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||
{
|
||||
if (!empty($conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD))
|
||||
// MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'.
|
||||
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS))
|
||||
{
|
||||
// List of string to add in SPF if the setup use the mail method
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD);
|
||||
} else {
|
||||
// MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'.
|
||||
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS))
|
||||
{
|
||||
// List of IP show as record to add in SPF if we use the mail method
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
|
||||
}
|
||||
// List of IP show as record to add in SPF if we use the mail method
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
|
||||
}
|
||||
} else {
|
||||
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS))
|
||||
@ -782,7 +776,7 @@ else
|
||||
// List of IP show as record to add as allowed IP if we use the smtp method
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
|
||||
}
|
||||
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD)) // Should be required only if you have set to use your own SMTP and wat to warn users to update their domain name to match your SMTP server.
|
||||
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD))
|
||||
{
|
||||
// List of string to add in SPF if we use the smtp method
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
|
||||
@ -796,7 +790,6 @@ else
|
||||
// Run the test to connect
|
||||
if ($action == 'testconnect')
|
||||
{
|
||||
print '<div id="formmailaftertstconnect" name="formmailaftertstconnect"></div>';
|
||||
print load_fiche_titre($langs->trans("DoTestServerAvailability"));
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
@ -812,7 +805,6 @@ else
|
||||
}
|
||||
|
||||
setEventMessages($errormsg, null, 'errors');
|
||||
print $errormsg;
|
||||
}
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
@ -257,7 +257,7 @@ if (empty($reshook))
|
||||
$sql = "INSERT INTO ".$tabname[$id]." (";
|
||||
// List of fields
|
||||
$sql .= $tabfieldinsert[$id];
|
||||
$sql .= ",active,enabled)";
|
||||
$sql .= ",active)";
|
||||
$sql .= " VALUES(";
|
||||
|
||||
// List of values
|
||||
@ -280,7 +280,7 @@ if (empty($reshook))
|
||||
elseif ($keycode == 'content') {
|
||||
$sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'";
|
||||
}
|
||||
elseif (in_array($keycode, array('joinfiles', 'private', 'position', 'scale'))) {
|
||||
elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) {
|
||||
$sql .= (int) GETPOST($keycode, 'int');
|
||||
}
|
||||
else {
|
||||
@ -289,7 +289,7 @@ if (empty($reshook))
|
||||
|
||||
$i++;
|
||||
}
|
||||
$sql .= ", 1, 1)";
|
||||
$sql .= ", 1)";
|
||||
|
||||
dol_syslog("actionadd", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
|
||||
@ -57,7 +57,6 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
||||
|
||||
if ($action != 'updateedit' && !$error)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -39,8 +39,6 @@ if (!$user->admin) accessforbidden();
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$type = 'paymentorder';
|
||||
|
||||
$error = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -76,28 +74,35 @@ if ($action == "set")
|
||||
else $error++;
|
||||
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity);
|
||||
if (! ($res > 0)) $error++;
|
||||
if (!$res > 0) $error++;
|
||||
|
||||
if (GETPOST("PRELEVEMENT_USER") > 0) {
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
|
||||
if (! ($res > 0)) $error++;
|
||||
}
|
||||
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END") == "") {
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
|
||||
if (! ($res > 0)) $error++;
|
||||
}
|
||||
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD") == "") {
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
|
||||
if (! ($res > 0)) $error++;
|
||||
}
|
||||
if (GETPOST("PRELEVEMENT_USER") > 0)
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
}
|
||||
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END") == "")
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
}
|
||||
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD") == "")
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
}
|
||||
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
|
||||
if (! ($res > 0)) $error++;
|
||||
|
||||
if (! $error) {
|
||||
if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS") == "")
|
||||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) $error++;
|
||||
} elseif (!$error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
@ -191,10 +196,9 @@ print '</td></tr>';
|
||||
//ADDDAYS
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ADDDAYS").'</td>';
|
||||
print '<td class="left">';
|
||||
if (empty($conf->global->PRELEVEMENT_ADDDAYS)) $conf->global->PRELEVEMENT_ADDDAYS = 0;
|
||||
if (!$conf->global->PRELEVEMENT_ADDDAYS) $conf->global->PRELEVEMENT_ADDDAYS = 0;
|
||||
print '<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.$conf->global->PRELEVEMENT_ADDDAYS.'" size="5" ></td>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -310,7 +310,7 @@ else
|
||||
$formsms->withfromreadonly = 0;
|
||||
$formsms->withsubstit = 0;
|
||||
$formsms->withfrom = 1;
|
||||
$formsms->withto = (isset($_POST['sendto']) ? $_POST['sendto'] : ($user->user_mobile ? $user->user_mobile : 1));
|
||||
$formsms->withto = (isset($_POST['sendto']) ? $_POST['sendto'] : $user->user_mobile ? $user->user_mobile : 1);
|
||||
$formsms->withbody = (isset($_POST['message']) ? (empty($_POST['message']) ? 1 : $_POST['message']) : $langs->trans("ThisIsATestMessage"));
|
||||
$formsms->withbodyreadonly = 0;
|
||||
$formsms->withcancel = 1;
|
||||
|
||||
@ -83,23 +83,17 @@ else
|
||||
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_UPGRADE));
|
||||
}
|
||||
|
||||
$version = DOL_VERSION;
|
||||
if (preg_match('/[a-z]+/i', $version)) $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
|
||||
print ' <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
|
||||
|
||||
$newversion = '';
|
||||
if (function_exists('curl_init'))
|
||||
{
|
||||
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
|
||||
print ' - ';
|
||||
if ($action == 'getlastversion')
|
||||
{
|
||||
if ($sfurl) {
|
||||
$i = 0;
|
||||
if ($sfurl)
|
||||
{
|
||||
while (!empty($sfurl->channel[0]->item[$i]->title) && $i < 10000)
|
||||
{
|
||||
$title = $sfurl->channel[0]->item[$i]->title;
|
||||
$reg = array();
|
||||
if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg))
|
||||
{
|
||||
$newversion = $reg[1];
|
||||
@ -113,23 +107,25 @@ if (function_exists('curl_init'))
|
||||
|
||||
// Show version
|
||||
print $langs->trans("LastStableVersion").' : <b>'.(($version != '0.0') ? $version : $langs->trans("Unknown")).'</b>';
|
||||
if ($version != '0.0') {
|
||||
print ' <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("UpdateServerOffline").'</b>';
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion" class="butAction">'.$langs->trans("Check").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Now show link to the changelog
|
||||
//print ' - ';
|
||||
print ' - ';
|
||||
|
||||
$version = DOL_VERSION;
|
||||
if (preg_match('/[a-z]+/i', $version)) $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
|
||||
|
||||
print '<a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
|
||||
print '</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").')</td><td>'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
|
||||
@ -225,7 +221,7 @@ if (($thousand != ',' && $thousand != '.') || ($thousand != ' '))
|
||||
print '<tr class="oddeven"><td> => price(1234.56)</td><td>'.price(1234.56).'</td></tr>'."\n";
|
||||
// Timezone
|
||||
$txt = $langs->trans("OSTZ").' (variable system TZ): '.(!empty($_ENV["TZ"]) ? $_ENV["TZ"] : $langs->trans("NotDefined")).'<br>'."\n";
|
||||
$txt .= $langs->trans("PHPTZ").' (date_default_timezone_get() / php.ini date.timezone): '.(getServerTimeZoneString()." / ".(ini_get("date.timezone") ? ini_get("date.timezone") : $langs->trans("NotDefined")))."<br>\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
|
||||
$txt .= $langs->trans("PHPTZ").' (php.ini date.timezone): '.(ini_get("date.timezone") ?ini_get("date.timezone") : $langs->trans("NotDefined")).''."<br>\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
|
||||
$txt .= $langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.(empty($conf->global->MAIN_SERVER_TZ) ? $langs->trans("NotDefined") : $conf->global->MAIN_SERVER_TZ);
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CurrentTimeZone").'</td><td>'; // Timezone server PHP
|
||||
$a = getServerTimeZoneInt('now');
|
||||
|
||||
@ -273,7 +273,7 @@ if (!$error && $xml)
|
||||
}
|
||||
else
|
||||
{
|
||||
$out .= '<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
$out .= '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
$out .= '</table>';
|
||||
$out .= '</div>';
|
||||
@ -328,7 +328,7 @@ if (!$error && $xml)
|
||||
}
|
||||
else
|
||||
{
|
||||
$out .= '<tr class="oddeven"><td colspan="7" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
$out .= '<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
$out .= '</table>';
|
||||
$out .= '</div>';
|
||||
@ -383,7 +383,7 @@ if (!$error && $xml)
|
||||
}
|
||||
else
|
||||
{
|
||||
$out .= '<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
$out .= '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
$out .= '</table>';
|
||||
$out .= '</div>';
|
||||
|
||||
@ -137,7 +137,7 @@ print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
$activatedExtensions = array();
|
||||
$activatedExtensions = array_map('strtolower', getActivatedExtensions());
|
||||
$loadedExtensions = array_map('strtolower', get_loaded_extensions(false));
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
@ -154,6 +154,7 @@ $name = "GD";
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
//print getTableColumn($name, $activatedExtensions);
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
@ -164,6 +165,7 @@ $name = "Curl";
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
//print getTableColumn($name, $activatedExtensions);
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
@ -176,6 +178,7 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
//print getTableColumn($name, $activatedExtensions);
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
@ -188,6 +191,7 @@ $name = "xDebug";
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
//print getTableColumn($name, $activatedExtensions);
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
@ -217,7 +221,7 @@ foreach ($phparray as $key => $value)
|
||||
print '<td>'.$keyparam.'</td>';
|
||||
$valtoshow = $keyvalue;
|
||||
if ($keyparam == 'X-ChromePhp-Data') $valtoshow = dol_trunc($keyvalue, 80);
|
||||
print '<td colspan="2" class="wordbreak">';
|
||||
print '<td colspan="2">';
|
||||
if ($keyparam == 'Path') $valtoshow = implode('; ', explode(';', trim($valtoshow)));
|
||||
if ($keyparam == 'PATH') $valtoshow = implode('; ', explode(';', trim($valtoshow)));
|
||||
if ($keyparam == '_SERVER["PATH"]') $valtoshow = implode('; ', explode(';', trim($valtoshow)));
|
||||
@ -228,7 +232,7 @@ foreach ($phparray as $key => $value)
|
||||
else
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="wordbreak">'.$keyparam.'</td>';
|
||||
print '<td>'.$keyparam.'</td>';
|
||||
$i = 0;
|
||||
foreach ($keyvalue as $keyparam2 => $keyvalue2)
|
||||
{
|
||||
@ -252,6 +256,78 @@ foreach ($phparray as $key => $value)
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
/**
|
||||
* Return all list with all activated, but possible not loaded PHP extensions
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getActivatedExtensions()
|
||||
{
|
||||
$file = getConfigFilePath();
|
||||
$handle = fopen(GetConfigFilePath(), "r");
|
||||
$content = fread($handle, filesize($file));
|
||||
|
||||
fclose($handle);
|
||||
|
||||
$configLines = explode("\r", $content);
|
||||
|
||||
$extensions = array();
|
||||
$lastLine = "";
|
||||
|
||||
foreach ($configLines as $line)
|
||||
{
|
||||
$line = trim($line);
|
||||
|
||||
// ignore comment lines
|
||||
if (substr($line, 0, 1) === ";")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// extension
|
||||
if (substr($line, 0, 9) === "extension" && substr($line, 0, 10) !== "extension_")
|
||||
{
|
||||
$value = trim(end(explode("=", $line)));
|
||||
|
||||
$extensions[] = $value === "gd2" ? "gd" : $value;
|
||||
}
|
||||
|
||||
// zend_extension
|
||||
if (substr($line, 0, 14) === "zend_extension")
|
||||
{
|
||||
$extensions[] = str_replace("[", "", str_replace("]", "", $lastLine));
|
||||
}
|
||||
|
||||
$lastLine = $line;
|
||||
}
|
||||
|
||||
return array_unique($extensions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the path to the current used php config file
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getConfigFilePath()
|
||||
{
|
||||
$phparray = phpinfo_array();
|
||||
|
||||
foreach ($phparray as $value)
|
||||
{
|
||||
foreach ($value as $keyparam => $keyvalue)
|
||||
{
|
||||
if (strtolower($keyparam) !== "loaded configuration file")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
return $keyvalue;
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a table column with a indicator (okay or warning), based on the given name and list
|
||||
@ -324,7 +400,7 @@ function getTableColumnFunction(array $functions)
|
||||
* Return a result column with a translated result text
|
||||
*
|
||||
* @param string $name The name of the PHP extension
|
||||
* @param array $activated A list with all activated PHP extensions. Deprecated.
|
||||
* @param array $activated A list with all activated PHP extensions
|
||||
* @param array $loaded A list with all loaded PHP extensions
|
||||
* @param array $functions A list with all PHP functions to check
|
||||
*
|
||||
|
||||
@ -34,7 +34,7 @@ $action = GETPOST('action', 'alpha');
|
||||
$what = GETPOST('what', 'alpha');
|
||||
$export_type = GETPOST('export_type', 'alpha');
|
||||
$file = trim(GETPOST('zipfilename_template', 'alpha'));
|
||||
$compression = GETPOST('compression', 'aZ09');
|
||||
$compression = GETPOST('compression');
|
||||
|
||||
$file = dol_sanitizeFileName($file);
|
||||
$file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2)$/i', '', $file);
|
||||
|
||||
@ -197,7 +197,7 @@ if ($action == 'delete')
|
||||
$form = new Form($db);
|
||||
$formadmin = new FormAdmin($db);
|
||||
|
||||
$wikihelp = 'EN:Setup_Translation|FR:Paramétrage_Traduction|ES:Configuración_Traducción';
|
||||
$wikihelp = 'EN:Setup Translation|FR:Paramétrage traduction|ES:Configuración';
|
||||
llxHeader('', $langs->trans("Setup"), $wikihelp);
|
||||
|
||||
$param = '&mode='.$mode;
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -43,8 +42,6 @@ $action = GETPOST('action', 'alpha');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
|
||||
$value = GETPOST('value', 'alpha');
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scandir', 'alpha');
|
||||
$type = 'user';
|
||||
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ if ($action == 'update' && $user->rights->asset->write)
|
||||
$object->note = trim($comment);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
$ret = $object->update($user);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -183,10 +183,6 @@ if (empty($reshook))
|
||||
unset($_POST['qty']);
|
||||
unset($_POST['qty_frozen']);
|
||||
unset($_POST['disable_stock_change']);
|
||||
|
||||
$object->fetchLines();
|
||||
|
||||
$object->calculateCosts();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -198,7 +194,7 @@ if (empty($reshook))
|
||||
$error = 0;
|
||||
|
||||
// Set if we used free entry or predefined product
|
||||
$qty = price2num(GETPOST('qty', 'alpha'));
|
||||
$qty = price2num(GETPOST('qty', 'int'));
|
||||
$qty_frozen = GETPOST('qty_frozen', 'int');
|
||||
$disable_stock_change = GETPOST('disable_stock_change', 'int');
|
||||
$efficiency = price2num(GETPOST('efficiency', 'int'));
|
||||
@ -229,8 +225,6 @@ if (empty($reshook))
|
||||
unset($_POST['disable_stock_change']);
|
||||
|
||||
$object->fetchLines();
|
||||
|
||||
$object->calculateCosts();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,6 +116,7 @@ if ($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
$coldisplay++;
|
||||
print '<td class="nobottom linecoluseunit left">';
|
||||
print $form->selectUnits($line->fk_unit, "units");
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
@ -112,6 +112,7 @@ if ($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
$coldisplay++;
|
||||
print '<td class="nobottom linecoluseunit left">';
|
||||
print $form->selectUnits($line->fk_unit, "units");
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ print '</td>';
|
||||
if ($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
print '<td class="linecoluseunit nowrap left">';
|
||||
$label = $tmpproduct->getLabelOfUnit('short');
|
||||
$label = $line->getLabelOfUnit('short');
|
||||
if ($label !== '') {
|
||||
print $langs->trans($label);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ function printDropdownBookmarksList()
|
||||
{
|
||||
foreach ($_POST as $key => $val)
|
||||
{
|
||||
if (preg_match('/^search_/', $key) && $val != '') $tmpurl .= ($tmpurl ? '&' : '').http_build_query(array($key => $val));
|
||||
if (preg_match('/^search_/', $key) && $val != '') $tmpurl .= ($tmpurl ? '&' : '').$key.'='.$val;
|
||||
}
|
||||
}
|
||||
$url .= ($tmpurl ? '?'.$tmpurl : '');
|
||||
|
||||
@ -102,7 +102,7 @@ if ($action == 'update' && $user->rights->categorie->creer)
|
||||
}
|
||||
if (!$error && empty($object->error))
|
||||
{
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (!$error && $object->update($user) > 0)
|
||||
@ -157,7 +157,7 @@ print '</tr>';
|
||||
// Description
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>';
|
||||
print '<td >';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('description', $object->description, '', 200, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, ROWS_6, '90%');
|
||||
$doleditor->Create();
|
||||
@ -166,7 +166,7 @@ print '</td></tr>';
|
||||
// Color
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Color").'</td>';
|
||||
print '<td>';
|
||||
print '<td >';
|
||||
print $formother->selectColor($object->color, 'color');
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -269,19 +269,16 @@ dol_fiche_end();
|
||||
*/
|
||||
|
||||
print "<div class='tabsAction'>\n";
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if (empty($reshook)) {
|
||||
if ($user->rights->categorie->creer)
|
||||
{
|
||||
$socid = ($object->socid ? "&socid=".$object->socid : "");
|
||||
print "<a class='butAction' href='edit.php?id=".$object->id.$socid."&type=".$type."'>".$langs->trans("Modify")."</a>";
|
||||
}
|
||||
|
||||
if ($user->rights->categorie->supprimer)
|
||||
{
|
||||
print "<a class='butActionDelete' href='".DOL_URL_ROOT."/categories/viewcat.php?action=delete&id=".$object->id."&type=".$type."'>".$langs->trans("Delete")."</a>";
|
||||
}
|
||||
if ($user->rights->categorie->creer)
|
||||
{
|
||||
$socid = ($object->socid ? "&socid=".$object->socid : "");
|
||||
print "<a class='butAction' href='edit.php?id=".$object->id.$socid."&type=".$type."'>".$langs->trans("Modify")."</a>";
|
||||
}
|
||||
|
||||
if ($user->rights->categorie->supprimer)
|
||||
{
|
||||
print "<a class='butActionDelete' href='".DOL_URL_ROOT."/categories/viewcat.php?action=delete&id=".$object->id."&type=".$type."'>".$langs->trans("Delete")."</a>";
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
|
||||
@ -445,8 +445,8 @@ if (empty($reshook) && $action == 'update')
|
||||
$object->fetch_userassigned();
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
|
||||
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
|
||||
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
||||
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
||||
|
||||
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm');
|
||||
$object->label = GETPOST("label", "alphanohtml");
|
||||
@ -469,6 +469,7 @@ if (empty($reshook) && $action == 'update')
|
||||
$object->note_private = trim(GETPOST("note", "none"));
|
||||
$object->fk_element = GETPOST("fk_element", "int");
|
||||
$object->elementtype = GETPOST("elementtype", "alphanohtml");
|
||||
|
||||
if (!$datef && $percentage == 100)
|
||||
{
|
||||
$error++; $donotclearsession = 1;
|
||||
@ -529,7 +530,7 @@ if (empty($reshook) && $action == 'update')
|
||||
}
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (!$error) {
|
||||
|
||||
@ -763,7 +763,6 @@ class ActionComm extends CommonObject
|
||||
$this->elementid = $obj->elementid;
|
||||
$this->elementtype = $obj->elementtype;
|
||||
|
||||
$this->fetch_optionals();
|
||||
$this->fetchResources();
|
||||
}
|
||||
$this->db->free($resql);
|
||||
@ -984,7 +983,7 @@ class ActionComm extends CommonObject
|
||||
|
||||
// Clean parameters
|
||||
$this->label = trim($this->label);
|
||||
$this->note_private = dol_htmlcleanlastbr(trim(!isset($this->note_private) ? $this->note : $this->note_private));
|
||||
$this->note_private = dol_htmlcleanlastbr(trim(empty($this->note_private) ? $this->note : $this->note_private));
|
||||
if (empty($this->percentage)) $this->percentage = 0;
|
||||
if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0;
|
||||
if (empty($this->transparency)) $this->transparency = 0;
|
||||
@ -1202,20 +1201,13 @@ class ActionComm extends CommonObject
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
if (!$user->rights->agenda->allactions->read) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_resources AS ar ON a.id = ar.fk_actioncomm AND ar.element_type ='user' AND ar.fk_element = ".$user->id;
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
||||
$sql .= " WHERE 1 = 1";
|
||||
if (empty($load_state_board)) $sql .= " AND a.percent >= 0 AND a.percent < 100";
|
||||
$sql .= " AND a.entity IN (".getEntity('agenda').")";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
|
||||
if ($user->socid) $sql .= " AND a.fk_soc = ".$user->socid;
|
||||
if (!$user->rights->agenda->allactions->read) {
|
||||
$sql .= " AND (a.fk_user_author = ".$user->id." OR a.fk_user_action = ".$user->id." OR a.fk_user_done = ".$user->id;
|
||||
$sql .= " OR ar.fk_element = ".$user->id; // Added by PV
|
||||
$sql .= ")";
|
||||
}
|
||||
if (!$user->rights->agenda->allactions->read) $sql .= " AND (a.fk_user_author = ".$user->id." OR a.fk_user_action = ".$user->id." OR a.fk_user_done = ".$user->id.")";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -66,7 +66,7 @@ class AgendaEvents extends DolibarrApi
|
||||
if (!DolibarrApiAccess::$user->rights->agenda->myactions->read) {
|
||||
throw new RestException(401, "Insufficient rights to read an event");
|
||||
}
|
||||
if ($id === 0) {
|
||||
if ($id == 0) {
|
||||
$result = $this->actioncomm->initAsSpecimen();
|
||||
} else {
|
||||
$result = $this->actioncomm->fetch($id);
|
||||
|
||||
@ -269,10 +269,7 @@ if ($object->id > 0)
|
||||
print '<tr><td>';
|
||||
print $langs->trans('CustomerCode').'</td><td>';
|
||||
print $object->code_client;
|
||||
$tmpcheck = $object->check_codeclient();
|
||||
if ($tmpcheck != 0 && $tmpcheck != -5) {
|
||||
print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
|
||||
}
|
||||
if ($object->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr>';
|
||||
|
||||
@ -839,7 +839,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||
{
|
||||
$langs->load("orders");
|
||||
|
||||
$sql = "SELECT s.nom as name, s.rowid, c.rowid as commandeid, c.fk_statut, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
|
||||
$sql = "SELECT s.nom as name, s.rowid, c.rowid as commandeid, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
|
||||
$sql .= ", s.code_client";
|
||||
$sql .= ", s.entity";
|
||||
$sql .= ", s.email";
|
||||
@ -877,7 +877,6 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||
|
||||
$orderstatic->id = $obj->commandeid;
|
||||
$orderstatic->ref = $obj->ref;
|
||||
$orderstatic->statut = $obj->fk_statut;
|
||||
$orderstatic->ref_client = $obj->ref_client;
|
||||
$orderstatic->total_ht = $obj->total_ht;
|
||||
$orderstatic->total_tva = $obj->total_tva;
|
||||
|
||||
@ -346,7 +346,7 @@ if (empty($reshook))
|
||||
if (!empty($conf->global->MAILING_DELAY))
|
||||
{
|
||||
dol_syslog("Wait a delay of MAILING_DELAY=".$conf->global->MAILING_DELAY);
|
||||
usleep((float) $conf->global->MAILING_DELAY * 1000000);
|
||||
sleep($conf->global->MAILING_DELAY);
|
||||
}
|
||||
|
||||
//test if CHECK READ change statut prospect contact
|
||||
|
||||
@ -66,8 +66,6 @@ $modulesdir = dolGetModulesDirs('/mailings');
|
||||
$object = new Mailing($db);
|
||||
$result = $object->fetch($id);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('ciblescard', 'globalcard'));
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -473,10 +471,6 @@ if ($object->fetch($id) >= 0)
|
||||
}
|
||||
} // End foreach dir
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<br><br>';
|
||||
@ -487,27 +481,11 @@ if ($object->fetch($id) >= 0)
|
||||
$sql .= " mc.source_url, mc.source_id, mc.source_type, mc.error_text";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||
$sql .= " WHERE mc.fk_mailing=".$object->id;
|
||||
$asearchcriteriahasbeenset = 0;
|
||||
if ($search_lastname) {
|
||||
$sql .= natural_search("mc.lastname", $search_lastname);
|
||||
$asearchcriteriahasbeenset++;
|
||||
}
|
||||
if ($search_firstname) {
|
||||
$sql .= natural_search("mc.firstname", $search_firstname);
|
||||
$asearchcriteriahasbeenset++;
|
||||
}
|
||||
if ($search_email) {
|
||||
$sql .= natural_search("mc.email", $search_email);
|
||||
$asearchcriteriahasbeenset++;
|
||||
}
|
||||
if ($search_other) {
|
||||
$sql .= natural_search("mc.other", $search_other);
|
||||
$asearchcriteriahasbeenset++;
|
||||
}
|
||||
if ($search_dest_status != '' && $search_dest_status >= -1) {
|
||||
$sql .= " AND mc.statut=".$db->escape($search_dest_status)." ";
|
||||
$asearchcriteriahasbeenset++;
|
||||
}
|
||||
if ($search_lastname) $sql .= natural_search("mc.lastname", $search_lastname);
|
||||
if ($search_firstname) $sql .= natural_search("mc.firstname", $search_firstname);
|
||||
if ($search_email) $sql .= natural_search("mc.email", $search_email);
|
||||
if ($search_other) $sql .= natural_search("mc.other", $search_other);
|
||||
if ($search_dest_status != '' && $search_dest_status >= -1) $sql .= " AND mc.statut=".$db->escape($search_dest_status)." ";
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
@ -521,18 +499,6 @@ if ($object->fetch($id) >= 0)
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
|
||||
// Fix/update nbemail on emailing record if it differs (may happen if user edit lines from database directly)
|
||||
if (empty($asearchcriteriahasbeenset)) {
|
||||
if ($nbtotalofrecords != $object->email) {
|
||||
dol_syslog("We found a difference in nb of record in target table and the property ->nbemail, we fix ->nbemail");
|
||||
//print "nbemail=".$object->nbemail." nbtotalofrecords=".$nbtotalofrecords;
|
||||
$resultrefresh = $object->refreshNbOfTargets();
|
||||
if ($resultrefresh < 0) {
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//$nbtotalofrecords=$object->nbemail; // nbemail is a denormalized field storing nb of targets
|
||||
|
||||
@ -595,10 +595,6 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
if ($arrayquery['options_'.$key] != '') {
|
||||
$sqlwhere[] = " (te.".$key." = ".$arrayquery['options_'.$key].")";
|
||||
}
|
||||
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'link') {
|
||||
if ($arrayquery['options_'.$key] > 0) {
|
||||
$sqlwhere[]= " (te.".$key." = ".((int) $arrayquery['options_'.$key]).")";
|
||||
}
|
||||
} else {
|
||||
if (is_array($arrayquery['options_'.$key])) {
|
||||
$sqlwhere[] = " (te.".$key." IN ('".implode("','", $arrayquery['options_'.$key])."'))";
|
||||
@ -625,6 +621,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->thirdparty_lines[$i] = $obj->rowid;
|
||||
|
||||
$i++;
|
||||
|
||||
@ -424,16 +424,11 @@ class Mailing extends CommonObject
|
||||
/**
|
||||
* Delete emailing
|
||||
*
|
||||
* @param int $rowid Id if emailing to delete
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int >0 if OK, <0 if KO
|
||||
* @param int $rowid id du mailing a supprimer
|
||||
* @return int 1 en cas de succes
|
||||
*/
|
||||
public function delete($rowid, $notrigger = 0)
|
||||
public function delete($rowid)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing";
|
||||
$sql .= " WHERE rowid = ".$rowid;
|
||||
|
||||
@ -441,31 +436,13 @@ class Mailing extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$res = $this->delete_targets();
|
||||
if(empty($res)){
|
||||
$this->db->rollback();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
return $this->delete_targets();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!$notrigger){
|
||||
$result = $this->call_trigger('MAILING_DELETE', $user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
@ -484,8 +461,6 @@ class Mailing extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$this->refreshNbOfTargets();
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
@ -557,38 +532,6 @@ class Mailing extends CommonObject
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh denormalized value ->nbemail into emailing record
|
||||
* Note: There is also the method update_nb into modules_mailings that is used for this.
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function refreshNbOfTargets()
|
||||
{
|
||||
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql .= " WHERE fk_mailing = ".$this->id;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
$nbforupdate = $obj->nb;
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'mailing SET nbemail = '.((int) $nbforupdate);
|
||||
$sql .= ' WHERE rowid = '.$this->id;
|
||||
|
||||
$resqlupdate = $this->db->query($sql);
|
||||
if (! $resqlupdate) {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a link to the object card (with optionally the picto)
|
||||
|
||||
@ -327,7 +327,7 @@ if (empty($reshook))
|
||||
$duration = GETPOST('duree_validite', 'int');
|
||||
|
||||
if (empty($datep)) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePropal")), null, 'errors');
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
@ -942,7 +942,6 @@ if (empty($reshook))
|
||||
if (count($prodcustprice->lines) > 0) {
|
||||
$pu_ht = price($prodcustprice->lines[0]->price);
|
||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||
$price_min = price($prodcustprice->lines[0]->price_min);
|
||||
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||
$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
|
||||
if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||
@ -1622,7 +1621,7 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
// Date
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('DatePropal').'</td><td>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
|
||||
print $form->selectDate('', '', '', '', '', "addprop", 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -2051,7 +2050,7 @@ if ($action == 'create')
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DatePropal');
|
||||
print $langs->trans('Date');
|
||||
print '</td>';
|
||||
if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
|
||||
@ -483,7 +483,6 @@ class Propal extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->error = $line->error;
|
||||
$this->errors = $line->errors;
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
@ -603,7 +602,6 @@ class Propal extends CommonObject
|
||||
|
||||
// Clean vat code
|
||||
$vat_src_code = '';
|
||||
$reg = array();
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
{
|
||||
$vat_src_code = $reg[1];
|
||||
@ -728,7 +726,6 @@ class Propal extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->error = $this->line->error;
|
||||
$this->errors = $this->line->errors;
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
@ -782,9 +779,7 @@ class Propal extends CommonObject
|
||||
$qty = price2num($qty);
|
||||
$pu = price2num($pu);
|
||||
$pu_ht_devise = price2num($pu_ht_devise);
|
||||
if (!preg_match('/\((.*)\)/', $txtva)) {
|
||||
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
|
||||
}
|
||||
$txtva = price2num($txtva);
|
||||
$txlocaltax1 = price2num($txlocaltax1);
|
||||
$txlocaltax2 = price2num($txlocaltax2);
|
||||
$pa_ht = price2num($pa_ht);
|
||||
@ -926,7 +921,7 @@ class Propal extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->error = $this->line->error;
|
||||
$this->errors = $this->line->errors;
|
||||
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
@ -1349,6 +1344,7 @@ class Propal extends CommonObject
|
||||
|
||||
// Load source object
|
||||
$object->fetch($this->id);
|
||||
$object->fetch_lines();
|
||||
|
||||
$objsoc = new Societe($this->db);
|
||||
|
||||
@ -1742,7 +1738,7 @@ class Propal extends CommonObject
|
||||
$sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,';
|
||||
$sql .= ' d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,';
|
||||
$sql .= ' d.fk_unit,';
|
||||
$sql .= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tobatch as product_tobatch, p.barcode as product_barcode,';
|
||||
$sql .= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tobatch as product_batch,';
|
||||
$sql .= ' p.weight, p.weight_units, p.volume, p.volume_units,';
|
||||
$sql .= ' d.date_start, d.date_end,';
|
||||
$sql .= ' d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc';
|
||||
@ -1804,14 +1800,11 @@ class Propal extends CommonObject
|
||||
$line->fk_product = $objp->fk_product;
|
||||
|
||||
$line->ref = $objp->product_ref; // deprecated
|
||||
$line->libelle = $objp->product_label; // deprecated
|
||||
|
||||
$line->product_ref = $objp->product_ref;
|
||||
$line->libelle = $objp->product_label; // deprecated
|
||||
$line->product_label = $objp->product_label;
|
||||
$line->product_desc = $objp->product_desc; // Description produit
|
||||
$line->product_tobatch = $objp->product_tobatch;
|
||||
$line->product_barcode = $objp->product_barcode;
|
||||
|
||||
$line->fk_product_type = $objp->fk_product_type; // deprecated
|
||||
$line->fk_unit = $objp->fk_unit;
|
||||
$line->weight = $objp->weight;
|
||||
@ -3931,18 +3924,6 @@ class PropaleLigne extends CommonObjectLine
|
||||
*/
|
||||
public $product_desc;
|
||||
|
||||
/**
|
||||
* Product use lot
|
||||
* @var string
|
||||
*/
|
||||
public $product_tobatch;
|
||||
|
||||
/**
|
||||
* Product barcode
|
||||
* @var string
|
||||
*/
|
||||
public $product_barcode;
|
||||
|
||||
public $localtax1_tx; // Local tax 1
|
||||
public $localtax2_tx; // Local tax 2
|
||||
public $localtax1_type; // Local tax 1 type
|
||||
|
||||
@ -162,7 +162,7 @@ $arrayfields = array(
|
||||
'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
|
||||
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
|
||||
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
|
||||
'p.date'=>array('label'=>"DatePropal", 'checked'=>1),
|
||||
'p.date'=>array('label'=>"Date", 'checked'=>1),
|
||||
'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1),
|
||||
'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0),
|
||||
'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0),
|
||||
@ -282,7 +282,7 @@ $help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'
|
||||
//llxHeader('',$langs->trans('Proposal'),$help_url);
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql .= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
|
||||
$sql .= " typent.code as typent_code,";
|
||||
$sql .= " ava.rowid as availability,";
|
||||
|
||||
@ -37,11 +37,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
||||
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
||||
|
||||
$mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
|
||||
$mode = GETPOST("mode") ?GETPOST("mode") : 'customer';
|
||||
if ($mode == 'customer' && !$user->rights->propale->lire) accessforbidden();
|
||||
if ($mode == 'supplier' && !$user->rights->supplier_proposal->lire) accessforbidden();
|
||||
|
||||
$object_status = GETPOST('object_status', 'intcomma');
|
||||
$object_status = GETPOST('object_status');
|
||||
$typent_id = GETPOST('typent_id', 'int');
|
||||
$categ_id = GETPOST('categ_id', 'categ_id');
|
||||
|
||||
@ -55,7 +55,7 @@ if ($user->socid > 0)
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
|
||||
//$startyear=$year-2;
|
||||
$startyear = $year - 1;
|
||||
$endyear = $year;
|
||||
|
||||
@ -216,8 +216,6 @@ if (empty($reshook))
|
||||
$result = $object->deleteline($user, $lineid);
|
||||
if ($result > 0)
|
||||
{
|
||||
// reorder lines
|
||||
$object->line_order(true);
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
@ -462,15 +460,26 @@ if (empty($reshook))
|
||||
if (!$error)
|
||||
{
|
||||
$object_id = $object->create($user);
|
||||
|
||||
// If some invoice's lines already known
|
||||
$NBLINES = 8;
|
||||
for ($i = 1; $i <= $NBLINES; $i++) {
|
||||
if ($_POST['idprod'.$i]) {
|
||||
$xid = 'idprod'.$i;
|
||||
$xqty = 'qty'.$i;
|
||||
$xremise = 'remise_percent'.$i;
|
||||
$object->add_product($_POST[$xid], $_POST[$xqty], $_POST[$xremise]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Insert default contacts if defined
|
||||
if ($object_id > 0)
|
||||
{
|
||||
if (GETPOST('contactid', 'int'))
|
||||
if (GETPOST('contactid'))
|
||||
{
|
||||
$result = $object->add_contact(GETPOST('contactid', 'int'), 'CUSTOMER', 'external');
|
||||
$result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external');
|
||||
if ($result < 0) {
|
||||
setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors');
|
||||
$error++;
|
||||
@ -672,11 +681,8 @@ if (empty($reshook))
|
||||
$tva_tx = '';
|
||||
}
|
||||
|
||||
$qty = price2num(GETPOST('qty'.$predef, 'alpha'));
|
||||
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha')) : 0);
|
||||
if (empty($remise_percent)) {
|
||||
$remise_percent = 0;
|
||||
}
|
||||
$qty = GETPOST('qty'.$predef);
|
||||
$remise_percent = (GETPOST('remise_percent'.$predef) != '' ? GETPOST('remise_percent'.$predef) : 0);
|
||||
|
||||
// Extrafields
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
@ -782,7 +788,6 @@ if (empty($reshook))
|
||||
{
|
||||
$pu_ht = price($prodcustprice->lines[0]->price);
|
||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||
$price_min = price($prodcustprice->lines[0]->price_min);
|
||||
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||
$tva_tx = $prodcustprice->lines[0]->tva_tx;
|
||||
if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||
@ -959,7 +964,6 @@ if (empty($reshook))
|
||||
|
||||
if ($result > 0) {
|
||||
$ret = $object->fetch($object->id); // Reload to get new records
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
// Define output language
|
||||
@ -1768,7 +1772,7 @@ if ($action == 'create' && $usercancreate)
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
if (!empty($conf->global->THIRDPARTY_PROPAGATE_EXTRAFIELDS_TO_ORDER) && !empty($soc->id)) {
|
||||
if (!empty($conf->global->THIRDPARTY_PROPAGATE_EXTRAFIELDS_TO_ORDER)) {
|
||||
// copy from thirdparty
|
||||
$tpExtrafields = new Extrafields($db);
|
||||
$tpExtrafieldLabels = $tpExtrafields->fetch_name_optionals_label($soc->table_element);
|
||||
|
||||
@ -2002,7 +2002,6 @@ class Commande extends CommonOrder
|
||||
else
|
||||
{
|
||||
$this->error = $line->error;
|
||||
$this->errors = $line->errors;
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
@ -2034,7 +2033,7 @@ class Commande extends CommonOrder
|
||||
$sql .= ' l.total_ht, l.total_ttc, l.total_tva, l.total_localtax1, l.total_localtax2, l.date_start, l.date_end,';
|
||||
$sql .= ' l.fk_unit,';
|
||||
$sql .= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc,';
|
||||
$sql .= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tobatch as product_tobatch, p.barcode as product_barcode,';
|
||||
$sql .= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tobatch as product_tobatch,';
|
||||
$sql .= ' p.weight, p.weight_units, p.volume, p.volume_units';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)';
|
||||
@ -2092,14 +2091,11 @@ class Commande extends CommonOrder
|
||||
$line->fk_parent_line = $objp->fk_parent_line;
|
||||
|
||||
$line->ref = $objp->product_ref;
|
||||
$line->libelle = $objp->product_label;
|
||||
|
||||
$line->product_ref = $objp->product_ref;
|
||||
$line->libelle = $objp->product_label;
|
||||
$line->product_label = $objp->product_label;
|
||||
$line->product_desc = $objp->product_desc;
|
||||
$line->product_tobatch = $objp->product_tobatch;
|
||||
$line->product_barcode = $objp->product_barcode;
|
||||
|
||||
$line->fk_product_type = $objp->fk_product_type; // Produit ou service
|
||||
$line->fk_unit = $objp->fk_unit;
|
||||
|
||||
@ -2271,7 +2267,6 @@ class Commande extends CommonOrder
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'expedition as e';
|
||||
$sql .= ', '.MAIN_DB_PREFIX.'element_element as el';
|
||||
$sql .= ' WHERE el.fk_source = '.$this->id;
|
||||
$sql .= " AND el.sourcetype = 'commande'";
|
||||
$sql .= " AND el.fk_target = e.rowid";
|
||||
$sql .= " AND el.targettype = 'shipping'";
|
||||
|
||||
@ -3122,9 +3117,7 @@ class Commande extends CommonOrder
|
||||
$pu = price2num($pu);
|
||||
$pa_ht = price2num($pa_ht);
|
||||
$pu_ht_devise = price2num($pu_ht_devise);
|
||||
if (!preg_match('/\((.*)\)/', $txtva)) {
|
||||
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
|
||||
}
|
||||
$txtva = price2num($txtva);
|
||||
$txlocaltax1 = price2num($txlocaltax1);
|
||||
$txlocaltax2 = price2num($txlocaltax2);
|
||||
|
||||
@ -3139,7 +3132,6 @@ class Commande extends CommonOrder
|
||||
|
||||
// Clean vat code
|
||||
$vat_src_code = '';
|
||||
$reg = array();
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
{
|
||||
$vat_src_code = $reg[1];
|
||||
@ -3310,7 +3302,6 @@ class Commande extends CommonOrder
|
||||
if (isset($this->note_public)) $this->note_public = trim($this->note_public);
|
||||
if (isset($this->modelpdf)) $this->modelpdf = trim($this->modelpdf);
|
||||
if (isset($this->import_key)) $this->import_key = trim($this->import_key);
|
||||
$delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date;
|
||||
|
||||
// Check parameters
|
||||
// Put here code to add control on parameters values
|
||||
@ -3335,8 +3326,6 @@ class Commande extends CommonOrder
|
||||
$sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").",";
|
||||
$sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").",";
|
||||
$sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").",";
|
||||
$sql .= " date_livraison=".(strval($this->delivery_date) != '' ? "'".$this->db->idate($this->delivery_date)."'" : 'null').",";
|
||||
$sql .= " fk_shipping_method=".(isset($this->shipping_method_id) ? $this->shipping_method_id : "null").",";
|
||||
$sql .= " fk_account=".($this->fk_account > 0 ? $this->fk_account : "null").",";
|
||||
$sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").",";
|
||||
$sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").",";
|
||||
@ -4054,7 +4043,7 @@ class Commande extends CommonOrder
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
return max($this->date, $this->date_livraison) < ($now - $conf->commande->client->warning_delay);
|
||||
return max($this->date_commande, $this->date_livraison) < ($now - $conf->commande->client->warning_delay);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -78,7 +78,6 @@ class CommandeStats extends Stats
|
||||
$this->field = 'total_ht';
|
||||
$this->field_line = 'total_ht';
|
||||
$this->where .= " c.fk_statut > 0"; // Not draft and not cancelled
|
||||
$this->categ_link=MAIN_DB_PREFIX.'categorie_societe';
|
||||
}
|
||||
elseif ($mode == 'supplier')
|
||||
{
|
||||
@ -88,7 +87,6 @@ class CommandeStats extends Stats
|
||||
$this->field = 'total_ht';
|
||||
$this->field_line = 'total_ht';
|
||||
$this->where .= " c.fk_statut > 2"; // Only approved & ordered
|
||||
$this->categ_link=MAIN_DB_PREFIX.'categorie_fournisseur';
|
||||
}
|
||||
//$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity;
|
||||
$this->where .= ' AND c.entity IN ('.getEntity('commande').')';
|
||||
@ -108,7 +106,7 @@ class CommandeStats extends Stats
|
||||
|
||||
if ($categid)
|
||||
{
|
||||
$this->join .= ' LEFT JOIN '.$this->categ_link.' as cats ON cats.fk_soc = c.fk_soc';
|
||||
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cats ON cats.fk_soc = c.fk_soc';
|
||||
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cat.rowid = cats.fk_categorie';
|
||||
$this->where .= ' AND cat.rowid = '.$categid;
|
||||
}
|
||||
|
||||
@ -263,7 +263,7 @@ $help_url = "EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_P
|
||||
// llxHeader('',$title,$help_url);
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql .= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
||||
$sql .= " typent.code as typent_code,";
|
||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||
|
||||
@ -38,11 +38,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
||||
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
||||
|
||||
$mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
|
||||
$mode = GETPOST("mode") ?GETPOST("mode") : 'customer';
|
||||
if ($mode == 'customer' && !$user->rights->commande->lire) accessforbidden();
|
||||
if ($mode == 'supplier' && !$user->rights->fournisseur->commande->lire) accessforbidden();
|
||||
|
||||
$object_status = GETPOST('object_status', 'intcomma');
|
||||
$object_status = GETPOST('object_status');
|
||||
$typent_id = GETPOST('typent_id', 'int');
|
||||
$categ_id = GETPOST('categ_id', 'categ_id');
|
||||
|
||||
@ -289,7 +289,7 @@ if ($mode == 'customer')
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
$cat_type = Categorie::TYPE_SUPPLIER;
|
||||
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier"));
|
||||
$cat_label = $langs->trans("Supplier").' '.lcfirst($langs->trans("Customer"));
|
||||
}
|
||||
print '<tr><td>'.$cat_label.'</td><td>';
|
||||
print $formother->select_categories($cat_type, $categ_id, 'categ_id', true);
|
||||
@ -308,11 +308,11 @@ if ($mode == 'customer')
|
||||
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
||||
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceled")
|
||||
);
|
||||
print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'intcomma'), -4);
|
||||
print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'int'), -4);
|
||||
}
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
$formorder->selectSupplierOrderStatus((strstr($object_status, ',') ? -1 : $object_status), 0, 'object_status');
|
||||
$formorder->selectSupplierOrderStatus((strstr($object_status, ',') ?-1 : $object_status), 0, 'object_status');
|
||||
}
|
||||
print '</td></tr>';
|
||||
// Year
|
||||
|
||||
@ -246,7 +246,7 @@ if ($action == 'update')
|
||||
if (!$error)
|
||||
{
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
@ -907,7 +907,7 @@ else
|
||||
print '<td><input size="12" type="text" class="flat" name="account_min_allowed" value="'.(isset($_POST["account_min_allowed"]) ?GETPOST("account_min_allowed") : $object->min_allowed).'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("BalanceMinimalDesired").'</td>';
|
||||
print '<td><input size="12" type="text" class="flat" name="account_min_desired" value="'.(isset($_POST["account_min_desired"]) ?GETPOST("account_min_desired") : $object->min_desired).'"></td></tr>';
|
||||
print '<td ><input size="12" type="text" class="flat" name="account_min_desired" value="'.(isset($_POST["account_min_desired"]) ?GETPOST("account_min_desired") : $object->min_desired).'"></td></tr>';
|
||||
|
||||
// Web
|
||||
print '<tr><td>'.$langs->trans("Web").'</td>';
|
||||
|
||||
@ -135,7 +135,7 @@ if ($result)
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td>".$objp->label."</td>";
|
||||
print "<td >".$objp->label."</td>";
|
||||
print '<td class="center">';
|
||||
print '<a class="editfielda reposition marginleftonly marginrightonly" href="'.$_SERVER["PHP_SELF"].'?categid='.$objp->rowid.'&action=edit">'.img_edit().'</a>';
|
||||
print '<a class="marginleftonly" href="'.$_SERVER["PHP_SELF"].'?categid='.$objp->rowid.'&action=delete">'.img_delete().'</a>';
|
||||
|
||||
@ -581,8 +581,7 @@ class Account extends CommonObject
|
||||
|
||||
return $accline->id;
|
||||
} else {
|
||||
$this->error = $accline->error;
|
||||
$this->errors = $accline->errors;
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
|
||||
return -2;
|
||||
|
||||
@ -137,7 +137,7 @@ class PaymentVarious extends CommonObject
|
||||
$sql .= " datev='".$this->db->idate($this->datev)."',";
|
||||
$sql .= " sens=".(int) $this->sens.",";
|
||||
$sql .= " amount=".price2num($this->amount).",";
|
||||
$sql .= " fk_typepayment=".(int) $this->type_payment.",";
|
||||
$sql .= " fk_typepayment=".(int) $this->fk_typepayment.",";
|
||||
$sql .= " num_payment='".$this->db->escape($this->num_payment)."',";
|
||||
$sql .= " label='".$this->db->escape($this->label)."',";
|
||||
$sql .= " note='".$this->db->escape($this->note)."',";
|
||||
|
||||
@ -51,12 +51,8 @@ $sens = GETPOST("sens", "int");
|
||||
$amount = price2num(GETPOST("amount", "alpha"));
|
||||
$paymenttype = GETPOST("paymenttype", "int");
|
||||
$accountancy_code = GETPOST("accountancy_code", "alpha");
|
||||
$subledger_account = GETPOST("subledger_account", "alpha");
|
||||
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int'));
|
||||
if (!empty($conf->accounting->enabled) && !empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||
$subledger_account = GETPOST("subledger_account", "alpha") > 0 ? GETPOST("subledger_account", "alpha") : '';
|
||||
} else {
|
||||
$subledger_account = GETPOST("subledger_account", "alpha");
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST("socid", "int");
|
||||
@ -119,7 +115,7 @@ if (empty($reshook))
|
||||
$object->category_transaction = GETPOST("category_transaction", 'alpha');
|
||||
|
||||
$object->accountancy_code = GETPOST("accountancy_code") > 0 ? GETPOST("accountancy_code", "alpha") : "";
|
||||
$object->subledger_account = $subledger_account;
|
||||
$object->subledger_account = GETPOST("subledger_account") > 0 ? GETPOST("subledger_account", "alpha") : "";
|
||||
|
||||
$object->sens = GETPOST('sens');
|
||||
$object->fk_project = GETPOST('fk_project', 'int');
|
||||
@ -223,11 +219,9 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
if ($action == 'setsubledger_account') {
|
||||
$db->begin();
|
||||
|
||||
$result = $object->fetch($id);
|
||||
|
||||
$object->subledger_account = $subledger_account;
|
||||
$object->subledger_account = (GETPOST("subledger_account") > 0 ? GETPOST("subledger_account", "alpha") : "");
|
||||
|
||||
$res = $object->update($user);
|
||||
if ($res > 0) {
|
||||
|
||||
@ -53,8 +53,6 @@ $search_accountancy_account = GETPOST("search_accountancy_account");
|
||||
if ($search_accountancy_account == - 1) $search_accountancy_account = '';
|
||||
$search_accountancy_subledger = GETPOST("search_accountancy_subledger");
|
||||
if ($search_accountancy_subledger == - 1) $search_accountancy_subledger = '';
|
||||
if (empty($search_date_start)) $search_date_start = GETPOST("search_date_start", 'int');
|
||||
if (empty($search_date_end)) $search_date_end = GETPOST("search_date_end", 'int');
|
||||
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
@ -64,7 +62,7 @@ $offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (!$sortfield) $sortfield = "v.datep,v.rowid";
|
||||
if (!$sortorder) $sortorder="DESC,DESC";
|
||||
if (!$sortorder) $sortorder = "DESC";
|
||||
|
||||
$filtre = GETPOST("filtre", 'alpha');
|
||||
|
||||
@ -161,7 +159,7 @@ if ($result)
|
||||
if ($typeid > 0) $param .= '&typeid='.urlencode($typeid);
|
||||
if ($search_amount_deb) $param .= '&search_amount_deb='.urlencode($search_amount_deb);
|
||||
if ($search_amount_cred) $param .= '&search_amount_cred='.urlencode($search_amount_cred);
|
||||
if ($search_account > 0) $param .= '&search_account='.urlencode($search_account);
|
||||
if ($search_account > 0) $param .= '&search_amount='.urlencode($search_account);
|
||||
if ($search_accountancy_account > 0) $param .= '&search_accountancy_account='.urlencode($search_accountancy_account);
|
||||
if ($search_accountancy_subledger > 0) $param .= '&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
|
||||
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php';
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ $sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id =
|
||||
$sql .= " AND f.module_source = '".$db->escape($posmodule)."'";
|
||||
$sql .= " AND f.pos_source = '".$db->escape($terminalid)."'";
|
||||
$sql .= " AND f.paye = 1";
|
||||
$sql .= " AND p.entity = ".$conf->entity; // Never share entities for features related to accountancy
|
||||
$sql .= " AND p.entity IN (".getEntity('facture').")";
|
||||
/*if ($key == 'cash') $sql.=" AND cp.code = 'LIQ'";
|
||||
elseif ($key == 'cheque') $sql.=" AND cp.code = 'CHQ'";
|
||||
elseif ($key == 'card') $sql.=" AND cp.code = 'CB'";
|
||||
@ -127,9 +127,8 @@ if ($resql)
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
print "<!-- title of cash fence -->\n";
|
||||
print "<center><h2>";
|
||||
if ($cashcontrol->status != $cashcontrol::STATUS_DRAFT) print $langs->trans("CashControl")." ".$cashcontrol->id;
|
||||
if ($cashcontrol->status == 2) print $langs->trans("CashControl")." ".$cashcontrol->id;
|
||||
else print $langs->trans("CashControl")." - ".$langs->trans("Draft");
|
||||
print "<br>".$langs->trans("DateCreationShort").": ".dol_print_date($cashcontrol->date_creation, 'dayhour')."</h2></center>";
|
||||
|
||||
|
||||
@ -243,8 +243,6 @@ if (empty($reshook))
|
||||
|
||||
$result = $object->deleteline(GETPOST('lineid'));
|
||||
if ($result > 0) {
|
||||
// reorder lines
|
||||
$object->line_order(true);
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
@ -320,8 +318,8 @@ if (empty($reshook))
|
||||
//var_dump($array_of_total_ht_per_vat_rate);exit;
|
||||
foreach ($array_of_total_ht_per_vat_rate as $vatrate => $tmpvalue)
|
||||
{
|
||||
$tmp_total_ht = price2num($array_of_total_ht_per_vat_rate[$vatrate]);
|
||||
$tmp_total_ht_devise = price2num($array_of_total_ht_devise_per_vat_rate[$vatrate]);
|
||||
$tmp_total_ht = $array_of_total_ht_per_vat_rate[$vatrate];
|
||||
$tmp_total_ht_devise = $array_of_total_ht_devise_per_vat_rate[$vatrate];
|
||||
|
||||
if (($tmp_total_ht < 0 || $tmp_total_ht_devise < 0) && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
|
||||
{
|
||||
@ -347,6 +345,15 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
elseif ($action == 'set_thirdparty' && $usercancreate)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$object->setValueFrom('fk_soc', $socid, '', null, 'int', '', $user, 'BILL_MODIFY');
|
||||
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id);
|
||||
exit();
|
||||
}
|
||||
|
||||
elseif ($action == 'classin' && $usercancreate)
|
||||
{
|
||||
$object->fetch($id);
|
||||
@ -440,35 +447,16 @@ if (empty($reshook))
|
||||
$object->fetch($id);
|
||||
$object->cond_reglement_code = 0; // To clean property
|
||||
$object->cond_reglement_id = 0; // To clean property
|
||||
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
|
||||
if ($result < 0) dol_print_error($db, $object->error);
|
||||
|
||||
$error = 0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (! $error) {
|
||||
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
$old_date_lim_reglement = $object->date_lim_reglement;
|
||||
$new_date_lim_reglement = $object->calculate_date_lim_reglement();
|
||||
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement;
|
||||
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement = $object->date;
|
||||
$result = $object->update($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$db->rollback();
|
||||
} else {
|
||||
$db->commit();
|
||||
$old_date_lim_reglement = $object->date_lim_reglement;
|
||||
$new_date_lim_reglement = $object->calculate_date_lim_reglement();
|
||||
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement;
|
||||
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement = $object->date;
|
||||
$result = $object->update($user);
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
}
|
||||
|
||||
@ -710,7 +698,6 @@ if (empty($reshook))
|
||||
$outputlangs->load('products');
|
||||
}
|
||||
$model = $object->modelpdf;
|
||||
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
|
||||
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
@ -1034,7 +1021,6 @@ if (empty($reshook))
|
||||
elseif ($action == 'add' && $usercancreate)
|
||||
{
|
||||
if ($socid > 0) $object->socid = GETPOST('socid', 'int');
|
||||
$selectedLines = GETPOST('toselect', 'array');
|
||||
|
||||
$db->begin();
|
||||
|
||||
@ -1644,11 +1630,8 @@ if (empty($reshook))
|
||||
|
||||
$fk_parent_line = 0;
|
||||
$num = count($lines);
|
||||
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
if (!in_array($lines[$i]->id, $selectedLines)) continue; // Skip unselected lines
|
||||
|
||||
// Don't add lines with qty 0 when coming from a shipment including all order lines
|
||||
if ($srcobject->element == 'shipping' && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS && $lines[$i]->qty == 0) continue;
|
||||
// Don't add closed lines when coming from a contract (Set constant to '0,5' to exclude also inactive lines)
|
||||
@ -1670,11 +1653,6 @@ if (empty($reshook))
|
||||
$discount->tva_tx = $lines[$i]->tva_tx;
|
||||
$discount->fk_user = $user->id;
|
||||
$discount->description = $desc;
|
||||
$discount->multicurrency_subprice = abs($lines[$i]->multicurrency_subprice);
|
||||
$discount->multicurrency_amount_ht = abs($lines[$i]->multicurrency_total_ht);
|
||||
$discount->multicurrency_amount_tva = abs($lines[$i]->multicurrency_total_tva);
|
||||
$discount->multicurrency_amount_ttc = abs($lines[$i]->multicurrency_total_ttc);
|
||||
|
||||
$discountid = $discount->create($user);
|
||||
if ($discountid > 0) {
|
||||
$result = $object->insert_discount($discountid); // This include link_to_invoice
|
||||
@ -2541,7 +2519,7 @@ if (empty($reshook))
|
||||
{
|
||||
$object->fetch($id, '', '', '', true);
|
||||
|
||||
if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED))
|
||||
if ($object->statut == Facture::STATUS_VALIDATED
|
||||
&& $object->type == Facture::TYPE_SITUATION
|
||||
&& $usercancreate
|
||||
&& !$objectidnext
|
||||
@ -2829,7 +2807,6 @@ if (empty($reshook))
|
||||
* View
|
||||
*/
|
||||
|
||||
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
$formfile = new FormFile($db);
|
||||
@ -3520,7 +3497,7 @@ if ($action == 'create')
|
||||
}
|
||||
});
|
||||
|
||||
$("[name=\'type\']:checked").trigger("change");
|
||||
$("[name=\'type\']").trigger("change");
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
@ -3571,7 +3548,7 @@ if ($action == 'create')
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
if (!empty($conf->global->THIRDPARTY_PROPAGATE_EXTRAFIELDS_TO_INVOICE) && !empty($soc->id)) {
|
||||
if (!empty($conf->global->THIRDPARTY_PROPAGATE_EXTRAFIELDS_TO_INVOICE)) {
|
||||
// copy from thirdparty
|
||||
$tpExtrafields = new Extrafields($db);
|
||||
$tpExtrafieldLabels = $tpExtrafields->fetch_name_optionals_label($soc->table_element);
|
||||
@ -3739,6 +3716,8 @@ if ($action == 'create')
|
||||
print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
|
||||
print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
// Show origin lines
|
||||
if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
|
||||
print '<br>';
|
||||
@ -3748,24 +3727,15 @@ if ($action == 'create')
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
$objectsrc->printOriginLinesList('', $selectedLines);
|
||||
$objectsrc->printOriginLinesList();
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
print "</form>\n";
|
||||
print '<br>';
|
||||
}
|
||||
elseif ($id > 0 || !empty($ref))
|
||||
{
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$langs->load('errors');
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound");
|
||||
echo ' <a href="javascript:history.go(-1)">'.$langs->trans('GoBack').'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Show object in view mode
|
||||
*/
|
||||
@ -3889,7 +3859,7 @@ elseif ($id > 0 || !empty($ref))
|
||||
$label = $langs->trans("ConfirmOuting");
|
||||
$formquestion = array();
|
||||
// remove situation from cycle
|
||||
if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED))
|
||||
if ($object->statut == Facture::STATUS_VALIDATED
|
||||
&& $usercancreate
|
||||
&& !$objectidnext
|
||||
&& $object->is_last_in_cycle()
|
||||
@ -4865,15 +4835,7 @@ elseif ($id > 0 || !empty($ref))
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $paymentstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$dateofpayment = $db->jdate($objp->dp);
|
||||
$tmparray = dol_getdate($dateofpayment);
|
||||
if ($tmparray['seconds'] == 0 && $tmparray['minutes'] == 0 && ($tmparray['hours'] == 0 || $tmparray['hours'] == 12)) { // We set hours to 0:00 or 12:00 because we don't know it
|
||||
print dol_print_date($dateofpayment, 'day');
|
||||
} else { // Hours was set to real date of payment (special case for POS for example)
|
||||
print dol_print_date($dateofpayment, 'dayhour', 'tzuser');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.dol_print_date($db->jdate($objp->dp), 'dayhour').'</td>';
|
||||
$label = ($langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code)) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label;
|
||||
print '<td>'.$label.' '.$objp->num_payment.'</td>';
|
||||
if (!empty($conf->banque->enabled))
|
||||
@ -5223,8 +5185,7 @@ elseif ($id > 0 || !empty($ref))
|
||||
// Reopen a standard paid invoice
|
||||
if ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT)
|
||||
|| ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id))
|
||||
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id))
|
||||
|| ($object->type == Facture::TYPE_SITUATION && empty($discount->id)))
|
||||
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id)))
|
||||
&& ($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
|
||||
&& ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) // A paid invoice (partially or completely)
|
||||
{
|
||||
@ -5371,7 +5332,7 @@ elseif ($id > 0 || !empty($ref))
|
||||
}
|
||||
|
||||
// Create a credit note
|
||||
if (($object->type == Facture::TYPE_STANDARD || ($object->type == Facture::TYPE_DEPOSIT && empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) ) || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate)
|
||||
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate)
|
||||
{
|
||||
if (!$objectidnext)
|
||||
{
|
||||
@ -5413,7 +5374,7 @@ elseif ($id > 0 || !empty($ref))
|
||||
}
|
||||
|
||||
// Remove situation from cycle
|
||||
if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED))
|
||||
if ($object->statut > Facture::STATUS_DRAFT
|
||||
&& $object->type == Facture::TYPE_SITUATION
|
||||
&& $usercancreate
|
||||
&& !$objectidnext
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
/* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
*
|
||||
* 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
|
||||
|
||||
@ -155,7 +155,7 @@ class FactureRec extends CommonInvoice
|
||||
'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>105),
|
||||
'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110),
|
||||
'modelpdf' =>array('type'=>'varchar(255)', 'label'=>'Modelpdf', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
|
||||
'date_last_gen' =>array('type'=>'varchar(7)', 'label'=>'Last gen', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
|
||||
'last_gen' =>array('type'=>'varchar(7)', 'label'=>'Last gen', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
|
||||
'unit_frequency' =>array('type'=>'varchar(2)', 'label'=>'Unit frequency', 'enabled'=>1, 'visible'=>-1, 'position'=>125),
|
||||
'date_when' =>array('type'=>'datetime', 'label'=>'Date when', 'enabled'=>1, 'visible'=>-1, 'position'=>130),
|
||||
'date_last_gen' =>array('type'=>'datetime', 'label'=>'Date last gen', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
|
||||
@ -849,9 +849,7 @@ class FactureRec extends CommonInvoice
|
||||
$qty = price2num($qty);
|
||||
$pu_ht = price2num($pu_ht);
|
||||
$pu_ttc = price2num($pu_ttc);
|
||||
if (!preg_match('/\((.*)\)/', $txtva)) {
|
||||
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
|
||||
}
|
||||
$txtva = price2num($txtva);
|
||||
$txlocaltax1 = price2num($txlocaltax1);
|
||||
$txlocaltax2 = price2num($txlocaltax2);
|
||||
if (empty($txtva)) $txtva = 0;
|
||||
@ -1033,10 +1031,8 @@ class FactureRec extends CommonInvoice
|
||||
$pu_ht = price2num($pu_ht);
|
||||
$pu_ttc = price2num($pu_ttc);
|
||||
$pu_ht_devise = price2num($pu_ht_devise);
|
||||
if (!preg_match('/\((.*)\)/', $txtva)) {
|
||||
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
|
||||
}
|
||||
$txlocaltax1 = price2num($txlocaltax1);
|
||||
$txtva = price2num($txtva);
|
||||
$txlocaltax1 = price2num($txlocaltax1);
|
||||
$txlocaltax2 = price2num($txlocaltax2);
|
||||
if (empty($txlocaltax1)) $txlocaltax1 = 0;
|
||||
if (empty($txlocaltax2)) $txlocaltax2 = 0;
|
||||
@ -1063,7 +1059,6 @@ class FactureRec extends CommonInvoice
|
||||
|
||||
// Clean vat code
|
||||
$vat_src_code = '';
|
||||
$reg = array();
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
{
|
||||
$vat_src_code = $reg[1];
|
||||
|
||||
@ -783,7 +783,6 @@ class Facture extends CommonInvoice
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error = $newinvoiceline->error;
|
||||
$this->errors = $newinvoiceline->errors;
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
@ -2524,7 +2523,7 @@ class Facture extends CommonInvoice
|
||||
$this->db->begin();
|
||||
|
||||
// Check parameters
|
||||
if ($this->type == self::TYPE_REPLACEMENT) // if this is a replacement invoice
|
||||
if ($this->type == self::TYPE_REPLACEMENT) // si facture de remplacement
|
||||
{
|
||||
// Controle que facture source connue
|
||||
if ($this->fk_facture_source <= 0)
|
||||
@ -2534,7 +2533,7 @@ class Facture extends CommonInvoice
|
||||
return -10;
|
||||
}
|
||||
|
||||
// Load source invoice that has been replaced
|
||||
// Charge la facture source a remplacer
|
||||
$facreplaced = new Facture($this->db);
|
||||
$result = $facreplaced->fetch($this->fk_facture_source);
|
||||
if ($result <= 0)
|
||||
@ -2544,7 +2543,7 @@ class Facture extends CommonInvoice
|
||||
return -11;
|
||||
}
|
||||
|
||||
// Check that source invoice not already replaced by another one.
|
||||
// Controle que facture source non deja remplacee par une autre
|
||||
$idreplacement = $facreplaced->getIdReplacingInvoice('validated');
|
||||
if ($idreplacement && $idreplacement != $this->id)
|
||||
{
|
||||
@ -3228,7 +3227,6 @@ class Facture extends CommonInvoice
|
||||
else
|
||||
{
|
||||
$this->error = $this->line->error;
|
||||
$this->errors = $this->line->errors;
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
@ -3313,9 +3311,7 @@ class Facture extends CommonInvoice
|
||||
$pu = price2num($pu);
|
||||
$pu_ht_devise = price2num($pu_ht_devise);
|
||||
$pa_ht = price2num($pa_ht);
|
||||
if (!preg_match('/\((.*)\)/', $txtva)) {
|
||||
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
|
||||
}
|
||||
$txtva = price2num($txtva);
|
||||
$txlocaltax1 = price2num($txlocaltax1);
|
||||
$txlocaltax2 = price2num($txlocaltax2);
|
||||
|
||||
@ -3330,7 +3326,6 @@ class Facture extends CommonInvoice
|
||||
|
||||
// Clean vat code
|
||||
$vat_src_code = '';
|
||||
$reg = array();
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
{
|
||||
$vat_src_code = $reg[1];
|
||||
@ -4402,14 +4397,15 @@ class Facture extends CommonInvoice
|
||||
* @param int $hidedetails Hide details of lines
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hideref Hide ref
|
||||
* @param null|array $moreparams Array to provide more information
|
||||
* @param null|array $moreparams Array to provide more information
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$outputlangs->loadLangs(array("bills", "products"));
|
||||
$langs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele))
|
||||
{
|
||||
|
||||
@ -86,14 +86,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$langs->load('errors');
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Documents');
|
||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
@ -43,14 +43,6 @@ $ref = GETPOST("ref", 'alpha');
|
||||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$langs->load('errors');
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info');
|
||||
|
||||
@ -274,7 +274,7 @@ if ($search_status != '' && $search_status >= -1)
|
||||
if ($search_status == -1) $sql .= ' AND suspended = 1';
|
||||
}
|
||||
$sql .= dolSqlDateFilter('f.date_last_gen', $search_day, $search_month, $search_year);
|
||||
$sql .= dolSqlDateFilter('f.date_when', $search_day_date_when, $search_month_date_when, $search_year_date_when);
|
||||
$sql .= dolSqlDateFilter('f.date_last_gen', $search_day_date_when, $search_month_date_when, $search_year_date_when);
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
@ -478,7 +478,7 @@ if ($resql)
|
||||
}
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="middle">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0, 'checkforselect', 1);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
@ -502,7 +502,7 @@ if ($resql)
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
if (!empty($arrayfields['status']['checked'])) print_liste_field_titre($arrayfields['status']['label'], $_SERVER['PHP_SELF'], "f.suspended,f.frequency", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'nomaxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
if ($num > 0)
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
* Copyright (C) 2015-2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2017 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2019-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -105,30 +105,12 @@ $search_country = GETPOST("search_country", 'int');
|
||||
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
|
||||
$search_user = GETPOST('search_user', 'int');
|
||||
$search_sale = GETPOST('search_sale', 'int');
|
||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
|
||||
$search_date_startyear = GETPOST('search_date_startyear', 'int');
|
||||
$search_date_endday = GETPOST('search_date_endday', 'int');
|
||||
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
|
||||
$search_date_endyear = GETPOST('search_date_endyear', 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
|
||||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_date_valid_startday = GETPOST('search_date_valid_startday', 'int');
|
||||
$search_date_valid_startmonth = GETPOST('search_date_valid_startmonth', 'int');
|
||||
$search_date_valid_startyear = GETPOST('search_date_valid_startyear', 'int');
|
||||
$search_date_valid_endday = GETPOST('search_date_valid_endday', 'int');
|
||||
$search_date_valid_endmonth = GETPOST('search_date_valid_endmonth', 'int');
|
||||
$search_date_valid_endyear = GETPOST('search_date_valid_endyear', 'int');
|
||||
$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear);
|
||||
$search_date_valid_end = dol_mktime(23, 59, 59, $search_date_valid_endmonth, $search_date_valid_endday, $search_date_valid_endyear);
|
||||
$search_datelimit_startday = GETPOST('search_datelimit_startday', 'int');
|
||||
$search_datelimit_startmonth = GETPOST('search_datelimit_startmonth', 'int');
|
||||
$search_datelimit_startyear = GETPOST('search_datelimit_startyear', 'int');
|
||||
$search_datelimit_endday = GETPOST('search_datelimit_endday', 'int');
|
||||
$search_datelimit_endmonth = GETPOST('search_datelimit_endmonth', 'int');
|
||||
$search_datelimit_endyear = GETPOST('search_datelimit_endyear', 'int');
|
||||
$search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear);
|
||||
$search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear);
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_date_valid_start = dol_mktime(0, 0, 0, GETPOST('search_date_valid_startmonth', 'int'), GETPOST('search_date_valid_startday', 'int'), GETPOST('search_date_valid_startyear', 'int'));
|
||||
$search_date_valid_end = dol_mktime(23, 59, 59, GETPOST('search_date_valid_endmonth', 'int'), GETPOST('search_date_valid_endday', 'int'), GETPOST('search_date_valid_endyear', 'int'));
|
||||
$search_datelimit_start = dol_mktime(0, 0, 0, GETPOST('search_datelimit_startmonth', 'int'), GETPOST('search_datelimit_startday', 'int'), GETPOST('search_datelimit_startyear', 'int'));
|
||||
$search_datelimit_end = dol_mktime(23, 59, 59, GETPOST('search_datelimit_endmonth', 'int'), GETPOST('search_datelimit_endday', 'int'), GETPOST('search_datelimit_endyear', 'int'));
|
||||
$search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
|
||||
$search_btn = GETPOST('button_search', 'alpha');
|
||||
$search_remove_btn = GETPOST('button_removefilter', 'alpha');
|
||||
@ -291,28 +273,10 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
|
||||
$search_type = '';
|
||||
$search_country = '';
|
||||
$search_type_thirdparty = '';
|
||||
$search_date_startday = '';
|
||||
$search_date_startmonth = '';
|
||||
$search_date_startyear = '';
|
||||
$search_date_endday = '';
|
||||
$search_date_endmonth = '';
|
||||
$search_date_endyear = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_date_valid_startday = '';
|
||||
$search_date_valid_startmonth = '';
|
||||
$search_date_valid_startyear = '';
|
||||
$search_date_valid_endday = '';
|
||||
$search_date_valid_endmonth = '';
|
||||
$search_date_valid_endyear = '';
|
||||
$search_date_valid_start = '';
|
||||
$search_date_valid_end = '';
|
||||
$search_datelimit_startday = '';
|
||||
$search_datelimit_startmonth = '';
|
||||
$search_datelimit_startyear = '';
|
||||
$search_datelimit_endday = '';
|
||||
$search_datelimit_endmonth = '';
|
||||
$search_datelimit_endyear = '';
|
||||
$search_datelimit_start = '';
|
||||
$search_datelimit_end = '';
|
||||
$option = '';
|
||||
@ -452,7 +416,7 @@ $formcompany = new FormCompany($db);
|
||||
$thirdpartystatic = new Societe($db);
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql .= ' f.rowid as id, f.ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,';
|
||||
$sql .= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,';
|
||||
$sql .= ' f.fk_user_author,';
|
||||
@ -530,6 +494,7 @@ if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
|
||||
if ($search_state) $sql .= natural_search("state.nom", $search_state);
|
||||
if ($search_country) $sql .= " AND s.fk_pays IN (".$db->escape($search_country).')';
|
||||
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search_type_thirdparty).')';
|
||||
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||
if ($search_montant_ht != '') $sql .= natural_search('f.total', $search_montant_ht, 1);
|
||||
if ($search_montant_vat != '') $sql .= natural_search('f.tva', $search_montant_vat, 1);
|
||||
if ($search_montant_localtax1 != '') $sql .= natural_search('f.localtax1', $search_montant_localtax1, 1);
|
||||
@ -658,24 +623,12 @@ if ($resql)
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||
if ($sall) $param .= '&sall='.urlencode($sall);
|
||||
if ($search_date_startday) $param .= '&search_date_startday='.urlencode($search_date_startday);
|
||||
if ($search_date_startmonth) $param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
|
||||
if ($search_date_startyear) $param .= '&search_date_startyear='.urlencode($search_date_startyear);
|
||||
if ($search_date_endday) $param .= '&search_date_endday='.urlencode($search_date_endday);
|
||||
if ($search_date_endmonth) $param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
|
||||
if ($search_date_endyear) $param .= '&search_date_endyear='.urlencode($search_date_endyear);
|
||||
if ($search_date_valid_startday) $param .= '&search_date_valid_startday='.urlencode($search_date_valid_startday);
|
||||
if ($search_date_valid_startmonth) $param .= '&search_date_valid_startmonth='.urlencode($search_date_valid_startmonth);
|
||||
if ($search_date_valid_startyear) $param .= '&search_date_valid_startyear='.urlencode($search_date_valid_startyear);
|
||||
if ($search_date_valid_endday) $param .= '&search_date_valid_endday='.urlencode($search_date_valid_endday);
|
||||
if ($search_date_valid_endmonth) $param .= '&search_date_valid_endmonth='.urlencode($search_date_valid_endmonth);
|
||||
if ($search_date_valid_endyear) $param .= '&search_date_valid_endyear='.urlencode($search_date_valid_endyear);
|
||||
if ($search_datelimit_startday) $param .= '&search_datelimit_startday='.urlencode($search_datelimit_startday);
|
||||
if ($search_datelimit_startmonth) $param .= '&search_datelimit_startmonth='.urlencode($search_datelimit_startmonth);
|
||||
if ($search_datelimit_startyear) $param .= '&search_datelimit_startyear='.urlencode($search_datelimit_startyear);
|
||||
if ($search_datelimit_endday) $param .= '&search_datelimit_endday='.urlencode($search_datelimit_endday);
|
||||
if ($search_datelimit_endmonth) $param .= '&search_datelimit_endmonth='.urlencode($search_datelimit_endmonth);
|
||||
if ($search_datelimit_endyear) $param .= '&search_datelimit_endyear='.urlencode($search_datelimit_endyear);
|
||||
if ($search_date_start) $param .= '&search_date_start='.urlencode($search_date_start);
|
||||
if ($search_date_end) $param .= '&search_date_end='.urlencode($search_date_end);
|
||||
if ($search_date_valid_start) $param .= '&search_date_valid_start='.urlencode($search_date_valid_start);
|
||||
if ($search_date_valid_end) $param .= '&search_date_valid_end='.urlencode($search_date_valid_end);
|
||||
if ($search_datelimit_start) $param .= '&search_datelimit_start='.urlencode($search_datelimit_start);
|
||||
if ($search_datelimit_end) $param .= '&search_datelimit_end='.urlencode($search_datelimit_end);
|
||||
if ($search_ref) $param .= '&search_ref='.urlencode($search_ref);
|
||||
if ($search_refcustomer) $param .= '&search_refcustomer='.urlencode($search_refcustomer);
|
||||
if ($search_project_ref) $param .= '&search_project_ref='.urlencode($search_project_ref);
|
||||
|
||||
@ -64,14 +64,6 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
|
||||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$langs->load('errors');
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Notes');
|
||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
@ -44,7 +44,7 @@ $mode = GETPOST("mode") ?GETPOST("mode") : 'customer';
|
||||
if ($mode == 'customer' && !$user->rights->facture->lire) accessforbidden();
|
||||
if ($mode == 'supplier' && !$user->rights->fournisseur->facture->lire) accessforbidden();
|
||||
|
||||
$object_status = GETPOST('object_status', 'intcomma');
|
||||
$object_status = GETPOST('object_status');
|
||||
$typent_id = GETPOST('typent_id', 'int');
|
||||
$categ_id = GETPOST('categ_id', 'categ_id');
|
||||
|
||||
@ -59,7 +59,7 @@ if ($user->socid > 0)
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
|
||||
if(!empty($conf->global->INVOICE_STATS_GRAPHS_SHOW_2_YEARS)) $startyear=$year-2;
|
||||
else $startyear=$year-1;
|
||||
$endyear = $year;
|
||||
@ -92,23 +92,17 @@ print load_fiche_titre($title, '', $picto);
|
||||
dol_mkdir($dir);
|
||||
|
||||
$stats = new FactureStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0));
|
||||
if ($mode == 'customer') {
|
||||
if ($object_status != '' && $object_status >= 0) {
|
||||
$stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||
}
|
||||
if ($mode == 'customer')
|
||||
{
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||
if (is_array($custcats) && !empty($custcats)) {
|
||||
$stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cat ON (f.fk_soc = cat.fk_soc)';
|
||||
$stats->where .= ' AND cat.fk_categorie IN ('.implode(',', $custcats).')';
|
||||
}
|
||||
}
|
||||
if ($mode == 'supplier') {
|
||||
if ($object_status != '' && $object_status >= 0) {
|
||||
$stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||
}
|
||||
if (is_array($custcats) && !empty($custcats)) {
|
||||
$stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_fournisseur as cat ON (f.fk_soc = cat.fk_soc)';
|
||||
$stats->where .= ' AND cat.fk_categorie IN ('.implode(',', $custcats).')';
|
||||
}
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||
}
|
||||
|
||||
// Build graphic number of object
|
||||
@ -289,7 +283,7 @@ if (! empty($conf->category->enabled)) {
|
||||
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier"));
|
||||
}
|
||||
print '<tr><td>'.$cat_label.'</td><td>';
|
||||
$cate_arbo = $form->select_all_categories($cat_type, null, 'parent', null, null, 1);
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1);
|
||||
print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%");
|
||||
//print $formother->select_categories($cat_type, $categ_id, 'categ_id', true);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -85,14 +85,7 @@ foreach ($linkedObjectBlock as $key => $objectlink)
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="linkedcol-statut right">';
|
||||
if (method_exists($objectlink, 'getSommePaiement')) {
|
||||
print $objectlink->getLibStatut(3, $objectlink->getSommePaiement());
|
||||
}
|
||||
else {
|
||||
print $objectlink->getLibStatut(3);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
|
||||
print '<td class="linkedcol-action right"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
@ -109,70 +109,28 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture->
|
||||
$object->fetch($id);
|
||||
if ($object->valide($user) > 0)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
// Loop on each invoice linked to this payment to rebuild PDF
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
$outputlangs = $langs;
|
||||
if (!empty($_REQUEST['lang_id']))
|
||||
{
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
||||
}
|
||||
$factures = array();
|
||||
foreach ($factures as $id)
|
||||
{
|
||||
$fac = new Facture($db);
|
||||
$fac->fetch($id);
|
||||
|
||||
$hidedetails = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0;
|
||||
$hidedesc = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0;
|
||||
$hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0;
|
||||
|
||||
$sql = 'SELECT f.rowid as facid';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
|
||||
$sql .= ' WHERE pf.fk_facture = f.rowid';
|
||||
$sql .= ' AND f.fk_soc = s.rowid';
|
||||
$sql .= ' AND f.entity IN ('.getEntity('invoice').')';
|
||||
$sql .= ' AND pf.fk_paiement = '.$object->id;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$invoice = new Facture($db);
|
||||
|
||||
if ($invoice->fetch($objp->facid) <= 0) {
|
||||
$errors++;
|
||||
setEventMessage($invoice->error, $invoice->errors, 'errors');
|
||||
break;
|
||||
}
|
||||
|
||||
if ($invoice->generateDocument($invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref) < 0) {
|
||||
$errors++;
|
||||
setEventMessage($invoice->error, $invoice->errors, 'errors');
|
||||
break;
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors++;
|
||||
setEventMessage($db->error, $db->errors, 'errors');
|
||||
}
|
||||
$outputlangs = $langs;
|
||||
if (!empty($_REQUEST['lang_id']))
|
||||
{
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
||||
}
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
$fac->generateDocument($fac->modelpdf, $outputlangs);
|
||||
}
|
||||
}
|
||||
|
||||
if (! $errors) {
|
||||
$db->commit();
|
||||
|
||||
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
exit;
|
||||
}
|
||||
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -319,8 +277,10 @@ print '</td></tr>';
|
||||
// Bank account
|
||||
if (!empty($conf->banque->enabled))
|
||||
{
|
||||
if ($object->fk_account > 0) {
|
||||
if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) {
|
||||
if ($object->fk_account > 0)
|
||||
{
|
||||
if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0)
|
||||
{
|
||||
dol_include_once('/compta/paiement/cheque/class/remisecheque.class.php');
|
||||
$bordereau = new RemiseCheque($db);
|
||||
$bordereau->fetch($bankline->fk_bordereau);
|
||||
@ -337,12 +297,7 @@ if (!empty($conf->banque->enabled))
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
||||
print '<td>';
|
||||
if ($object->fk_account > 0) {
|
||||
print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
|
||||
} else {
|
||||
$langs->load("admin");
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoRecordFoundIBankcAccount", $langs->transnoentitiesnoconv("Module85Name")).'</span>';
|
||||
}
|
||||
print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@ -443,13 +398,11 @@ if ($resql)
|
||||
print '<td class="right">'.$invoice->getLibStatut(5, $alreadypayed).'</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
// If at least one invoice is paid, disable delete. INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED Can be use for maintenance purpose. Never use this in production
|
||||
if ($objp->paye == 1 && empty($conf->global->INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED)) {
|
||||
if ($objp->paye == 1) // If at least one invoice is paid, disable delete
|
||||
{
|
||||
$disable_delete = 1;
|
||||
$title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid"));
|
||||
}
|
||||
|
||||
$total = $total + $objp->amount;
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -426,13 +426,8 @@ class Paiement extends CommonObject
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
|
||||
$hidedetails = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0;
|
||||
$hidedesc = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0;
|
||||
$hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0;
|
||||
|
||||
$ret = $invoice->fetch($facid); // Reload to get new records
|
||||
$result = $invoice->generateDocument($invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
$result = $invoice->generateDocument($invoice->modelpdf, $outputlangs);
|
||||
if ($result < 0) {
|
||||
setEventMessages($invoice->error, $invoice->errors, 'errors');
|
||||
$error++;
|
||||
@ -1206,16 +1201,7 @@ class Paiement extends CommonObject
|
||||
$result = '';
|
||||
$label = '<u>'.$langs->trans("ShowPayment").'</u><br>';
|
||||
$label .= '<strong>'.$langs->trans("Ref").':</strong> '.$this->ref;
|
||||
$dateofpayment = ($this->datepaye ? $this->datepaye : $this->date);
|
||||
if ($dateofpayment) {
|
||||
$label .= '<br><strong>'.$langs->trans("Date").':</strong> ';
|
||||
$tmparray = dol_getdate($dateofpayment);
|
||||
if ($tmparray['seconds'] == 0 && $tmparray['minutes'] == 0 && ($tmparray['hours'] == 0 || $tmparray['hours'] == 12)) { // We set hours to 0:00 or 12:00 because we don't know it
|
||||
$label .= dol_print_date($dateofpayment, 'day');
|
||||
} else { // Hours was set to real date of payment (special case for POS for example)
|
||||
$label .= dol_print_date($dateofpayment, 'dayhour', 'tzuser');
|
||||
}
|
||||
}
|
||||
if ($this->datepaye ? $this->datepaye : $this->date) $label .= '<br><strong>'.$langs->trans("Date").':</strong> '.dol_print_date($this->datepaye ? $this->datepaye : $this->date, 'dayhour');
|
||||
if ($mode == 'withlistofinvoices')
|
||||
{
|
||||
$arraybill = $this->getBillsArray();
|
||||
|
||||
@ -224,7 +224,7 @@ if ($action == 'create')
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
||||
$datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||
$datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (empty($_POST["remonth"]) ?-1 : $datepaye) : '';
|
||||
$datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (empty($_POST["remonth"]) ?-1 : $datepaye) : 0;
|
||||
print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1);
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
@ -248,7 +248,7 @@ if ($action == 'create')
|
||||
|
||||
print '<tr>';
|
||||
print '<td class="tdtop">'.$langs->trans("Comments").'</td>';
|
||||
print '<td class="tdtop"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'">'.GETPOST('note', 'alphanohtml').'</textarea></td>';
|
||||
print '<td class="tdtop"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'"></textarea></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -296,7 +296,6 @@ if ($action == 'create')
|
||||
print '<td class="right">'.price($objp->amount - $sumpaid)."</td>";
|
||||
|
||||
print '<td class="center">';
|
||||
|
||||
if ($sumpaid < $objp->amount)
|
||||
{
|
||||
$namef = "amount_".$objp->id;
|
||||
@ -305,7 +304,7 @@ if ($action == 'create')
|
||||
print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->amount - $sumpaid)."'");
|
||||
$remaintopay = $objp->amount - $sumpaid;
|
||||
print '<input type=hidden class="sum_remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
|
||||
print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'" value="'.GETPOST('amount_'.$objp->id, 'alpha').'">';
|
||||
print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
47
htdocs/compta/prelevement/card.php
Executable file → Normal file
47
htdocs/compta/prelevement/card.php
Executable file → Normal file
@ -95,21 +95,16 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
// Seems to no be used and replaced with $action == 'infocredit'
|
||||
if ($action == 'confirm_credite' && GETPOST('confirm', 'alpha') == 'yes')
|
||||
{
|
||||
if ($object->statut == 2) {
|
||||
$res = -1;
|
||||
setEventMessages('WithdrawalCantBeCreditedTwice', array(), 'errors');
|
||||
} else {
|
||||
$res=$object->set_credite();
|
||||
}
|
||||
if ($res >= 0)
|
||||
{
|
||||
header("Location: card.php?id=".$id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
// Seems to no be used and replaced with $action == 'infocredit'
|
||||
if ($action == 'confirm_credite' && GETPOST('confirm', 'alpha') == 'yes')
|
||||
{
|
||||
$res = $object->set_credite();
|
||||
if ($res >= 0)
|
||||
{
|
||||
header("Location: card.php?id=".$id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
|
||||
{
|
||||
@ -150,18 +145,12 @@ if (empty($reshook))
|
||||
{
|
||||
$dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||
|
||||
if ($object->statut == 2) {
|
||||
$error = 1;
|
||||
setEventMessages('WithdrawalCantBeCreditedTwice', array(), 'errors');
|
||||
} else {
|
||||
$error = $object->set_infocredit($user, $dt);
|
||||
}
|
||||
|
||||
if ($error)
|
||||
{
|
||||
$error = $object->set_infocredit($user, $dt);
|
||||
if ($error)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -236,7 +225,7 @@ if ($id > 0 || $ref)
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
$acc = new Account($db);
|
||||
$result = $acc->fetch(($object->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT));
|
||||
$result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
$labelofbankfield = "BankToReceiveWithdraw";
|
||||
@ -415,7 +404,7 @@ if ($id > 0 || $ref)
|
||||
print "<td>";
|
||||
print $ligne->LibStatut($obj->statut, 2);
|
||||
print " ";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'&type='.$object->type.'">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'">';
|
||||
print sprintf("%06s", $obj->rowid);
|
||||
print '</a></td>';
|
||||
|
||||
@ -441,7 +430,7 @@ if ($id > 0 || $ref)
|
||||
if ($user->rights->prelevement->bons->credit)
|
||||
{
|
||||
//print '<a class="butActionDelete" href="line.php?action=rejet&id='.$obj->rowid.'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
print '<a href="line.php?action=rejet&type='.$object->type.'&id='.$obj->rowid.'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
print '<a href="line.php?action=rejet&id='.$obj->rowid.'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
7
htdocs/compta/prelevement/class/bonprelevement.class.php
Executable file → Normal file
7
htdocs/compta/prelevement/class/bonprelevement.class.php
Executable file → Normal file
@ -469,7 +469,7 @@ class BonPrelevement extends CommonObject
|
||||
$message = $langs->trans("InfoCreditMessage", $this->ref, dol_print_date($date, 'dayhour'));
|
||||
|
||||
//Add payment of withdrawal into bank
|
||||
$bankaccount = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
$bankaccount = $conf->global->PRELEVEMENT_ID_BANKACCOUNT;
|
||||
$facs = array();
|
||||
$amounts = array();
|
||||
$amountsperthirdparty = array();
|
||||
@ -1766,7 +1766,7 @@ class BonPrelevement extends CommonObject
|
||||
fputs($this->file, ' <Id>'.$CrLf);
|
||||
fputs($this->file, ' <PrvtId>'.$CrLf);
|
||||
fputs($this->file, ' <Othr>'.$CrLf);
|
||||
fputs($this->file, ' <Id>'.$conf->global->PAYMENTBYBANKTRANSFER_ICS.'</Id>'.$CrLf);
|
||||
fputs($this->file, ' <Id>'.$conf->global->PRELEVEMENT_ICS.'</Id>'.$CrLf);
|
||||
fputs($this->file, ' </Othr>'.$CrLf);
|
||||
fputs($this->file, ' </PrvtId>'.$CrLf);
|
||||
fputs($this->file, ' </Id>'.$CrLf);
|
||||
@ -2185,8 +2185,7 @@ class BonPrelevement extends CommonObject
|
||||
$dateTime_YMDHMS = dol_print_date($ladate, '%Y-%m-%dT%H:%M:%S');
|
||||
|
||||
// Get data of bank account
|
||||
//$id = $configuration->global->PRELEVEMENT_ID_BANKACCOUNT;
|
||||
$id = ($type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
$id = $configuration->global->PRELEVEMENT_ID_BANKACCOUNT;
|
||||
$account = new Account($this->db);
|
||||
if ($account->fetch($id) > 0)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user