Merge branch 'develop' into extrafields_object_filter

This commit is contained in:
Frédéric FRANCE 2024-11-13 23:55:16 +01:00 committed by GitHub
commit 6b45be1a0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
172 changed files with 21020 additions and 7234 deletions

View file

@ -26,3 +26,7 @@ trim_trailing_whitespace = false
indent_style = tab
trim_trailing_whitespace = true
indent_size = 4
[*.yml]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

View file

@ -0,0 +1,41 @@
name: "CI-PULL-REQUEST"
on: [pull_request]
jobs:
pre-commit:
uses: ./.github/workflows/pre-commit.yml
secrets: inherit
with:
gh_event: ${{ github.event_name }}
phan:
uses: ./.github/workflows/phan.yml
secrets: inherit
needs: [pre-commit]
with:
gh_event: ${{ github.event_name }}
phpstan:
uses: ./.github/workflows/phpstan.yml
secrets: inherit
needs: [pre-commit]
with:
gh_event: ${{ github.event_name }}
#windows-ci:
# needs: [pre-commit, phan, phpstan]
# secrets: inherit
# uses: ./.github/workflows/windows-ci.yml
# with:
# gh_event: ${{ github.event_name }}
gh-travis: # Runs travis script on github runner (not on travis)
if: false
# needs: [pre-commit, phan]
# needs: [windows-ci]
secrets: inherit
needs: [pre-commit, phan, phpstan]
uses: ./.github/workflows/gh-travis.yml
with:
gh_event: ${{ github.event_name }}
# Note (not tested, from https://github.com/orgs/community/discussions/38361)
# To cancel jobs if one fails, the following action may help
# - if: "failure()"
# uses: "andymckay/cancel-action@0.3"

View file

@ -1,6 +1,6 @@
name: "CI"
name: "CI-PUSH"
on: [push, pull_request]
on: [push]
jobs:
pre-commit:
uses: ./.github/workflows/pre-commit.yml
@ -20,7 +20,7 @@ jobs:
with:
gh_event: ${{ github.event_name }}
windows-ci:
needs: [pre-commit, phpstan, phan]
needs: [pre-commit, phan, phpstan]
secrets: inherit
uses: ./.github/workflows/windows-ci.yml
with:
@ -30,11 +30,11 @@ jobs:
# needs: [pre-commit, phan]
# needs: [windows-ci]
secrets: inherit
needs: [pre-commit, phan, phpstan]
uses: ./.github/workflows/gh-travis.yml
with:
gh_event: ${{ github.event_name }}
# Note (not tested, from https://github.com/orgs/community/discussions/38361)
# To cancel jobs if one fails, the following action may help
# - if: "failure()"

View file

@ -3,13 +3,13 @@
name: Travis
# Controls when the workflow will run
on:
# push:
# pull_request:
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:
concurrency:

View file

@ -1,15 +1,12 @@
---
on:
# pull_request:
# push:
# schedule:
# # execute once a day, the 1st
# - cron: 10 9 * * *
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:
concurrency:

View file

@ -3,18 +3,17 @@
name: PHPStan
# Controls when the workflow will run
on:
# push:
# pull_request:
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:
concurrency:
group: stan-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref
}}
group: stan-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
gh_event: ${{ inputs.gh_event || github.event_name }}
@ -37,14 +36,14 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Get PHP and addons
- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: phpstan:1.12, cs2pr
coverage: none # disable xdebug, pcov
tools: phpstan:2.0, cs2pr
extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap,
mysql, pgsql, sqlite3, ldap, xml, mcrypt
@ -86,3 +85,9 @@ jobs:
name: phpstan-srcrt
path: ${{ github.workspace }}/_stan.xml
retention-days: 2
# Run PHPStan generate baseline
# - name: Run PHPStan generate baseline
# id: phpstan-baseline
# if: ${{ success() }}
# run: |
# phpstan -vv analyse --memory-limit 7G -a build/phpstan/bootstrap_action.php --generate-baseline build/phpstan/phpstan-baseline.neon

74
.github/workflows/phpstan_baseline.yml vendored Normal file
View file

@ -0,0 +1,74 @@
name: 'PHPStan baseline'
on:
# Every Thursday we want to refresh the baseline
schedule:
- cron: '0 6 * * 4'
# We want to be able to manually refresh the baseline too
workflow_dispatch:
workflow_call:
inputs:
gh_event:
required: true
type: string
# Run PHPStan analyse on pull requests
pull_request:
env:
PHP_VERSION: '8.2'
gh_event: ${{ inputs.gh_event || github.event_name }}
CACHE_KEY_PART: ${{ ( inputs.gh_event == 'pull_request' || github.event_name == 'pull_request' ) && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }}
jobs:
phpstan:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none # disable xdebug, pcov
tools: phpstan:2.0, cs2pr
extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap,
mysql, pgsql, sqlite3, ldap, xml, mcrypt
env:
fail-fast: true
# Restore old cache
- name: Restore phpstan cache
id: cache
uses: actions/cache/restore@v4
with:
path: ./.github/tmp
key: phpstan-cache-${{ env.PHP_VERSION }}-${{ env.CACHE_KEY_PART }}-${{
github.run_id }}
restore-keys: |
phpstan-cache-${{ env.PHP_VERSION }}-${{ env.CACHE_KEY_PART }}-
phpstan-cache-${{ env.PHP_VERSION }}-${{ github.head_ref }}-
phpstan-cache-${{ env.PHP_VERSION }}-${{ github.base_ref }}-
phpstan-cache-${{ env.PHP_VERSION }}-
- uses: ruudk/phpstan-baseline-refresh-create-pr-action@main
with:
github_token: ${{ secrets.PAT_GITHUB_TOKEN }}
phpstan_path: phpstan
configuration_path: phpstan.neon.dist
phpstan_additional_arguments: --memory-limit 7G -a build/phpstan/bootstrap_action.php
baseline_path: build/phpstan/phpstan-baseline.neon
commit_name: Dolibot
commit_email: dolibarr-bot@users.noreply.github.com
commit_message: PHPStan > Update baseline
target_branch: develop
pr_create: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 1 || 0 }}
# pr_create: 1
pr_title: PHPStan > Update baseline
pr_reviewer: eldy
pr_body: |
This PR is automatically created to cleanup our baseline.
Since the last refresh of the baseline we have fixed {0} ignored errors.
Keep it up all! :muscle:
There are only {1} ignored errors left :sweat_smile:

View file

@ -1,13 +1,13 @@
---
name: pre-commit
on:
# pull_request:
# push:
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:
concurrency:

View file

@ -2,13 +2,13 @@
name: Win CI
# yamllint disable-line rule:truthy
on:
# push:
# pull_request:
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:
concurrency:
@ -57,7 +57,7 @@ jobs:
id: cache
uses: actions/cache/restore@v4
env:
HASH: ${{ hashFiles('htdocs/install/**') }}
HASH: ${{ hashFiles('htdocs/install/**', 'htdocs/filefunc.inc.php') }}
KEY_ROOT: ${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}
with:
# See https://github.com/actions/cache/issues/1275#issuecomment-1925217178
@ -72,7 +72,7 @@ jobs:
${{ env.KEY_ROOT }}-${{ env.HASH }}-${{ github.head_ref }}-
${{ env.KEY_ROOT }}-${{ env.HASH }}-${{ github.base_ref }}-
${{ env.KEY_ROOT }}-${{ env.HASH }}-
${{ env.KEY_ROOT }}-
# ${{ env.KEY_ROOT }}-
- name: Setup MariaDB
uses: frederic34/setup-mariadb@v1

View file

@ -43,7 +43,7 @@ repos:
- id: end-of-file-fixer
# Check that there are no completely merged file conflicts
- id: check-merge-conflict
stages: [commit, pre-rebase, pre-commit, pre-merge-commit]
stages: [pre-rebase, pre-commit, pre-merge-commit]
# Check that files with shebangs have the executable bit set (in git)
- id: check-executables-have-shebangs
# Check that shell files are executables
@ -252,7 +252,7 @@ repos:
rev: 3.1.0
hooks:
- id: sqlfluff-lint
stages: [commit, manual] # manual needed for ci
stages: [pre-commit, manual] # manual needed for ci
exclude: (?x)^
(dev/initdemo/mysqldump_.*\.sql
|htdocs/core/menus/init_menu_auguria\.sql

433
ChangeLog
View file

@ -6,12 +6,198 @@ English Dolibarr ChangeLog
For users:
----------
NEW: NEW Module - help to setup OpenID Connect (#30317)
NEW: Add hidden option CONTRACT_HIDE_MYCOMPANY_SIGNATURE_SECTION_PDF
NEW: Add a tab on recurring invoice card to see the list of invoices generated from this recurring invoice (customer and supplier invoices) (#31463)
NEW: #28871 signed_status to commande (#30359)
NEW: #30269 linked project in column of last record tables (#30344)
NEW: Accountancy - Add general account on thirdparty
NEW: Accountancy - Add partial reconcile on subledger (#30027)
NEW: Accountancy - Option to select the label of operation (#31200)
NEW: Accountancy - Allow grouping taxes with primary line price (#26732)
NEW: Activate PHPUnit with tests on permission on $action ==...
NEW: Add advice for max size on list for better performance
NEW: Add an advanced permission to validate knowledge (#30855)
NEW: Add a test mode into the setup of AI module to test the AI prompts.
NEW: Add a tool to decrypt data encrypted in database.
NEW: Add auto generate document when reception is created (#30688)
NEW: Add badge for generate invoice client tab (#31559)
NEW: Add caldav on fichinter (#30582)
NEW: Add column agenda_id to implement the link between files and event
NEW: Add column "comment" in list of payment
NEW: Add constant to hide version (#30865)
NEW: Add country in search of project
NEW: add duration extrafields (#31595)
NEW: Add export for thirdparty bank accounts (#30807)
NEW: Add export profile to export MO and lines of consumption/production
NEW: Add option to store the text content of uploaded files into database (with conversion with pdftotext)
NEW: Add Filter Assistance for Filling Filters Field (#31646)
NEW: add last stock movement and product nature to StocksWithBatch export (#30578)
NEW: Add member title to the labels (#31710)
NEW: Add mode Customer price + level price (#31091)
NEW: add option to add external billing contact on the supplier_proposal pdf (#30298)
NEW: Add option to clone its default BOM when cloning a product (#30088)
NEW: Add option to enable PDF frame rounded corners
NEW: Add option to round weight and volume on shipment PDF
NEW: add pdf regeneration to mass action for shipments (#29970)
NEW: Add picto on list of notification email templates
NEW: add recurring supplier invoice on supplier tab #30945 #30949
NEW: Add sort by ref warehouse/product or ref product/warehouse on inventory product list (#31639)
NEW: Add some improvement for ODT Contracts (#31715)
NEW: Add terms of sale on documents (#24846)
NEW: Add thirdparty state in substitution array (#31549)
NEW: Add tooltip on closing accounting setup
NEW: add trigger for linking and unlinking invoices (#30182)
NEW: Add Unit price on supplier order stat product (#31055)
NEW: add warehouseId parameters in select_produit to limit result to existing product in select (#30477)
NEW: allow link feature to task (#30235)
NEW: Authorize modification of a partially shipped order (#31423)
NEW: autogenerate project reference in API (#30638)
NEW: automatically change status on answering a ticket (#30556)
NEW: Browser notifications use now jnotify (fix browser compatibility)
NEW: can add extrafields with dol_move (#30574)
NEW: Can change the type of a social contribution if no payment
NEW: can delete a category translation (#31396)
NEW: Can link an object to another using the ref. Close #31001
NEW: Can set a class on the tr lines of form setup lines
NEW: Can set border radius of list and tables
NEW: Can set date of transmission in 1 click when validating SEPA
NEW: Can set parameters with setup type yesno.
NEW: Can set the contact type for the autoassigned user that creates a project (#30444)
NEW: Can show raw value of oauth token
NEW: Can use a specific profile to send email for password forgotten
NEW: option to care grandchild (#31314)
NEW: Look and feel - checkbox to choose thirdparty nature (#30192)
NEW: Color line total and sub total (#26172)
NEW: Constant to hide user login times (#29815)
NEW: Const ASSET_ROUND_INTEGER_NUMBER_UPWARDS for ASSET Module. Compatibility to migrate from other accounting solutions. (#31615)
NEW: Content of tab "attached files" is more compact.
NEW: Contract signed status update (#30779)
NEW: Create thirdparty notification by action code (#30541)
NEW: Customer price and level price together
NEW: default configuration for event reminder (#31407)
NEW: determine multi-currency price on object line create tpl (#28021)
NEW: Display for socialnetworks admin
NEW: display mark rates in objectLineCreate (#30872)
NEW: due date in accounting bookkeeping list and card (#30061)
NEW: enhance the OAUTH2 token manager. Can refresh a token from page.
NEW: EPC QR CODE - Use bank owner account name instead of company (#31735)
NEW: fichinter list disable details option (#30884)
NEW: filter on invoice dates in product margin tab (#29997) and thirdparty margin tab (#29998)
NEW: FIX: Display invoice widgets by amount instead of number (#30215)
NEW: Add the Clone of company (#29755)
NEW: function for Preview In CKeditor products
NEW: FY Changed Period handle in Module Asset (#31618)
NEW: hidden option MAIN_TE_PRIVATE_FIRST_AND_LASTNAME_TO_UPPER (#31143)
NEW: Hide completed items in Link to (#31329)
NEW: Iban is saved encrypted
NEW: if a user is associated with the expense report, then that user will get an associated credit line ($tabtp) generated.
NEW: Implementing Billable tasks on projects using new attribute "billable" (#30092)
NEW: Include a protection into check update of module to detect malware
NEW: intervention signed status update (#30629)
NEW: INTRA VAT ID field optionally mandatory and/or invoice mandatory in thirdparty module setup (#31663)
NEW: Invoice - Generate payment information - Structured communication (#31376)
NEW: Invoice line import - fk_product can be a ref (#30795)
NEW: Look and feel v21 - Can have rounded border on tables
NEW: Look and feel v21 - Toolbar for WYSIWYG editor is short on smartphone
NEW: Management of extrafields on customer prices, level prices and default prices (#31313)
NEW: manage several type of dangerous goods for a same parcel (#30238)
NEW: Member - Can upload a file with drag and drop (#30265)
NEW: Move the picto in the first tab label always visible
NEW: ODTSubsitution for date_start_real / Contracts
NEW: Look and feel - Opacity for finished lines (#30219)
NEW: option: assign default roles to "individual" third-party contacts (#30499)
NEW: option to allow freezing qty in BOM service's line (#29990)
NEW: Add a page to list the lines of orderse (#31521)
NEW: pagination in product margin tab
NEW: payment term and mode on creating supplier (#31166) and third-party (#31067)
NEW: PDF Add Customer accountancy code (#31544)
NEW: PDF Add discount total if line discount exists (#31483)
NEW: PDF Add option to print rounded corner frames (#31172)
NEW: PDF Add shipping address in sales orders (#31293)
NEW: PDF Add total discount if line discount exists
NEW: PDF frame rounded corners
NEW: Prelevement - Use structured payment data for Belgium (#31383)
NEW: Preview product list when we choose model email layout Commerce (#30185)
NEW: Can upload a file with drag and drop: Thirdparty (#30263) - Product/Service (#30250) - Project (#30276) - Propale (#30315)
NEW: Public and private note options in thirdparty list (#31062)
NEW: redirect to expedition card if global search has unique result (#30108)
NEW: replenishment if the warehouse is set to the default selected user (#31229)
NEW: retrieve Thirdparty by account (#31283)
NEW: Share msg "not found" for widgets and add a button to add new record when none exists (#31309)
NEW: shipment signed status update (#30928)
NEW: Show detail of each multicurrency amount in popup of price
NEW: show holidays at bottom of activity/permonth.php page (#31550)
NEW: Show tooltip on number of qualified records
NEW: Signature or proposal from the Web portal (#30062)
NEW: Star Field Type for Extra Fields (#31348) and for for Module Builder (#31216)
NEW: Support option PDF_ADD_POSITION on shipment espadon template
NEW: Auto-suspend facture rec when nb gen max is reached (#31623)
NEW: The margin section can now be shown/hidden
NEW: Deal change in fiscal year period adjustments to shortened or extended periods (e.g., fiscal years of 9 or 15 months)
NEW: (ticket, admin): More options entries (#30548)
NEW: Update warehouse product list to add another sorting option (#30971)
NEW: Can set blacklist of words into answer of AI (#30385)
NEW: user list country filter (#30770)
NEW: vat rate with department in dict (#31628) (#31627)
NEW: When we export data of unlaterable log, we add an unalterable line in logs
NEW Add option THEME_STICKY_TOPMENU = 'scrollleftmenu_after_mainpage' (or 'disabled')
NEW value for FICHINTER_DISABLE_DETAILS. If FICHINTER_DISABLE_DETAILS is set to '2' details are disabled only on intervention list.
PERF: Reduce nb of requests into num_public_holiday
PERF: Reduce size for VCF files and virtualcard qrcode
PERF: Reduce time to show the page of unalterable logs with high data
For developers:
---------------
NEW: translation with action triggers API (#30595)
NEW: more complete stock product API call (#30567)
NEW: Projet - Add hook formconfirm (#31408)
NEW: Can choose the zip handler to build ODT.
NEW: Can force ip into log file name using a define('SYSLOG_FILE_ADDIP')
NEW: Can force log file name using a define('SYSLOG_FILE_ADDSUFFIX')
NEW: Can define the text on tooltip on a yesno check.
NEW: Introduce value 'password' for mode of sanitization in GETPOST.
NEW: Add getImageFromHtmlContent() method
NEW: Add gitleaks into pre-commit
NEW: Add hook after the line is processed in the sell journal page (#31439)
NEW: add hook dolibarrDelConst (#30672)
NEW: Add hook getLoginPageExtraContent, getPasswordResetPageExtraContent
NEW: add hook in dolibarr_set_const admin.lib.php (#30605)
NEW: Add hook on sell journal page for overwrite the processed journal data after the SQL request (#31033)
NEW: force_install_noedit : add value 3 to block all technical parameters excepted main_url (#30080)
NEW: Add a new hook on order list (#31315)
NEW: Add ID of the line in the trigger context for addLine(), updateLine() and deleteLine() on contract (#30343)
NEW: Add more log information
NEW: Add pagination data to some api routes (#29895)
NEW: Add test to forbidden NOW() SQL function.
NEW: API call to re-generate a users password. (#30590)
NEW: API close proposal now supports both private and public note (#30659)
NEW: API_LOGINS_ALLOWED_FOR_GET_EXTRAFIELD (#30562)
NEW: API /setup endpoint for getting action triggers (#30538)
NEW: HOOK FORMCONFIRM IN TICKET (#31321)
NEW: hook on expensereport added (#31380)
QUAL line classes for various business object classes have been moved to individual files.
QUAL: #30122 (#30131)
QUAL: AccountancySystem: maintenance work to uniformize and clean up (#31391)
QUAL: All $conf->global->module->enabled are replaced with isModEnabled()
QUAL: bankline category table name (#30419)
QUAL: Clean code
QUAL: conformity PR for data structure of #29964 (#30014)
QUAL: Edition of currency is shared in a common tpl file
QUAL: Ergo btn and fix (#30947)
QUAL: Move function csvClean into functions2.lib.php
QUAL: Move the public css file into the public directory
QUAL: Removed inclusion of the file json.lib.php
QUAL: simplifying readability of sql
QUAL: Standardize name of user cookies
QUAL: Suffix table name to have them created on module install
QUAL: The property ->domiciliation and ->propio on bank accounts has been
QUAL: Update inc.php (#29822)
QUAL: Use archiveOrBackupFile for MAIN_MAIL_DEBUG_LOG_WITH_DATE
QUAL: Use table_element in sql queries (#31355)
QUAL: rename const WORKFLOW_EXPEDITION_CLASSIFY_NEWD_INVOICE to WORKFLOW_RECEPTION_CLASSIFY_NEWD_INVOICE
QUAL: This configuration change in phan will report NEW: array types in phpdoc
WARNING:
@ -31,8 +217,66 @@ The following changes may create regressions for some external modules, but were
* If you were using the substitution key __MEMBER_CIVILITY__, you must now use __MEMBER_TITLE__
***** ChangeLog for 20.0.1 compared to 20.0.0 *****
***** ChangeLog for 20.0.2 compared to 20.0.1 *****
FIX: fatal when updating recurring supplier invoice line with php8 ($remise_percent is '' instead of 0) (#31713)
FIX: supplier invoice template card: buyer and seller swapped in VAT-related function calls (probably a copy-paste from customer invoice templates) (#31446)
FIX: #25853 Thirdparty Massaction (#25868)
FIX: #28505 Blank page from third party to projects (#31637)
FIX: #30432 make thirdparty code_client and code_compta modifiable via API (#31668)
FIX: #31015
FIX: #31360 delete contact when using pgsql.
FIX: #31365 Bank - Card - Ref haven't max length in edit mode (#31533)
FIX: #31452 Predefined supplier invoice - Language key & link to supplier card (#31514)
FIX: #31538 Addition to EPC-QR values <200b><200b>to correct remittance information (#31557)
FIX: Accountancy - Loan - Error on transfer (#31546)
FIX: a dictionary CANNOT have zero value in entity field (#31625)
FIX: Avoid fatal error when mysqli not available
FIX: Bad balance of td into setup page of shipments
FIX: bad test on permission makes agenda event creation on object not
FIX: can validate shipment without stock movement (#31780)
FIX: Clear of option THEME_ELDY_USEBORDERONTABLE
FIX: column position on PDF of payments
FIX: const WORKFLOW_RECEPTION_CLASSIFY_NEWD_INVOICE (#31601)
FIX: convert amount into text when using numberwords
FIX: Corrected typo preventing data from being saved (#31716)
FIX: CSS
FIX: access to media files
FIX: default visibility
FIX: dol_openinpopup for virtual card
FIX: duplicate answers in list when using global search on proposals
FIX: Edit a link
FIX: email templates for expense report not visible
FIX: Error management on cheque deposit.
FIX: error message in xls import when stream zip is not available.
FIX: Extrafield following between rec invoice and classic invoice (#31445)
FIX: Filter on month of the balance of leaves.
FIX: Fix bug select columns and access to the public ticket list from the public ticket card (case when we have connected to another client before, the track id stocked in session overwrite the new track id from the public ticket card) (#31000)
FIX: for #31237 #31524
FIX: Get number of bank deposit wa not using the date.
FIX: If you have no stock of your product, an error is displayed when you delete the reception. (#31504)
FIX: issue on action set condition in particular when you set a deposi… (#31518)
FIX: open redirection
FIX: pagebreak when option PDF_ADD_POSITION is set
FIX: PHP-warning-multiprice-in-liste-product-if-level-is-not-defined-on-product (#31507)
FIX: Picto menu not visible
FIX: Salary - Payment card - Missing date (#31512)
FIX: Search on batch code
FIX: select variant by attribute. (#31759)
FIX: show preview pdf list expensereport (#31694)
FIX: Show twice the technical ID
FIX: space used by linked elements in PDF notes (#31459)
FIX: substitutions THIRDPARTY_XXX are not available for actioncomm reminders (#31385)
FIX: Support for PDF_ADD_POSITION was not complete
FIX: the autofix corrupted vat value must be triggered only if we are
FIX: the autofix must also fix the multicurrency value.
FIX: this constant break the dictionary admin without Multicompany (#31638)
FIX: uniformize and check delete contact action (#31384)
FIX: Vat code is lost when updating lines in POS
FIX: uniformize and check delete contact action (#31384)
FIX: Vat code is lost when updating lines in POS
FIX: When PDF_ADD_POSITION is on, the number was doing pagebreak before
***** ChangeLog for 20.0.1 compared to 20.0.0 *****
FIX: #30960 show and search extrafields (#31026)
FIX: #31076 Bad position of hooks
FIX: #31152
@ -377,6 +621,59 @@ The following changes may create regressions for some external modules, but were
* The signature of method fetch() of class CompanyBankAccount has been modified to match the signature of method Account->fetch()
***** ChangeLog for 19.0.4 compared to 19.0.3 *****
FIX: fatal when updating recurring supplier invoice line with php8 ($remise_percent is '' instead of 0) (#31713)
FIX: supplier invoice template card: buyer and seller swapped in VAT-related function calls (probably a copy-paste from customer invoice templates) (#31446)
FIX: #25853 Thirdparty Massaction (#25868)
FIX: #28505 Blank page from thirdparty to projects (#31637)
FIX: #30757
FIX: #30762
FIX: #30768 allocate the correct invoice_line_id to the element timespent (#30769)
FIX: #30772 Accountancy document export - The project filter on expenses report don't work (#30824)
FIX: #30836
FIX: #30960 show and search extrafields (#31026)
FIX: Add same security test when uploading files from API than from GUI (#31114)
FIX: ajaxik URL in ExpenseReport to load coef calculation (#30918)
FIX: attached file on first page load (#30694)
FIX: autoselect the fiscal period by default
FIX: avoid from re-initializing array result on nested hook getEntity (#30626)
FIX: avoid odt errors (#31126)
FIX: avoid pgsql error (#30678)
FIX: avoid the return "AND (())" (#30829)
FIX: Backport fix fatal error on price with some truncating setup
FIX: box_actions.php still uses fk_user_done which no longer exists (#31190)
FIX: can validate shipment without stock movement (#31780)
FIX: column position on PDF of payments
FIX: const WORKFLOW_RECEPTION_CLASSIFY_NEWD_INVOICE (#31601)
FIX: Debug extrafields for bank lines
FIX: email templates for expense report not visible
FIX: Error message overwrote when a error occurs during update of product multilangs (#30841)
FIX: error return missing in mo creation when qty to consume is <= 0 (#31134)
FIX: Extrafield following between rec invoice and classic invoice (#31445)
FIX: Fatal error on create loan schedule (#30656)
FIX: Fix bug select columns and access to the public ticket list from the public ticket card (case when we have connected to another client before, the track id stocked in session overwrite the new track id from the public ticket card) (#31000)
FIX: fixed search filter for projects resetting when set to empty (#30902)
FIX: if you call fetchLines several times, your $object->lines contains duplicates (#31167)
FIX: If you have no stock of your product, an error is displayed when you delete the reception. (#31504)
FIX: Invoice unpaid widget - SQL error on group by with constant MAIN_COMPANY_PERENTITY_SHARED (#30866)
FIX: issue on action set condition in particular when you set a deposi… (#31518)
FIX: late order search option (v18+) (#30692)
FIX: late propal search option (v18+) (#30687)
FIX: missing fk_parent_line parameter (#30806)
FIX: mysql error during dump for enable sandbox M999999 (#31116)
FIX: PHP-warning-multiprice-in-liste-product-if-level-is-not-defined-on-product (#31507)
FIX: Protection to avoid an extrafield to be mandatory if computed
FIX: purge files cron: php warnings when rest module enabled (#30919)
FIX: removed unreachable code (#31141)
FIX: show preview pdf list expensereport (#31694)
FIX: Substitution error in ticket emails in the subject (#30778)
FIX: substitutions THIRDPARTY_XXX are not available for actioncomm reminders (#31385)
FIX: use price() to display qty on a product's stats tab to avoid showing too many decimals when rounding errors are possible (#31165)
FIX: Vat code is lost when updating lines in POS
FIX: when qty is not an integer, apply price() (#31138)
FIX: Wrong default PDF model when creating the second situation invoice (#30843)
FIX: wrong subprice if price base type is TTC (#30887)
***** ChangeLog for 19.0.3 compared to 19.0.2 *****
FIX: #29403 HRM - Unable to delete a skill in a job Profile (#29779)
FIX: #29439 incomplete API return (#29796)
@ -936,6 +1233,138 @@ The following changes may create regressions for some external modules, but were
* The load of hook context productdao has been removed before calling loadvirtualstock. Modules must use the context of main parent page or 'all' for all cases.
***** ChangeLog for 18.0.6 compared to 18.0.5 *****
FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269)
FIX: 16.0 - the e-mail templates configured in the notification module are not used if the recipient is a fixed e-mail address (#29407)
FIX: 17.0: $num doesn't take trigger-modified newref into account, leading to inconsistencies if BILL_SUPPLIER_VALIDATE changes the invoice's ref (#28684)
FIX: 17.0: fatal when updating recurring supplier invoice line with php8 ($remise_percent is '' instead of 0) (#31713)
FIX: 17.0: supplier invoice template card: buyer and seller swapped in VAT-related function calls (probably a copy-paste from customer invoice templates) (#31446)
FIX: #24265 regression cannot see all product on takepos (#28753)
FIX: #25853 Thirdparty Massaction (#25868)
FIX: #28205
FIX: #28251 Fixing subpermission name on api_multicurrencies.class.php (#28252)
FIX: #28369
FIX: #28518 (#28520)
FIX: #28978 FIX: #28976
FIX: #29029 Impossible to delete an order line
FIX: #29114 Missing contact term in intervention
FIX: #29114 Translate contact term in intervention
FIX: #29439 incomplete API return (#29796)
FIX: #29496 filtering a record should not hide its child not filtered
FIX: #30010 Use conf TICKET_MESSAGE_MAIL_INTRO instead of translation key (#30081)
FIX: #30274 Add the include before executing dolibarr_set_const (#30320)
FIX: #30467
FIX: #30768 allocate the correct invoice_line_id to the element timespent (#30769)
FIX: Accountancy export with file or not
FIX: Accountancy - Generate entries of expense report with localtax (#30411)
FIX: Accountancy - Not trunc id_import
FIX: accounting FEC import (Issue #28306) (#29414)
FIX: Add new hidden conf "DISABLE_QTY_OVERWRITTEN" (#28523)
FIX: Add same security test when uploading files from API than from GUI (#31114)
FIX: Amount of localtaxes in foreign currency was wrong on screen and PDF
FIX: an error in a complex else condition
FIX: ASSET: annual depreciation starting year (Again ;-)) #26084 (#30040)
FIX: avoid error "Column 'entity' in where clause is ambiguous" (#28270)
FIX: avoid from re-initializing array result on nested hook getEntity (#30626)
FIX: avoid php warnings (#29247)
FIX: avoid to delete "lock" and "unlock" files
FIX: avoid Unknown column 'pfp.ref_fourn' (#28145)
FIX: background color for enabled modules (#29378)
FIX: Backport fix fatal error on price with some truncating setup
FIX: Backport page inventory.php from v18 to fix pagination bugs causing data loss (#29688)
FIX: back to page on error in contact card (#29627)
FIX: Bad calculation of $nbtotalofrecord (#30183)
FIX: box_actions.php still uses fk_user_done which no longer exists (#31190)
FIX: can validate shipment without stock movement (#31780)
FIX: Condition on newDateLimReglement
FIX: Conflict with autoload (#30399)
FIX: const WORKFLOW_RECEPTION_CLASSIFY_NEWD_INVOICE (#31601)
FIX: contact/address title is always "New Contact/Address" even if the contact/address already exists (#29581)
FIX: Display the date according to user language on substitutions (#29510)
FIX: Display the real_PMP on inventory when its value is equal to 0 (#22291)
FIX: Don't display column when it's out of date (#28271)
FIX: email templates for expense report not visible
FIX: Error mesg show untranslated extrafield name (#30227)
FIX: Error message overwrote when a error occurs during update of product multilangs (#30841)
FIX: Error When cloning fourn price no default value for tva_tx (#28368)
FIX: executeHooks $object default value (#29647)
FIX: expedition PDF models using units labels (#30358)
FIX: Extrafield following between rec invoice and classic invoice (#31445)
FIX: fatal error on loading pictures in attached documents of an event (#30553)
FIX: fatal error Unsupported operand types when recording load payment
FIX: Fix bug select columns and access to the public ticket list from the public ticket card (case when we have connected to another client before, the track id stocked in session overwrite the new track id from the public ticket card) (#31000)
FIX: Fix create shipping with product who have negative stocks on warehouse but the negative stock transfer is allowed (#26217)
FIX: Fix save directory for invoice ODT and multientities
FIX: group by qty in product margin tab (#29853)
FIX: Hierarchy Employee view do not filter on employee = 1 (#29496)
FIX: if you call fetchLines several times, your $object->lines contains duplicates (#31167)
FIX: If you have no stock of your product, an error is displayed when you delete the reception. (#31504)
FIX: incorrect page numbering in PDF #29458 (#29476)
FIX: inventoryDeletePermission id define twice
FIX: issue on action set condition in particular when you set a deposi… (#31518)
FIX: issue to get the right files exported in Quadratrus export.php (#30004)
FIX: lang output for sales representative on PDF (#30469)
FIX: late order search option (#30692) and propal (#30687)
FIX: lettering (auto) for invoice deposit with company discount (#29633)
FIX: made invalid code shape error more user friendly (#29498)
FIX: Merge of thirdparties must also move uploaded files
FIX: missing entity parameter for ajax_constantonoff
FIX: missing hide "new" button where "product" or "service" module are disable
FIX: mo cloning (#29686)
FIX: modification date from label in accounting bookkeeping list (#30038)
FIX: Move the trigger for delete order line before the SQL request
FIX: multiple problems with multicompany
FIX: mysql error during dump for enable sandbox M999999 (#31116)
FIX: notification: error 500 in fixed emails due to a bad copy/paste (#29580)
FIX: notification module: for supplier orders (any of the 3 triggers), user can choose an e-mail template in conf, but the conf is not used when sending the notification (#28216)
FIX: Not qualified lines for reception (#29473)
FIX: not redirect when error occurs on updating card (#29388)
FIX: Not trancate the multicurrency rate shown on cards (even if the global MAIN_MAX_DECIMALS_SHOWN is set to 0) (#28211)
FIX: on change ref for bank account attachment are lost (#30529)
FIX: Option MAIN_DOC_USE_TIMING can be a string with date format
FIX: orders to bill menu (#30179)
FIX: Payment on customer invoice - Remove accountid in url if empty for apply default value (#28156)
FIX: PDF Fatal error : Backport fix from #23972
FIX: PDF Translations Extrafields
FIX: permission on payment file of a tax
FIX: php8: Fatal when empty $tmpvat is an empty string (no silent conversion to '0' when used in arithmetic operations) (#29451)
FIX: PHP 8 warning on output of successful cronjob (#29922)
FIX: PHP exception on getSpecialCode (#29646)
FIX: php warning global conf (#29478)
FIX: pos: invoice date incorrectly set because of timezome mismatches (reverts #36e91da) (#30184)
FIX: public project form return an error if SOCIETE_EMAIL_UNIQUE (#29942)
FIX: purge files cron: php warnings when rest module enabled (#30919)
FIX: PUT /thirdparties/{id} and PUT /contacts/{id} should throw exception if update returns < 0 (#29596)
FIX: Regression #29340
FIX: Repair the replenishment list (#29336)
FIX: REPLENISH MANY FOURN WHEN ORDER ALREADY CREATE (#29710)
FIX: round capital societe (#29211)
FIX: search and add extrafields to tasks when conf disabled (#29542)
FIX: show preview pdf list expensereport (#31694)
FIX: sometimes a string type instead integer is return, why ?
FIX: Special code is now transmitted by args only in order supplier (#28546) (#28619)
FIX: SQL syntax error in DDLUpdateField
FIX: subscription must be editable when accounting isn't reconciled (#28469)
FIX: substitutions THIRDPARTY_XXX are not available for actioncomm reminders (#31385)
FIX: Supplier Order search on date valid (#30448)
FIX: supplier price duplicate entry on update supplier product ref (#29290)
FIX: syntax error
FIX: TakePOS | Add product / Delete line of existing invoice
FIX: Ticket new message notification sent twice
FIX: transfer in accountancy for expense reports.
FIX: Unsigned propal having signing date (#29825)
FIX: Update asset.class.php
FIX: update date_echeance of supplier invoices when we update invoice date in the past (#29886)
FIX: use $conf->browser->os instead
FIX: use price() to display qty on a product's stats tab to avoid showing too many decimals when rounding errors are possible (#31165)
FIX: User List - Function is show in wrong column when module HRM enabled (#30186)
fix: when invoice is created by WORKFLOW_ORDER_AUTOCREATE_INVOICE on ORDER_NEW, the invoice must have the default bank account of the thirdparty is it's empty on order (#29462)
FIX: when qty is not an integer, apply price() (#31138)
FIX: Wrong currency shown in TakePOS payment page
FIX: wrong shortcut key for macintosh
FIX: wrong sql request with product category filter
FIX: wrong stock permission number
***** ChangeLog for 18.0.5 compared to 18.0.4 *****
FIX: 17.0: deprecated field should only be a fallback
FIX: 17.0 - php8 warnings: test for $field existence before checking if it is null or empty
@ -1292,7 +1721,7 @@ NEW: No overwrite of optionals during put() contact
NEW: Notifications: add Customer Order delivered (ORDER_NEW) in module Notification
NEW: Notifications: for Sign or Refused Propal from Online Page
NEW: Now we can edit amount on VAT and salaries clone action
NEW: only get opened contact from liste_contact function, to not have access to closed contact as mail receiver
NEW: only get open contact from liste_contact function, to not have access to closed contact as mail receiver
NEW: Option: MAIN_SECURITY_MAXFILESIZE_DOWNLOADED #yogosha10660
NEW: Option to manage deposit slips for more payment modes (not only
NEW: Option to show column for field and line selection on the left

View file

@ -38,10 +38,11 @@ If you have low technical skills and you're looking to install Dolibarr ERP/CRM
- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp))
- [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian)
- DoliRpm for Red Hat, Fedora, OpenSuse, Mandriva or Mageia
- The Docker image (see next chapter)
Releases can be downloaded from [official website](https://www.dolibarr.org/).
### Using the generic step by step setup (recommended)
### Using the generic step by step setup (recommended for IT users)
You can use any web server supporting PHP (Apache, Nginx, ...) and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version:
@ -69,7 +70,7 @@ You can use any web server supporting PHP (Apache, Nginx, ...) and a supported d
`http://yourdolibarrvirtualhost/install/`
- Follow the installer instructions;;;
- Follow the installer instructions
### Using Docker images

File diff suppressed because it is too large Load diff

View file

@ -4,7 +4,7 @@
"description": "An app for connecting Dolibarr to the Zapier platform.",
"repository": "Dolibarr/dolibarr",
"homepage": "https://www.dolibarr.org/",
"author": "Frédéric France <frederic.france@netlogic.fr>",
"author": "Frédéric France <frederic.france@free.fr>",
"license": "BSD-3-Clause",
"main": "index.js",
"scripts": {

View file

@ -10,11 +10,11 @@
return [
// # Issue statistics:
// PhanUndeclaredProperty : 560+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 520+ occurrences
// PhanUndeclaredGlobalVariable : 350+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 310+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 500+ occurrences
// PhanUndeclaredGlobalVariable : 340+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 270+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 180+ occurrences
// PhanTypeMismatchProperty : 160+ occurrences
// PhanTypeMismatchProperty : 140+ occurrences
// PhanPluginUnknownPropertyType : 130+ occurrences
// PhanPluginUnknownArrayMethodParamType : 120+ occurrences
// PhanPossiblyUndeclaredVariable : 110+ occurrences
@ -22,9 +22,9 @@ return [
// PhanRedefineFunction : 45+ occurrences
// PhanTypeExpectedObjectPropAccess : 45+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 45+ occurrences
// PhanTypeMismatchDimFetch : 40+ occurrences
// PhanPluginEmptyStatementIf : 35+ occurrences
// PhanTypeInvalidDimOffset : 35+ occurrences
// PhanPluginEmptyStatementIf : 30+ occurrences
// PhanTypeMismatchDimFetch : 30+ occurrences
// PhanUndeclaredConstant : 15+ occurrences
// PhanEmptyForeach : 10+ occurrences
// PhanPluginUnknownObjectMethodCall : 10+ occurrences
@ -62,51 +62,34 @@ return [
'htdocs/api/class/api_login.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/api/class/api_setup.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/api/class/api_status.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/asset/admin/setup.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeInvalidDimOffset'],
'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'],
'htdocs/asset/depreciation.php' => ['PhanPluginEmptyStatementIf'],
'htdocs/asset/disposal.php' => ['PhanPluginEmptyStatementIf'],
'htdocs/asset/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/asset/model/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/asset/tpl/accountancy_codes_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/asset/tpl/depreciation_options_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/asset/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/asterisk/wrapper.php' => ['PhanRedefineFunction'],
'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/blockedlog/ajax/block-info.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
'htdocs/bom/bom_card.php' => ['PhanUndeclaredProperty'],
'htdocs/bom/bom_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/bom/class/api_boms.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/bom/tpl/objectline_edit.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/bom/tpl/objectline_view.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/bookcal/availabilities_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/bookcal/availabilities_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/bookcal/calendar_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/bookcal/calendar_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/bookcal/class/availabilities.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/bookcal/class/calendar.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/categories/class/categorie.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/categories/edit.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/categories/index.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/categories/info.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/categories/photos.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/categories/traduction.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/categories/viewcat.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'],
'htdocs/categories/viewcat.php' => ['PhanUndeclaredProperty'],
'htdocs/collab/index.php' => ['PhanParamTooMany', 'PhanUndeclaredProperty'],
'htdocs/comm/action/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/comm/action/card.php' => ['PhanPluginBothLiteralsBinaryOp'],
'htdocs/comm/action/class/api_agendaevents.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/class/cactioncomm.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/comm/action/document.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/comm/action/index.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/index.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/info.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/action/list.php' => ['PhanTypeMismatchProperty'],
'htdocs/comm/action/pertype.php' => ['PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchDimFetch'],
'htdocs/comm/action/peruser.php' => ['PhanTypeComparisonFromArray'],
'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/comm/mailing/cibles.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/comm/mailing/cibles.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/mailing/index.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/propal/card.php' => ['PhanTypeMismatchProperty'],
'htdocs/comm/propal/class/api_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
@ -116,21 +99,13 @@ return [
'htdocs/commande/class/commande.class.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/customer.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/commande/list.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/list_det.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/commande/list_det.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/commande/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/accounting-files.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'],
'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/bank/annuel.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/bank/bankentries_list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/bank/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/bank/class/account.class.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/bank/class/api_bankaccounts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/bank/graph.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/bank/line.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/bank/releve.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/bank/transfer.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/bank/treso.php' => ['PhanTypeMismatchProperty'],
'htdocs/compta/bank/various_payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/compta/bank/line.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/bank/various_payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/compta/bank/various_payment/document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/compta/bank/various_payment/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'],
@ -374,7 +349,6 @@ return [
'htdocs/don/payment/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/don/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/don/tpl/linkedobjectblock.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/ecm/class/ecmdirectory.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/ecm/dir_card.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/ecm/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'],
@ -404,7 +378,7 @@ return [
'htdocs/expensereport/tpl/expensereport_linktofile.tpl.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/expensereport/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/fichinter/card-rec.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/fichinter/class/api_interventions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'],
'htdocs/fichinter/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
@ -637,7 +611,6 @@ return [
'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'],
'htdocs/supplier_proposal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/takepos/admin/orderprinters.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/takepos/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/takepos/floors.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/takepos/freezone.php' => ['PhanTypeMismatchArgumentProbablyReal'],

View file

@ -67,7 +67,7 @@ $config['suppress_issue_types'] = [
'PhanCompatibleNegativeStringOffset', // return false positive
'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
// 'PhanPluginUnknownArrayPropertyType', // Helps find missing array keys or mismatches, remaining occurrences are likely unused properties
// 'PhanTypeArraySuspiciousNullable', // All fixed.
'PhanTypeArraySuspiciousNullable', // About 400 cases
// 'PhanTypeInvalidDimOffset', // Helps identify missing array indexes in types or reference to unset indexes
'PhanTypeObjectUnsetDeclaredProperty',
'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is

View file

@ -487,9 +487,9 @@ if (empty($reshook)) {
// Mass actions
$objectclass = 'Bookkeeping';
$objectlabel = 'Bookkeeping';
$permissiontoread = $user->hasRight('societe', 'lire');
$permissiontodelete = $user->hasRight('societe', 'supprimer');
$permissiontoadd = $user->hasRight('societe', 'creer');
$permissiontoread = ($user->hasRight('societe', 'lire') == 1);
$permissiontodelete = ($user->hasRight('societe', 'supprimer') == 1);
$permissiontoadd = ($user->hasRight('societe', 'creer') == 1);
$uploaddir = $conf->societe->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}

View file

@ -185,6 +185,7 @@ if ($result) {
// Variables
$account_salary = getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT', 'NotDefined');
$account_vat = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT', 'NotDefined');
$noTaxDispatchingKeepWithLines = getDolGlobalInt('ACCOUNTING_EXPENSEREPORT_DO_NOT_DISPATCH_TAXES'); //If enabled, Tax will NOT get split off from the base entry and credited to a separate tax account (good for non-VAT countries like USA)
$i = 0;
while ($i < $num) {
@ -231,10 +232,14 @@ if ($result) {
}
$tabttc[$obj->rowid][$compta_user] += $obj->total_ttc;
$tabht[$obj->rowid][$compta_fees] += $obj->total_ht;
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva;
$tablocaltax1[$obj->rowid][$compta_localtax1] += $obj->total_localtax1;
$tablocaltax2[$obj->rowid][$compta_localtax2] += $obj->total_localtax2;
if ($noTaxDispatchingKeepWithLines) { //case where all taxes paid should be grouped with the same account as the main expense (best for USA)
$tabht[$obj->rowid][$compta_fees] += $obj->total_ttc;
} else { //case where every tax paid should be broken out into its own account for future recovery (best for VAT countries)
$tabht[$obj->rowid][$compta_fees] += $obj->total_ht;
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva;
$tablocaltax1[$obj->rowid][$compta_localtax1] += $obj->total_localtax1;
$tablocaltax2[$obj->rowid][$compta_localtax2] += $obj->total_localtax2;
}
$tabuser[$obj->rowid] = array(
'id' => $obj->uid,
'name' => dolGetFirstLastname($obj->firstname, $obj->lastname),

View file

@ -225,6 +225,7 @@ $cptfour = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER', 'NotDefined');
$cpttva = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT', 'NotDefined');
$rcctva = getDolGlobalString('ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT', 'NotDefined');
$rcdtva = getDolGlobalString('ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT', 'NotDefined');
$noTaxDispatchingKeepWithLines = getDolGlobalInt('ACCOUNTING_PURCHASES_DO_NOT_DISPATCH_TAXES'); //If enabled, Tax will NOT get split off from the base entry and credited to a separate tax account (good for non-VAT countries like USA)
$country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC']
$result = $db->query($sql);
@ -343,14 +344,19 @@ if ($result) {
}
$tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc;
$tabht[$obj->rowid][$compta_prod] += $obj->total_ht;
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva;
$tva_npr = ((($obj->info_bits & 1) == 1) ? 1 : 0);
if ($tva_npr) { // If NPR, we add an entry for counterpartWe into tabother
$tabother[$obj->rowid][$compta_counterpart_tva_npr] += $obj->total_tva;
if ($noTaxDispatchingKeepWithLines) { //case where all taxes paid should be grouped with the same account as the main expense (best for USA)
$tabht[$obj->rowid][$compta_prod] += $obj->total_ttc;
} else { //case where every tax paid should be broken out into its own account for future recovery (best for VAT countries)
$tabht[$obj->rowid][$compta_prod] += $obj->total_ht;
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva;
$tva_npr = ((($obj->info_bits & 1) == 1) ? 1 : 0);
if ($tva_npr) { // If NPR, we add an entry for counterpartWe into tabother
$tabother[$obj->rowid][$compta_counterpart_tva_npr] += $obj->total_tva;
}
$tablocaltax1[$obj->rowid][$compta_localtax1] += $obj->total_localtax1;
$tablocaltax2[$obj->rowid][$compta_localtax2] += $obj->total_localtax2;
}
$tablocaltax1[$obj->rowid][$compta_localtax1] += $obj->total_localtax1;
$tablocaltax2[$obj->rowid][$compta_localtax2] += $obj->total_localtax2;
$tabcompany[$obj->rowid] = array(
'id' => $obj->socid,
'name' => $obj->name,

View file

@ -1836,13 +1836,17 @@ class Adherent extends CommonObject
}
}
$invoice->socid = $this->fk_soc;
// set customer's bank account on the invoice
// set customer's payment bank account on the invoice
if (!empty($customer->fk_account)) {
$invoice->fk_account = $customer->fk_account;
} elseif (getDolGlobalString('FACTURE_RIB_NUMBER')) {
// set default bank account from invoice module settings
$invoice->fk_account = (int) getDolGlobalString('FACTURE_RIB_NUMBER');
}
//set customer's payment method on the invoice
if (!empty($customer->mode_reglement_id)) {
$invoice->mode_reglement_id = $customer->mode_reglement_id;
}
//$invoice->date = $datesubscription;
$invoice->date = dol_now();
@ -3024,9 +3028,10 @@ class Adherent extends CommonObject
* CAN BE A CRON TASK
*
* @param string $daysbeforeendlist Nb of days before end of subscription (negative number = after subscription). Can be a list of delay, separated by a semicolon, for example '10;5;0;-5'
* @param int $fk_adherent_type Type of Member (In order to restrict the sending of emails only to this type of member)
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
*/
public function sendReminderForExpiredSubscription($daysbeforeendlist = '10')
public function sendReminderForExpiredSubscription($daysbeforeendlist = '10', $fk_adherent_type = 0)
{
global $conf, $langs, $mysoc, $user;
@ -3071,6 +3076,9 @@ class Adherent extends CommonObject
$sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity('adherent').")" here, we want the batch to be on its entity only;
$sql .= " AND statut = 1";
$sql .= " AND datefin = '".$this->db->idate($datetosearchfor)."'";
if ((int) $fk_adherent_type > 0) {
$sql .= " AND fk_adherent_type = ".((int) $fk_adherent_type);
}
//$sql .= " LIMIT 10000";
$resql = $this->db->query($sql);

View file

@ -235,9 +235,10 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
$permissiontoread = 0;
$permissiontodelete = 0;
$permissiontoadd = 0;
$permissiontoread = ($user->hasRight('adherent', 'lire') == 1);
$permissiontodelete = ($user->hasRight('adherent', 'supprimer') == 1);
$permissiontoadd = ($user->hasRight('adherent', 'creer') == 1);
$uploaddir = $conf->adherent->dir_output;
$error = 0;
$parameters = array('socid' => isset($socid) ? $socid : null, 'arrayfields' => &$arrayfields);
@ -387,10 +388,6 @@ if (empty($reshook)) {
// Mass actions
$objectclass = 'Adherent';
$objectlabel = 'Members';
$permissiontoread = $user->hasRight('adherent', 'lire');
$permissiontodelete = $user->hasRight('adherent', 'supprimer');
$permissiontoadd = $user->hasRight('adherent', 'creer');
$uploaddir = $conf->adherent->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}

View file

@ -6,7 +6,7 @@
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2021-2024 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Nick Fragoulis
*
* This program is free software; you can redistribute it and/or modify
@ -128,6 +128,20 @@ if ($action == 'update') {
dolibarr_set_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", GETPOSTINT("INVOICE_SHOW_SHIPPING_ADDRESS"), 'chaine', 0, '', $conf->entity);
dolibarr_del_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", $conf->entity);
}
if (GETPOSTISSET('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
dolibarr_set_const($db, "PDF_INVOICE_SHOW_VAT_ANALYSIS", GETPOSTINT("PDF_INVOICE_SHOW_VAT_ANALYSIS"), 'chaine', 0, '', $conf->entity);
dolibarr_del_const($db, "PDF_INVOICE_SHOW_VAT_ANALYSIS", $conf->entity);
}
if (GETPOSTISSET('BARCODE_ON_SHIPPING_PDF')) {
dolibarr_set_const($db, "BARCODE_ON_SHIPPING_PDF", GETPOSTINT("BARCODE_ON_SHIPPING_PDF"), 'chaine', 0, '', $conf->entity);
}
if (GETPOSTISSET('BARCODE_ON_RECEPTION_PDF')) {
dolibarr_set_const($db, "BARCODE_ON_RECEPTION_PDF", GETPOSTINT("BARCODE_ON_RECEPTION_PDF"), 'chaine', 0, '', $conf->entity);
}
if (GETPOSTISSET('BARCODE_ON_STOCKTRANSFER_PDF')) {
dolibarr_set_const($db, "BARCODE_ON_STOCKTRANSFER_PDF", GETPOSTINT("BARCODE_ON_STOCKTRANSFER_PDF"), 'chaine', 0, '', $conf->entity);
}
// Terms of sale
if ($_FILES['termsofsale']["name"]) {
if (!preg_match('/(\.pdf)$/i', $_FILES['termsofsale']["name"])) { // Document can be used on a lot of different places. Only pdf can be supported.
@ -143,16 +157,6 @@ if ($action == 'update') {
}
}
if (GETPOSTISSET('BARCODE_ON_SHIPPING_PDF')) {
dolibarr_set_const($db, "BARCODE_ON_SHIPPING_PDF", GETPOSTINT("BARCODE_ON_SHIPPING_PDF"), 'chaine', 0, '', $conf->entity);
}
if (GETPOSTISSET('BARCODE_ON_RECEPTION_PDF')) {
dolibarr_set_const($db, "BARCODE_ON_RECEPTION_PDF", GETPOSTINT("BARCODE_ON_RECEPTION_PDF"), 'chaine', 0, '', $conf->entity);
}
if (GETPOSTISSET('BARCODE_ON_STOCKTRANSFER_PDF')) {
dolibarr_set_const($db, "BARCODE_ON_STOCKTRANSFER_PDF", GETPOSTINT("BARCODE_ON_STOCKTRANSFER_PDF"), 'chaine', 0, '', $conf->entity);
}
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
@ -437,6 +441,19 @@ if (isModEnabled('invoice')) {
}
print '</td></tr>';
/* too late to have it enabled by default in v21
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("PDF_INVOICE_SHOW_VAT_ANALYSIS"), '');
print '</td><td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('PDF_INVOICE_SHOW_VAT_ANALYSIS');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("PDF_INVOICE_SHOW_VAT_ANALYSIS", $arrval, $conf->global->PDF_INVOICE_SHOW_VAT_ANALYSIS);
}
print '</td></tr>';
*/
/* Keep this option hidden for the moment to avoid options inflation. We'll see later if it is used enough...
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT"), $langs->trans("SUPPLIER_PROPOSAL_ADD_BILLING_CONTACTMore"));

View file

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -114,8 +114,10 @@ if ($action == 'activate_encrypt') {
}
} elseif ($action == 'disable_encrypt') {
// By default, $allow_disable_encryption is false we do not allow to disable encryption because passwords can't be decoded once encrypted.
// We set entity=0 (all) because DATABASE_PWD_ENCRYPTED is a setup into conf file, so always shared for everybody
if ($allow_disable_encryption) {
dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", $conf->entity);
dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", 0);
}
}
@ -125,7 +127,7 @@ if ($action == 'activate_encryptdbpassconf') {
sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait.
// database value not required
//dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1");
// dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1");
header("Location: security.php");
exit;
} else {
@ -137,11 +139,11 @@ if ($action == 'activate_encryptdbpassconf') {
sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait.
// database value not required
//dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED",$conf->entity);
// dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED",$conf->entity);
header("Location: security.php");
exit;
} else {
//setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings');
// setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings');
setEventMessages($langs->trans('InstrucToClearPass', $langs->transnoentitiesnoconv("DatabasePassword")), null, 'warnings');
}
}

View file

@ -542,7 +542,7 @@ if ($action == 'edit') {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
$formaccounting = new FormAccounting($db);
print $formaccounting->select_account($selected, $constname, 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
print $formaccounting->select_account($selected, $constname, 1, array(), 1, 1, 'minwidth150 maxwidth300', 1);
} else {
print '<input name="' . $constname . '" class="maxwidth200" value="' . dol_escape_htmltag($selected) . '">';
}

View file

@ -197,7 +197,7 @@ if ($action == 'create') {
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
}
if (GETPOSTISSET('supplier_invoice_id')) {
$object->fields['supplier_invoice_id'] = array('type' => 'integer:FactureFournisseur:fourn/class/fournisseur.facture.class.php:1:entity IN (__SHARED_ENTITIES__)', 'label' => 'SupplierInvoice', 'enabled' => '1', 'noteditable' => '1', 'position' => 280, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => '1',);
$object->fields['supplier_invoice_id'] = array('type' => 'integer:FactureFournisseur:fourn/class/fournisseur.facture.class.php:1:entity IN (__SHARED_ENTITIES__)', 'label' => 'SupplierInvoice', 'enabled' => '1', 'noteditable' => 1, 'position' => 280, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => '1',);
print '<input type="hidden" name="supplier_invoice_id" value="' . GETPOSTINT('supplier_invoice_id') . '">';
}

View file

@ -434,12 +434,12 @@ class Asset extends CommonObject
if ($res < 0) {
return -1;
} elseif ($res > 0) {
$this->fields['date_acquisition']['noteditable'] = '1';
$this->fields['date_start']['noteditable'] = '1';
$this->fields['acquisition_value_ht']['noteditable'] = '1';
$this->fields['recovered_vat']['noteditable'] = '1';
$this->fields['reversal_date']['noteditable'] = '1';
$this->fields['reversal_amount_ht']['noteditable'] = '1';
$this->fields['date_acquisition']['noteditable'] = 1;
$this->fields['date_start']['noteditable'] = 1;
$this->fields['acquisition_value_ht']['noteditable'] = 1;
$this->fields['recovered_vat']['noteditable'] = 1;
$this->fields['reversal_date']['noteditable'] = 1;
$this->fields['reversal_amount_ht']['noteditable'] = 1;
}
}

View file

@ -204,7 +204,7 @@ class AssetDepreciationOptions extends CommonObject
$this->{$field_key} = $this->deprecation_options[$mode][$field_key] ?? null;
}
$this->fields['rowid'] = array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id");
$this->fields['rowid'] = array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id");
if (empty($class_type)) {
$this->fields['fk_asset'] = array('type' => 'integer:Asset:asset/class/asset.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label' => 'Asset', 'enabled' => 1, 'position' => 0, 'notnull' => 0, 'visible' => 0, 'index' => 1, 'validate' => 1,);
} else {

View file

@ -96,8 +96,11 @@ $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
/*
if (empty($reshook)) {
}
*/
/*

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -86,8 +87,10 @@ $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
/*
if (empty($reshook)) {
}
*/
/*

View file

@ -3,6 +3,7 @@
* Copyright (C) 2018-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -116,11 +117,11 @@ foreach ($object->fields as $key => $val) {
if (!empty($val['visible'])) {
$visible = (int) dol_eval((string) $val['visible'], 1);
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
'label' => $val['label'],
'checked' => (($visible < 0) ? 0 : 1),
'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
'position' => $val['position'],
'help' => isset($val['help']) ? $val['help'] : ''
);
}
}
@ -143,7 +144,8 @@ if (!isModEnabled('asset')) {
if ($user->socid > 0) {
accessforbidden();
}
$socid = 0; if ($user->socid > 0) {
$socid = 0;
if ($user->socid > 0) {
$socid = $user->socid;
}
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
@ -498,7 +500,7 @@ foreach ($object->fields as $key => $val) {
} elseif ($key == 'lang') {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($db);
print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
} else {
print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
}
@ -509,7 +511,7 @@ foreach ($object->fields as $key => $val) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields);
$parameters = array('arrayfields' => $arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
@ -541,7 +543,7 @@ foreach ($object->fields as $key => $val) {
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
@ -625,7 +627,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
@ -664,7 +666,7 @@ if ($num == 0) {
$db->free($resql);
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

View file

@ -495,7 +495,7 @@ foreach ($object->fields as $key => $val) {
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1);
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
print '<div class="nowrap">';
print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
$form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
@ -503,7 +503,7 @@ foreach ($object->fields as $key => $val) {
} elseif ($key == 'lang') {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($db);
print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
} else {
print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
}

View file

@ -157,7 +157,7 @@ if (empty($reshook)) {
// Get encoder (barcode_type_coder) from barcode type id (barcode_type)
$stdobject = new GenericObject($db);
$stdobject->barcode_type = $fk_barcode_type;
$result = $stdobject->fetch_barcode();
$result = $stdobject->fetchBarCode();
if ($result <= 0) {
$error++;
setEventMessages('Failed to get bar code type information '.$stdobject->error, $stdobject->errors, 'errors');
@ -171,8 +171,8 @@ if (empty($reshook)) {
if (!$error && $stdobject !== null) {
$code = $forbarcode;
$generator = $stdobject->barcode_type_coder; // coder (loaded by fetch_barcode). Engine.
$encoding = strtoupper($stdobject->barcode_type_code); // code (loaded by fetch_barcode). Example 'ean', 'isbn', ...
$generator = $stdobject->barcode_type_coder; // coder (loaded by fetchBarCode). Engine.
$encoding = strtoupper($stdobject->barcode_type_code); // code (loaded by fetchBarCode). Example 'ean', 'isbn', ...
$diroutput = $conf->barcode->dir_temp;
dol_mkdir($diroutput);
@ -441,7 +441,7 @@ if ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')) {
print '<input id="fillfromproduct" type="radio" '.((GETPOST("selectorforbarcode") == 'fillfromproduct') ? 'checked ' : '').'name="selectorforbarcode" value="fillfromproduct" class="radiobarcodeselect"><label for="fillfromproduct"> '.$langs->trans("FillBarCodeTypeAndValueFromProduct").'</label>';
print '<br>';
print '<div class="showforproductselector">';
$form->select_produits(GETPOSTINT('productid'), 'productid', '', '', 0, -1, 2, '', 0, array(), 0, '1', 0, 'minwidth400imp', 1);
$form->select_produits(GETPOSTINT('productid'), 'productid', '', 0, 0, -1, 2, '', 0, array(), 0, '1', 0, 'minwidth400imp', 1);
print ' &nbsp; <input type="submit" class="button small" id="submitproduct" name="submitproduct" value="'.(dol_escape_htmltag($langs->trans("GetBarCode"))).'">';
print '</div>';
}

View file

@ -117,13 +117,16 @@ $block_static->loadTrackedEvents();
$result = restrictedArea($user, 'blockedlog', 0, '');
// Execution Time
$max_execution_time_for_importexport = (!getDolGlobalString('EXPORT_MAX_EXECUTION_TIME') ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined
$max_execution_time_for_importexport = getDolGlobalInt('EXPORT_MAX_EXECUTION_TIME', 300); // 5mn if not defined
$max_time = @ini_get("max_execution_time");
if ($max_time && $max_time < $max_execution_time_for_importexport) {
dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically.");
@ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300
}
$MAXLINES = getDolGlobalInt('BLOCKEDLOG_MAX_LINES', 10000);
$MAXFORSHOWNLINKS = getDolGlobalInt('BLOCKEDLOG_MAX_FOR_SHOWN_LINKS', 100);
/*
* Actions
@ -350,8 +353,6 @@ $help_url = "EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Ina
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-blockedlog page-admin_blockedlog_list');
$MAXLINES = 10000;
$blocks = $block_static->getLog('all', $search_id, $MAXLINES, $sortfield, $sortorder, $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code);
if (!is_array($blocks)) {
if ($blocks == -2) {
@ -587,7 +588,6 @@ if (getDolGlobalString('BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR')) {
if (is_array($blocks)) {
$nbshown = 0;
$MAXFORSHOWLINK = 100;
$object_link = '';
$object_link_title = '';
@ -596,7 +596,7 @@ if (is_array($blocks)) {
if (empty($search_showonlyerrors) || !$checkresult[$block->id]) {
$nbshown++;
if ($nbshown < $MAXFORSHOWLINK) { // For performance and memory purpose, we get/show the link of objects only for the 100 first output
if ($nbshown < $MAXFORSHOWNLINKS) { // For performance and memory purpose, we get/show the link of objects only for the 100 first output
$object_link = $block->getObjectLink();
$object_link_title = '';
} else {
@ -647,8 +647,9 @@ if (is_array($blocks)) {
// Fingerprint
print '<td class="nowraponall">';
// Note: the previous line id is not necessarily id-1, so in texttoshow we say "on previous line" without giving id to avoid a search/fetch to get previous id.
$texttoshow = $langs->trans("Fingerprint").' - '.$langs->trans("SavedOnLine").' =<br>'.$block->signature;
$texttoshow .= '<br><br>'.$langs->trans("Fingerprint").' - Recalculated sha256('.$langs->trans("PreviousHash").' on line '.($block->id - 1).' + data) =<br>'.$checkdetail[$block->id]['calculatedsignature'];
$texttoshow .= '<br><br>'.$langs->trans("Fingerprint").' - Recalculated sha256('.$langs->trans("PreviousHash").' on previous line + data) =<br>'.$checkdetail[$block->id]['calculatedsignature'];
$texttoshow .= '<br><span class="opacitymedium">'.$langs->trans("PreviousHash").'='.$checkdetail[$block->id]['previoushash'].'</span>';
//$texttoshow .= '<br>keyforsignature='.$checkdetail[$block->id]['keyforsignature'];
print $form->textwithpicto(dol_trunc($block->signature, 8), $texttoshow, 1, 'help', '', 0, 2, 'fingerprint'.$block->id);

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -85,7 +86,7 @@ $db->close();
/**
* formatObject
*
* @param Object $objtoshow Object to show
* @param Object|array<string,mixed> $objtoshow Object to show
* @param string $prefix Prefix of key
* @return string String formatted
*/

View file

@ -1088,23 +1088,47 @@ class BlockedLog
$previoussignature = '';
$sql = "SELECT rowid, signature FROM ".MAIN_DB_PREFIX."blockedlog";
$sql .= " WHERE entity = ".((int) $conf->entity);
// Fast search of previous record by searching with beforeid - 1. This is very fast and will work 99% of time.
if ($beforeid) {
$sql .= " AND rowid < ".(int) $beforeid;
}
$sql .= " ORDER BY rowid DESC LIMIT 1";
$sql .= ($withlock ? " FOR UPDATE " : "");
$sql = "SELECT rowid, signature FROM ".MAIN_DB_PREFIX."blockedlog";
$sql .= " WHERE entity = ".((int) $conf->entity);
$sql .= " AND rowid = ".((int) $beforeid - 1);
$sql .= ($withlock ? " FOR UPDATE " : "");
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
if ($obj) {
$previoussignature = $obj->signature;
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
if ($obj) {
$previoussignature = $obj->signature;
}
} else {
dol_print_error($this->db);
exit;
}
}
if (empty($previoussignature)) {
$sql = "SELECT rowid, signature FROM ".MAIN_DB_PREFIX."blockedlog";
if ($beforeid) {
$sql.= $this->db->hintindex('entity_rowid', 1);
}
$sql .= " WHERE entity = ".((int) $conf->entity);
if ($beforeid) {
$sql .= " AND rowid < ".(int) $beforeid;
}
$sql .= " ORDER BY rowid DESC LIMIT 1";
$sql .= ($withlock ? " FOR UPDATE " : "");
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
if ($obj) {
$previoussignature = $obj->signature;
}
} else {
dol_print_error($this->db);
exit;
}
} else {
dol_print_error($this->db);
exit;
}
if (empty($previoussignature)) {

View file

@ -596,7 +596,7 @@ foreach ($object->fields as $key => $val) {
} elseif ($key == 'lang') {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($db);
print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
} else {
print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
}

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -105,7 +106,7 @@ foreach ($object->fields as $key => $val) {
}
// List of fields to search into when doing a "search in all"
// $fieldstosearchall = array();
$fieldstosearchall = array();
// foreach ($object->fields as $key => $val) {
// if (!empty($val['searchall'])) {
// $fieldstosearchall['t.'.$key] = $val['label'];
@ -120,10 +121,6 @@ foreach ($object->fields as $key => $val) {
// }
// $fieldstosearchall is supposedly defined further below, ensure that it is.
if (!isset($fieldstosearchall) || !is_array($fieldstosearchall)) {
$fieldstosearchall = array();
}
'
@phan-var-force array<string,string> $fieldstosearchall
';
@ -566,7 +563,7 @@ foreach ($object->fields as $key => $val) {
} elseif ($key == 'lang') {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($db);
print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
} else {
print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
}

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023 Alice Adminson <aadminson@example.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -105,7 +106,7 @@ foreach ($object->fields as $key => $val) {
}
// List of fields to search into when doing a "search in all"
// $fieldstosearchall = array();
$fieldstosearchall = array();
// foreach ($object->fields as $key => $val) {
// if (!empty($val['searchall'])) {
// $fieldstosearchall['t.'.$key] = $val['label'];
@ -119,10 +120,6 @@ foreach ($object->fields as $key => $val) {
// $fieldstosearchall = array_merge($fieldstosearchall, empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall']);
// }
// $fieldstosearchall is supposedly defined further below, ensure that it is.
if (!isset($fieldstosearchall) || !is_array($fieldstosearchall)) {
$fieldstosearchall = array();
}
'
@phan-var-force array<string,string> $fieldstosearchall
';
@ -549,7 +546,7 @@ foreach ($object->fields as $key => $val) {
} elseif ($key == 'lang') {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($db);
print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
} else {
print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
}

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2005-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.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
@ -415,12 +415,12 @@ while ($i < $imaxinloop) {
$candelete = $permissiontodelete;
// Title
print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
print '<td class="tdoverflowmax250" alt="'.dol_escape_htmltag($title).'">';
print dol_escape_htmltag($title);
print "</td>\n";
// Url
print '<td class="tdoverflowmax200">';
print '<td class="tdoverflowmax250">';
if (empty($linkintern)) {
print img_picto('', 'url', 'class="pictofixedwidth"');
print '<a class="" href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
@ -433,7 +433,7 @@ while ($i < $imaxinloop) {
print "</td>\n";
// Target
print '<td class="tdoverflowmax100 center">';
print '<td class="tdoverflowmax125 center">';
if ($obj->target == 0) {
print $langs->trans("BookmarkTargetReplaceWindowShort");
}
@ -443,7 +443,7 @@ while ($i < $imaxinloop) {
print "</td>\n";
// Author
print '<td class="tdoverflowmax100 center">';
print '<td class="tdoverflowmax125 center">';
if ($obj->fk_user > 0) {
if (empty($conf->cache['users'][$obj->fk_user])) {
$tmpuser = new User($db);

View file

@ -549,7 +549,7 @@ if ($type == Categorie::TYPE_PRODUCT) {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>';
print $langs->trans("AddProductServiceIntoCategory").' &nbsp;';
$form->select_produits('', 'elemid', '', 0, 0, -1, 2, '', 1, array(), 0, 1, 0, '', 0, '', null);
$form->select_produits(0, 'elemid', '', 0, 0, -1, 2, '', 1, array(), 0, 1, 0, '', 0, '', null);
print '<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans("ClassifyInCategory").'"></td>';
print '</tr>';
print '</table>';

View file

@ -340,7 +340,7 @@ if (empty($reshook) && $action == 'add' && $usercancreate) {
$datef = dol_mktime(GETPOSTINT("p2hour"), GETPOSTINT("p2min"), GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel');
}
//set end date to now if percentage is set to 100 and end date not set
$datef = (!$datef && $percentage == 100)?dol_now():$datef;
$datef = (!$datef && $percentage == 100) ? dol_now() : $datef;
// Check parameters
if (!$datef && $percentage == 100) {
@ -1463,13 +1463,16 @@ if ($action == 'create') {
if (!empty($_SESSION['assignedtouser'])) {
$listofuserid = json_decode($_SESSION['assignedtouser'], true);
}
if (!is_array($listofuserid)) {
$listofuserid = array();
}
$firstelem = reset($listofuserid);
if (isset($listofuserid[$firstelem['id']])) {
$listofuserid[$firstelem['id']]['transparency'] = (GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 0); // 0 by default when refreshing
}
}
print '<div class="assignedtouser">';
print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0', 1, $listofuserid, $listofcontactid, $listofotherid);
print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, array(), 0, '', array(), 0, 0, 0, 'AND u.statut != 0', 1, $listofuserid, $listofcontactid, $listofotherid);
print '</div>';
print '</td></tr>';
@ -1482,7 +1485,7 @@ if ($action == 'create') {
// Categories
print '<tr><td>'.$langs->trans("Categories").'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 3);
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'minwidth300 quatrevingtpercent widthcentpercentminusx', 0, 0);
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), 0, 0, 'minwidth300 quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
}
@ -1501,13 +1504,16 @@ if ($action == 'create') {
if (!empty($_SESSION['assignedtoresource'])) {
$listofresourceid = json_decode($_SESSION['assignedtoresource'], true);
}
if (!is_array($listofresourceid)) {
$listofresourceid = array();
}
$firstelem = reset($listofresourceid);
if (isset($listofresourceid[$firstelem['id']])) {
$listofresourceid[$firstelem['id']]['transparency'] = (GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 0); // 0 by default when refreshing
}
}
print '<div class="assignedtoresource">';
print $form->select_dolresources_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtoresource', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0', 1, $listofresourceid);
print $form->select_dolresources_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtoresource', 1, array(), 0, '', array(), 0, 0, 0, 'AND u.statut != 0', 1, $listofresourceid);
print '</div>';
print '</td></tr>';
}
@ -1584,10 +1590,10 @@ if ($action == 'create') {
*/
$sav = getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT');
$conf->global->CONTACT_USE_SEARCH_TO_SELECT = 0;
print $form->selectcontacts(GETPOSTISSET('socid') ? GETPOSTINT('socid') : $select_contact_default, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 widthcentpercentminusxx maxwidth500', 0, 0, array(), false, 'multiple', 'contactid');
print $form->selectcontacts(GETPOSTISSET('socid') ? GETPOSTINT('socid') : $select_contact_default, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 widthcentpercentminusxx maxwidth500', 0, 0, 0, array(), 'multiple', 'contactid');
$conf->global->CONTACT_USE_SEARCH_TO_SELECT = $sav;
} else {
print $form->selectcontacts(GETPOSTISSET('socid') ? GETPOSTINT('socid') : $select_contact_default, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 widthcentpercentminusxx maxwidth500', 0, 0, array(), false, 'multiple', 'contactid');
print $form->selectcontacts(GETPOSTISSET('socid') ? GETPOSTINT('socid') : $select_contact_default, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 widthcentpercentminusxx maxwidth500', 0, 0, 0, array(), 'multiple', 'contactid');
}
print '</td></tr>';
@ -2083,7 +2089,7 @@ if ($id > 0) {
print '<tr><td class="tdtop nowrap fieldrequired">'.$langs->trans("ActionAssignedTo").'</td><td colspan="3">';
print '<div class="assignedtouser">';
print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0', 1, $listofuserid, $listofcontactid, $listofotherid);
print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, array(), 0, '', array(), 0, 0, 0, 'AND u.statut != 0', 1, $listofuserid, $listofcontactid, $listofotherid);
print '</div>';
/*if (in_array($user->id,array_keys($listofuserid)))
{
@ -2114,7 +2120,7 @@ if ($id > 0) {
foreach ($cats as $cat) {
$arrayselected[] = $cat->id;
}
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
}
@ -2264,9 +2270,11 @@ if ($id > 0) {
$actionCommReminder->typeremind = 'email';
}
$disabled = '';
/*
if ($object->datep < dol_now()) {
//$disabled = 'disabled title="'.dol_escape_htmltag($langs->trans("EventExpired")).'"';
}
*/
print '<label for="addreminder">'.img_picto('', 'bell', 'class="pictofixedwidth"').$langs->trans("AddReminder").'</label> <input type="checkbox" id="addreminder" name="addreminder"'.($checked ? ' '.$checked : '').($disabled ? ' '.$disabled : '').'><br>';
@ -2559,7 +2567,7 @@ if ($id > 0) {
$listofcontactid = array(); // not used yet
$listofotherid = array(); // not used yet
print '<div class="assignedtouser">';
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', ($object->datep != $object->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, array(), 0, '', array(), 0, 0, 0, '', ($object->datep != $object->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
print '</div>';
/*
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))

View file

@ -82,7 +82,7 @@ class CActionComm
public $picto;
/**
* @var array array of type_actions
* @var array array of type_actions // TODO: Remove or explain
*/
public $type_actions = array();

View file

@ -6,6 +6,7 @@
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -278,7 +279,7 @@ if ($object->id > 0) {
$listofuserid = array();
if (empty($donotclearsession)) {
if ($object->userownerid > 0) {
$listofuserid[$object->userownerid] = array('id'=>$object->userownerid, 'transparency'=>$object->transparency); // Owner first
$listofuserid[$object->userownerid] = array('id' => $object->userownerid, 'transparency' => $object->transparency); // Owner first
}
if (!empty($object->userassigned)) { // Now concat assigned users
// Restore array with key with same value than param 'id'
@ -298,7 +299,7 @@ if ($object->id > 0) {
$listofcontactid = array(); // not used yet
$listofotherid = array(); // not used yet
print '<div class="assignedtouser">';
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', ($object->datep != $object->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, array(), 0, '', array(), 0, 0, 0, '', ($object->datep != $object->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
print '</div>';
/*if (in_array($user->id,array_keys($listofuserid)))
{

View file

@ -2158,9 +2158,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
'@phan-var-force ActionComm $event';
if (empty($reshook)) {
// Other calendar
/*
if (empty($event->fulldayevent)) {
//print $event->getNomUrl(2).' ';
}
*/
// Date
if (empty($event->fulldayevent)) {

View file

@ -1149,8 +1149,8 @@ while ($i < $imaxinloop) {
print '<td class="tdoverflowmax150">';
if ($obj->socid > 0) {
$societestatic->id = $obj->socid;
$societestatic->client = $obj->client;
$societestatic->name = $obj->societe;
$societestatic->client = (int) $obj->client;
$societestatic->name = (string) $obj->societe;
$societestatic->email = $obj->socemail;
print $societestatic->getNomUrl(1, '', 28);

View file

@ -93,6 +93,7 @@ $result = $object->fetch($id);
$hookmanager->initHooks(array('ciblescard', 'globalcard'));
$sqlmessage = '';
$mesgs = array();
// List of sending methods
$listofmethods = array();

View file

@ -91,6 +91,7 @@ $search_dateorder_end = dol_mktime(23, 59, 59, GETPOSTINT('search_dateorder_end_
$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datedelivery_start_month'), GETPOSTINT('search_datedelivery_start_day'), GETPOSTINT('search_datedelivery_start_year'));
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datedelivery_end_month'), GETPOSTINT('search_datedelivery_end_day'), GETPOSTINT('search_datedelivery_end_year'));
$search_product_category_array = array();
if (isModEnabled('category')) {
$search_product_category_array = GETPOST("search_category_".Categorie::TYPE_PRODUCT."_list", "array");
$searchCategoryProductOperator = 0;
@ -255,6 +256,7 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'commande', $id, '');
$permissiontoread = false;
/*
* Actions
@ -1498,6 +1500,7 @@ if ($resql) {
// Détail commande
$totalqty = 0;
$oldref = null;
$totalarray = array();
$totalarray['nbfield'] = 0;
@ -1816,7 +1819,7 @@ if ($resql) {
// Channel
if (!empty($arrayfields['c.fk_input_reason']['checked'])) {
print '<td>';
$form->formInputReason($_SERVER['PHP_SELF'], $obj->fk_input_reason, 'none', '');
$form->formInputReason($_SERVER['PHP_SELF'], $obj->fk_input_reason, 'none', 0);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
@ -2101,6 +2104,7 @@ if ($resql) {
if (!empty($arrayfields['shippable']['checked'])) {
print '<td class="center">';
if (!empty($show_shippable_command) && isModEnabled('stock')) {
$text_icon = '';
if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) {
$generic_commande->loadExpeditions(); // Load array ->expeditions

View file

@ -146,7 +146,13 @@ if ($id > 0 || !empty($ref)) {
$cssclass = "titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach ($dirtpls as $reldir) {
$res = @include dol_buildpath($reldir.'/notes.tpl.php');
if ($res) {
break;
}
}
print '</div>';

View file

@ -417,11 +417,11 @@ if ($action == 'searchfiles' || $action == 'dl') { // Test on permission not req
//var_dump($files);
if (count($files) < 1) {
$nofile = array();
$nofile['id'] = $objd->id;
$nofile['entity'] = $objd->entity;
$nofile['id'] = (int) $objd->id;
$nofile['entity'] = (int) $objd->entity;
$nofile['date'] = $db->jdate($objd->date);
$nofile['date_due'] = $db->jdate($objd->date_due);
$nofile['paid'] = $objd->paid;
$nofile['paid'] = (int) $objd->paid;
$nofile['amount_ht'] = $objd->total_ht;
$nofile['amount_ttc'] = $objd->total_ttc;
$nofile['amount_vat'] = $objd->total_vat;
@ -444,11 +444,11 @@ if ($action == 'searchfiles' || $action == 'dl') { // Test on permission not req
$filesarray[$nofile['item'].'_'.$nofile['id']] = $nofile;
} else {
foreach ($files as $key => $file) {
$file['id'] = $objd->id;
$file['entity'] = $objd->entity;
$file['id'] = (int) $objd->id;
$file['entity'] = (int) $objd->entity;
$file['date'] = $db->jdate($objd->date);
$file['date_due'] = $db->jdate($objd->date_due);
$file['paid'] = $objd->paid;
$file['paid'] = (int) $objd->paid;
$file['amount_ht'] = $objd->total_ht;
$file['amount_ttc'] = $objd->total_ttc;
$file['amount_vat'] = $objd->total_vat;
@ -816,7 +816,7 @@ if (!empty($date_start) && !empty($date_stop)) {
print '<td class="nowraponall tdoverflowmax150">';
if ($data['item'] == 'Invoice') {
$invoice->id = $data['id'];
$invoice->id = (int) $data['id'];
$invoice->ref = $data['ref'];
$invoice->total_ht = $data['amount_ht'];
$invoice->total_ttc = $data['amount_ttc'];
@ -827,7 +827,7 @@ if (!empty($date_start) && !empty($date_stop)) {
$invoice->multicurrency_code = $data['currency'];
print $invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
} elseif ($data['item'] == 'SupplierInvoice') {
$supplier_invoice->id = $data['id'];
$supplier_invoice->id = (int) $data['id'];
$supplier_invoice->ref = $data['ref'];
$supplier_invoice->total_ht = $data['amount_ht'];
$supplier_invoice->total_ttc = $data['amount_ttc'];
@ -838,27 +838,27 @@ if (!empty($date_start) && !empty($date_stop)) {
$supplier_invoice->multicurrency_code = $data['currency'];
print $supplier_invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
} elseif ($data['item'] == 'ExpenseReport') {
$expensereport->id = $data['id'];
$expensereport->id = (int) $data['id'];
$expensereport->ref = $data['ref'];
print $expensereport->getNomUrl(1, 0, 0, 0, 0, 0);
} elseif ($data['item'] == 'SalaryPayment') {
$salary_payment->id = $data['id'];
$salary_payment->id = (int) $data['id'];
$salary_payment->ref = $data['ref'];
print $salary_payment->getNomUrl(1);
} elseif ($data['item'] == 'Donation') {
$don->id = $data['id'];
$don->id = (int) $data['id'];
$don->ref = $data['ref'];
print $don->getNomUrl(1, 0, '', 0);
} elseif ($data['item'] == 'SocialContributions') {
$charge_sociales->id = $data['id'];
$charge_sociales->id = (int) $data['id'];
$charge_sociales->ref = $data['ref'];
print $charge_sociales->getNomUrl(1, 0, 0, 0, 0);
} elseif ($data['item'] == 'VariousPayment') {
$various_payment->id = $data['id'];
$various_payment->id = (int) $data['id'];
$various_payment->ref = $data['ref'];
print $various_payment->getNomUrl(1, '', 0, 0);
} elseif ($data['item'] == 'LoanPayment') {
$payment_loan->id = $data['id'];
$payment_loan->id = (int) $data['id'];
$payment_loan->ref = $data['ref'];
print $payment_loan->getNomUrl(1, 0, 0, '', 0);
} else {

View file

@ -305,11 +305,11 @@ if ($result < 0) {
$obj = $db->fetch_object($resql);
$min = $db->jdate($obj->min);
$max = $db->jdate($obj->max);
$log = "graph.php: min=".$min." max=".$max;
dol_syslog($log);
} else {
dol_print_error($db);
}
$log = "graph.php: min=".$min." max=".$max;
dol_syslog($log);
// CRED PART
// Chargement du tableau des années

View file

@ -974,6 +974,7 @@ if ($resql) {
$last_receipts = array();
$last_releve = '';
$last_ok = 0;
$numr = 0;
$resqlr = $db->query($sql);
if ($resqlr) {
@ -1101,7 +1102,7 @@ if ($resql) {
// Bank line
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('RubriquesTransactions');
$cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, $search_bid, 'parent', null, null, 1);
$cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, $search_bid, 'parent', 0, 0, 1);
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_bid', $cate_arbo, $search_bid, $tmptitle, 0, 0, '', 0, 0, 0, '', '', 1);
$moreforfilter .= '</div>';
}

View file

@ -505,7 +505,7 @@ if ($action == 'create') {
$arrayselected[] = $cat->id;
}
}
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
}
@ -594,6 +594,10 @@ if ($action == 'create') {
$name = 'cle_rib';
$sizecss = 'minwidth50';
$content = $object->cle_rib;
} else {
$name = 'undefined';
$sizecss = 'undefined';
$content = 'undefined';
}
print '<td>'.$langs->trans($val).'</td>';
@ -651,7 +655,7 @@ if ($action == 'create') {
print '<tr><td class="'.$fieldrequired.'titlefieldcreate">'.$langs->trans("AccountancyCode").'</td>';
print '<td>';
print img_picto('', 'accounting_account', 'class="pictofixedwidth"');
print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1);
print $formaccounting->select_account($object->account_number, 'account_number', 1, array(), 1, 1);
if ($formaccounting->nbaccounts == 0) {
$langs->load("errors");
$htmltext = $langs->transnoentitiesnoconv("WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv("MenuAccountancy"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Chartofaccounts"));
@ -1069,7 +1073,7 @@ if ($action == 'create') {
$arrayselected[] = $cat->id;
}
}
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
}
@ -1110,7 +1114,7 @@ if ($action == 'create') {
if (isModEnabled('accounting')) {
/** @var FormAccounting $formaccounting */
print img_picto('', 'accounting_account', 'class="pictofixedwidth"');
print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1);
print $formaccounting->select_account($object->account_number, 'account_number', 1, array(), 1, 1);
if ($formaccounting->nbaccounts == 0) {
$langs->load("errors");
$htmltext = $langs->transnoentitiesnoconv("WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv("MenuAccountancy"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Chartofaccounts"));
@ -1182,6 +1186,10 @@ if ($action == 'create') {
$name = 'cle_rib';
$css = 'width50';
$content = $object->cle_rib;
} else {
$name = 'undefined';
$css = 'undefined';
$content = 'undefined';
}
print '<tr><td>'.$langs->trans($val).'</td>';

View file

@ -94,6 +94,13 @@ if (GETPOST("ref")) {
$title = $object->ref.' - '.$langs->trans("Graph");
$helpurl = "";
$show1 = '';
$show2 = '';
$show3 = '';
$show4 = '';
$show5 = '';
$morehtml = '';
llxHeader('', $title, $helpurl);
$result = dol_mkdir($conf->bank->dir_temp);

View file

@ -636,7 +636,7 @@ if ($result) {
// Bank line
print '<tr><td class="toptd">'.$form->editfieldkey('RubriquesTransactions', 'custcats', '', $object, 0).'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, null, 'parent', null, null, 1);
$cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, '', 'parent', 0, 0, 1);
$arrayselected = array();
@ -647,7 +647,7 @@ if ($result) {
$arrayselected[] = $cat->id;
}
}
print img_picto('', 'category', 'class="paddingright"').$form->multiselectarray('custcats', $cate_arbo, $arrayselected, null, null, null, null, "90%");
print img_picto('', 'category', 'class="paddingright"').$form->multiselectarray('custcats', $cate_arbo, $arrayselected, 0, 0, '', 0, "90%");
print "</td></tr>";
}

View file

@ -495,6 +495,8 @@ if (empty($numref)) {
$obj = $db->fetch_object($resql);
$total = $obj->amount;
$db->free($resql);
} else {
$total = 0;
}
$totalc = $totald = 0;

View file

@ -173,13 +173,13 @@ if ($action == 'add' && $user->hasRight('banque', 'transfer')) {
}
if (!$error) {
$bank_line_id_from = $tmpaccountfrom->addline($dateo[$n], $typefrom, $label[$n], price2num(-1 * (float) $amount[$n]), '', '', $user);
$bank_line_id_from = $tmpaccountfrom->addline($dateo[$n], $typefrom, $label[$n], price2num(-1 * (float) $amount[$n]), '', 0, $user);
}
if (!($bank_line_id_from > 0)) {
$error++;
}
if (!$error) {
$bank_line_id_to = $tmpaccountto->addline($dateo[$n], $typeto, $label[$n], $amountto[$n], '', '', $user);
$bank_line_id_to = $tmpaccountto->addline($dateo[$n], $typeto, $label[$n], $amountto[$n], '', 0, $user);
}
if (!($bank_line_id_to > 0)) {
$error++;

View file

@ -5,6 +5,7 @@
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com
* Copyright (C) 2016-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -283,7 +284,7 @@ if (GETPOST("account") || GETPOST("ref")) {
if ($tmpobj->family == 'invoice') {
$facturestatic->ref = $tmpobj->ref;
$facturestatic->id = $tmpobj->objid;
$facturestatic->type = $tmpobj->type;
$facturestatic->type = (int) $tmpobj->type;
$ref = $facturestatic->getNomUrl(1, '');
$societestatic->id = $tmpobj->socid;

View file

@ -226,6 +226,8 @@ if (empty($reshook)) {
if ($result > 0) {
$result = $accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing)
}
} else {
$account_line = null;
}
if ($result >= 0) {
@ -233,7 +235,7 @@ if (empty($reshook)) {
header("Location: ".DOL_URL_ROOT.'/compta/bank/various_payment/list.php');
exit;
} else {
$object->error = $accountline->error;
$object->error = $accountline ? $accountline->error : 'No AccountLine';
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
}
@ -356,9 +358,13 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) {
$form = new Form($db);
if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db);
} else {
$formaccounting = null;
}
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
} else {
$formproject = null;
}
if ($id) {
@ -531,7 +537,7 @@ if ($action == 'create') {
// TODO Remove the fieldrequired and allow instead to edit a various payment to enter accounting code
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("AccountAccounting").'</td>';
print '<td>';
print $formaccounting->select_account($accountancy_code, 'accountancy_code', 1, null, 1, 1);
print $formaccounting->select_account($accountancy_code, 'accountancy_code', 1, array(), 1, 1);
print '</td></tr>';
} else { // For external software
print '<tr><td class="titlefieldcreate">'.$langs->trans("AccountAccounting").'</td>';
@ -606,7 +612,7 @@ if ($id) {
$morehtmlref = '<div class="refidno">';
// Project
if (isModEnabled('project')) {
if (isModEnabled('project') && $formproject !== null) {
$langs->load("projects");
//$morehtmlref .= '<br>';
if ($permissiontoadd) {

View file

@ -143,7 +143,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."factu
$sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement AND p.fk_bank = b.rowid";
$sql .= " AND f.module_source = '".$db->escape($posmodule)."'";
$sql .= " AND f.pos_source = '".$db->escape($terminalid)."'";
$sql .= " AND f.paye = 1";
//$sql .= " AND f.paye = 1";
$sql .= " AND p.entity = ".$conf->entity; // Never share entities for features related to accountancy
/*if ($key == 'cash') $sql.=" AND cp.code = 'LIQ'";
elseif ($key == 'cheque') $sql.=" AND cp.code = 'CHQ'";

View file

@ -184,6 +184,11 @@ class FactureRec extends CommonInvoice
*/
public $mode_reglement_code; // Code in llx_c_paiement
/**
* @var int ID of bank account to use if invoice is set for direct debit payment (see PAYMENTCODETOEDITSOCIETERIB)
*/
public $fk_societe_rib;
/**
* @var int
*/
@ -198,13 +203,11 @@ class FactureRec extends CommonInvoice
*/
public $generate_pdf; // 1 to generate PDF on invoice generation (default)
/**
* @var int
*/
public $fk_societe_rib;
const PAYMENTCODETOEDITSOCIETERIB = "PRE";
/**
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
@ -567,7 +570,7 @@ class FactureRec extends CommonInvoice
$sql .= " localtax1 = ".((float) $this->total_localtax1).",";
$sql .= " localtax2 = ".((float) $this->total_localtax2).",";
$sql .= " total_ht = ".((float) $this->total_ht).",";
$sql .= " total_ttc = ".((float) $this->total_ttc);
$sql .= " total_ttc = ".((float) $this->total_ttc).",";
$sql .= " fk_societe_rib = ".((int) $this->fk_societe_rib);
// TODO Add missing fields
$sql .= " WHERE rowid = ".((int) $this->id);

View file

@ -495,7 +495,8 @@ class Facture extends CommonInvoice
$this->note_private = (isset($this->note_private) ? trim($this->note_private) : '');
$this->note = (isset($this->note) ? trim($this->note) : $this->note_private); // deprecated
$this->note_public = trim($this->note_public);
$this->note_public = (isset($this->note_public) ? trim($this->note_public) : '');
if (!$this->cond_reglement_id) {
$this->cond_reglement_id = 0;
}

View file

@ -244,7 +244,7 @@ class FactureLigne extends CommonInvoiceLine
$this->date_start = $this->db->jdate($objp->date_start);
$this->date_end = $this->db->jdate($objp->date_end);
$this->info_bits = $objp->info_bits;
$this->tva_npr = (($objp->info_bits & 1) == 1) ? 1 : 0;
$this->tva_npr = ((($objp->info_bits & 1) == 1) ? 1 : 0);
$this->special_code = $objp->special_code;
$this->total_ht = $objp->total_ht;
$this->total_tva = $objp->total_tva;

View file

@ -64,7 +64,7 @@ if (!$user->hasRight('facture', 'lire')) {
accessforbidden();
}
$permissiontoread = $user->hasRight('facture', 'lire');
$permissiontoread = ($user->hasRight('facture', 'lire') == 1);
/*

View file

@ -630,6 +630,7 @@ if ($resql) {
print img_warning($langs->trans("IBANNotDefined"));
}
} else {
$langs->load("banks");
print img_warning($langs->trans("NoBankAccountDefined"));
}
print '</td>';
@ -650,6 +651,7 @@ if ($resql) {
}
}
} else {
$langs->load("banks");
print img_warning($langs->trans("NoBankAccountDefined"));
}
}

View file

@ -334,7 +334,7 @@ $sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AN
$sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')", 1, 0).') as nb_late,';
$sql .= " sum(".$db->ifsql("cd.statut=5", 1, 0).') as nb_closed,';
$sql .= " c.rowid as cid, c.ref, c.datec, c.tms, c.statut,";
$sql .= " s.nom as name, s.name_alias, s.logo, s.rowid as socid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur";
$sql .= " s.nom as name, s.name_alias, s.logo, s.rowid as socid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,";
if (!$user->hasRight('societe', 'client', 'voir')) {
$sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
@ -351,7 +351,7 @@ if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
}
$sql .= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.statut,";
$sql .= " s.nom, s.name_alias, s.logo, s.rowid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
$sql .= " s.nom, s.name_alias, s.logo, s.rowid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur";
$sql .= " ORDER BY c.tms DESC";
$sql .= $db->plimit($max);

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2014-2017 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2014-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.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
@ -29,7 +30,11 @@
// $nomessageinsetmoduleoptions can be set to 1
// $formSetup may be defined
/**
* @var Conf $conf
* @var DoliDB $db
* @var FormSetup $formSetup
* @var Translate $langs
* @var User $user
* @var string $action
* @var int $error
* @var ?int $nomessageinupdate

View file

@ -27,10 +27,20 @@
// $permissionnote must be defined to permission to edit object
// $object must be defined (object is loaded in this file with fetch)
// $id must be defined (object is loaded in this file with fetch)
/**
* @var CommonObject $object
* @var Conf $conf
* @var DoliDB $db
* @var Translate $langs
* @var User $user
*
* @var ?string $action
* @var int $id
* @var int $permissionnote
*/
// Set public note
if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel', 'alpha')) {
if (empty($action) || !is_object($object) || empty($id)) {
if (!is_object($object) || empty($id)) {
dol_print_error(null, 'Include of actions_setnotes.inc.php was done but required variable was not set before');
}
if (empty($object->id)) {
@ -79,7 +89,7 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel',
} elseif ($action == 'setnote_private' && !empty($permissionnote) && !GETPOST('cancel', 'alpha')) { // Set public note
if (empty($user->socid)) {
// Private notes (always hidden to external users)
if (empty($action) || !is_object($object) || empty($id)) {
if (!is_object($object) || empty($id)) {
dol_print_error(null, 'Include of actions_setnotes.inc.php was done but required variable was not set before');
}
if (empty($object->id)) {

View file

@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2024 Frederic France <frederic.france@netlogic.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,10 +1,10 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2019 Frederic France <frederic.france@netlogic.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1586,10 +1586,10 @@ abstract class CommonDocGenerator
/**
* display extrafields columns content
*
* @param CommonObjectLine $object line of common object
* @param Translate $outputlangs Output language
* @param array<string,mixed> $params array of additional parameters
* @return string Html string
* @param CommonObject|CommonObjectLine $object line of common object
* @param Translate $outputlangs Output language
* @param array<string,mixed> $params array of additional parameters
* @return string Html string
*/
public function getExtrafieldsInHtml($object, $outputlangs, $params = array())
{

View file

@ -425,25 +425,25 @@ abstract class CommonObject
/**
* @var int Barcode type
* @see fetch_barcode()
* @see fetchBarCode()
*/
public $barcode_type;
/**
* @var string Code of the barcode type
* @see fetch_barcode(), barcode_type
* @see fetchBarCode(), barcode_type
*/
public $barcode_type_code;
/**
* @var string Label of the barcode type
* @see fetch_barcode(), barcode_type
* @see fetchBarCode(), barcode_type
*/
public $barcode_type_label;
/**
* @var string
* @see fetch_barcode(), barcode_type
* @see fetchBarCode(), barcode_type
*/
public $barcode_type_coder;
@ -571,19 +571,19 @@ abstract class CommonObject
public $fk_account;
/**
* @var string Public note
* @var ?string Public note
* @see update_note()
*/
public $note_public;
/**
* @var string Private note
* @var ?string Private note
* @see update_note()
*/
public $note_private;
/**
* @var string
* @var ?string
* @deprecated Use $note_private instead.
* @see $note_private
*/
@ -1627,11 +1627,11 @@ abstract class CommonObject
* Return array with list of possible values for type of contacts
*
* @param 'internal'|'external'|'all' $source 'internal', 'external' or 'all'
* @param string $order Sort order by : 'position', 'code', 'rowid'...
* @param int<0,1> $option 0=Return array id->label, 1=Return array code->label
* @param int<0,1> $activeonly 0=all status of contact, 1=only the active
* @param string $code Type of contact (Example: 'CUSTOMER', 'SERVICE')
* @return array<int,string>|array<string,string>|null Array list of type of contacts (id->label if option=0, code->label if option=1), or null if error
* @param string $order Sort order by : 'position', 'code', 'rowid'...
* @param int<0,1> $option 0=Return array id->label, 1=Return array code->label, 2=Return complete array
* @param int<0,1> $activeonly 0=all status of contact, 1=only the active
* @param string $code Type of contact (Example: 'CUSTOMER', 'SERVICE')
* @return array<int,string>|array<string,string>|array<int,array{id:int,code:string,label:string}>|null Array list of type of contacts (id->label if option=0, code->label if option=1), or null if error
*/
public function liste_type_contact($source = 'internal', $order = 'position', $option = 0, $activeonly = 0, $code = '')
{
@ -1646,43 +1646,47 @@ abstract class CommonObject
}
$tab = array();
$sql = "SELECT DISTINCT tc.rowid, tc.code, tc.libelle as type_label, tc.position";
$sql .= " FROM ".$this->db->prefix()."c_type_contact as tc";
$sql .= " WHERE tc.element='".$this->db->escape($this->element)."'";
$sql .= " WHERE tc.element = '".$this->db->escape($this->element)."'";
if ($activeonly == 1) {
$sql .= " AND tc.active=1"; // only the active types
$sql .= " AND tc.active = 1"; // only the active types
}
if (!empty($source) && $source != 'all') {
$sql .= " AND tc.source='".$this->db->escape($source)."'";
$sql .= " AND tc.source = '".$this->db->escape($source)."'";
}
if (!empty($code)) {
$sql .= " AND tc.code='".$this->db->escape($code)."'";
$sql .= " AND tc.code = '".$this->db->escape($code)."'";
}
$sql .= $this->db->order($order, 'ASC');
//print "sql=".$sql;
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $this->db->fetch_object($resql);
$transkey = "TypeContact_".$this->element."_".$source."_".$obj->code;
$libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->type_label);
if (empty($option)) {
$tab[$obj->rowid] = $libelle_type;
} else {
$tab[$obj->code] = $libelle_type;
}
$i++;
}
return $tab;
} else {
if (!$resql) {
$this->error = $this->db->lasterror();
//dol_print_error($this->db);
return null;
}
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $this->db->fetch_object($resql);
$transkey = "TypeContact_".$this->element."_".$source."_".$obj->code;
$libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->type_label);
if (empty($option)) {
$tab[$obj->rowid] = $libelle_type;
} elseif ($option == 1) {
$tab[$obj->code] = $libelle_type;
} else {
$tab[$obj->rowid] = array('id' => $obj->rowid, 'code' => $obj->code, 'label' => $libelle_type);
}
$i++;
}
return $tab;
}
/**
@ -1698,7 +1702,7 @@ abstract class CommonObject
*/
public function listeTypeContacts($source = 'internal', $option = 0, $activeonly = 0, $code = '', $element = '', $excludeelement = '')
{
global $langs, $conf;
global $langs;
$langs->loadLangs(array('bills', 'contracts', 'interventions', 'orders', 'projects', 'propal', 'ticket', 'agenda'));
@ -1780,8 +1784,6 @@ abstract class CommonObject
*/
public function getIdContact($source, $code, $status = 0)
{
global $conf;
$result = array();
$i = 0;
// Particular case for shipping
@ -1948,13 +1950,24 @@ abstract class CommonObject
* if it is not defined, ->element must be defined to know default barcode type.
*
* @return int<-1,1> Return integer <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded)
* @deprecated Use fetchBarCode()
*/
public function fetch_barcode()
{
// phpcs:enable
global $conf;
return $this->fetchBarCode();
}
dol_syslog(get_class($this).'::fetch_barcode this->element='.$this->element.' this->barcode_type='.$this->barcode_type);
/**
* Load data for barcode into properties ->barcode_type*
* Properties ->barcode_type that is id of barcode. Type is used to find other properties, but
* if it is not defined, ->element must be defined to know default barcode type.
*
* @return int<-1,1> Return integer <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded)
*/
public function fetchBarCode()
{
dol_syslog(get_class($this).'::fetchBarCode this->element='.$this->element.' this->barcode_type='.$this->barcode_type);
$idtype = $this->barcode_type;
if (empty($idtype) && $idtype != '0') { // If type of barcode no set, we try to guess. If set to '0' it means we forced to have type remain not defined
@ -1963,7 +1976,7 @@ abstract class CommonObject
} elseif ($this->element == 'societe') {
$idtype = getDolGlobalString('GENBARCODE_BARCODETYPE_THIRDPARTY');
} else {
dol_syslog('Call fetch_barcode with barcode_type not defined and cannot be guessed', LOG_WARNING);
dol_syslog('Call fetchBarCode with barcode_type not defined and cannot be guessed', LOG_WARNING);
}
}
@ -1972,10 +1985,11 @@ abstract class CommonObject
$sql = "SELECT rowid, code, libelle as label, coder";
$sql .= " FROM ".$this->db->prefix()."c_barcode_type";
$sql .= " WHERE rowid = ".((int) $idtype);
dol_syslog(get_class($this).'::fetch_barcode', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
$this->barcode_type = $obj->rowid;
$this->barcode_type_code = $obj->code;
$this->barcode_type_label = $obj->label;

View file

@ -378,7 +378,8 @@ class Conf extends stdClass
'hooks' => array(),
'dir' => array(),
'syslog' => array(),
'websitetemplates' => array()
'websitetemplates' => array(),
//'captcha' => array() // Can be removed,this does not generates warning
);
// First level object that are modules.

View file

@ -3757,7 +3757,7 @@ class Form
// Add criteria on ref/label
if ($filterkey != '') {
$sql .= ' AND (';
$prefix = !getDolGlobalString('PRODUCT_DONOTSEARCH_ANYWHERE') ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
$prefix = getDolGlobalString('PRODUCT_DONOTSEARCH_ANYWHERE') ? '' : '%'; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
// For natural search
$search_crit = explode(' ', $filterkey);
$i = 0;
@ -4041,10 +4041,12 @@ class Form
}
$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
// set $parameters to call hook
$outarrayentry = array(
'key' => $outkey,
'value' => $outref,
'label' => $outvallabel,
'labelhtml' => $optlabel,
'qty' => $outqty,
'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
@ -4064,7 +4066,6 @@ class Form
$outarrayentry['multicurrency_code'] = $objp->multicurrency_code;
$outarrayentry['multicurrency_unitprice'] = price2num($objp->multicurrency_unitprice, 'MU');
}
$parameters = array(
'objp' => &$objp,
'optstart' => &$optstart,
@ -4084,6 +4085,7 @@ class Form
'key' => $outkey,
'value' => $outref,
'label' => $outvallabel,
'labelhtml' => $optlabel,
'qty' => $outqty,
'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
'price_qty_ht_locale' => price($objp->fprice),
@ -9226,7 +9228,6 @@ class Form
public static function multiselectarray($htmlname, $array, $selected = array(), $key_in_label = 0, $value_as_key = 0, $morecss = '', $translate = 0, $width = 0, $moreattrib = '', $elemtype = '', $placeholder = '', $addjscombo = -1)
{
global $conf, $langs;
$out = '';
if ($addjscombo < 0) {
@ -10288,8 +10289,8 @@ class Form
// Complete object if not complete
if (empty($object->barcode_type_code) || empty($object->barcode_type_coder)) {
// @phan-suppress-next-line PhanPluginUnknownObjectMethodCall
$result = $object->fetch_barcode();
//Check if fetch_barcode() failed
$result = $object->fetchBarCode();
//Check if fetchBarCode() failed
if ($result < 1) {
return '<!-- ErrorFetchBarcode -->';
}

View file

@ -828,22 +828,22 @@ class FormCompany extends Form
$out = '';
if (is_object($object) && method_exists($object, 'liste_type_contact')) {
'@phan-var-force CommonObject $object'; // CommonObject has the method.
$lesTypes = $object->liste_type_contact($source, $sortorder, 0, 1); // List of types into c_type_contact for element=$object->element
$lesTypes = $object->liste_type_contact($source, $sortorder, 2, 1); // List of types into c_type_contact for element=$object->element
$out .= '<select class="flat valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
if ($showempty) {
$out .= '<option value="0">&nbsp;</option>';
}
foreach ($lesTypes as $key => $value) {
$out .= '<option value="' . $key . '"';
foreach ($lesTypes as $key => $arrayvalue) {
$out .= '<option value="'.$key.'" data-code="'.$arrayvalue['code'].'"';
if ($key == $selected) {
$out .= ' selected';
}
$out .= '>' . $value . '</option>';
$out .= '>'.$arrayvalue['label'].'</option>';
}
$out .= "</select>";
if ($user->admin && empty($forcehidetooltip)) {
$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
$out .= ajax_combobox($htmlname);

View file

@ -271,8 +271,8 @@ class FormFile
$menudolibarrsetupmax = $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Security");
$tooltiptext = $langs->trans("ThisLimitIsDefinedInSetupAt", $menudolibarrsetupmax, $max, $maxphptoshowparam, $maxphptoshow);
if (getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION')) {
$tooltiptext .= '<br><br>Option to extract the file content in text to save it in database is ON <span class="opacitymedium">('.getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION').')</span>';
if (getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT')) {
$tooltiptext .= '<br><br>Option to extract the file content in text to save it in database is ON <span class="opacitymedium">('.getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT').')</span>';
}
$out .= ' ';
@ -694,7 +694,7 @@ class FormFile
if (is_array($genallowed)) {
$modellist = $genallowed;
} else {
include_once DOL_DOCUMENT_ROOT.'/core/modules/stock/modules_movement.php';
include_once DOL_DOCUMENT_ROOT.'/core/modules/movement/modules_movement.php';
$modellist = ModelePDFMovement::liste_modeles($this->db);
}
} elseif ($modulepart == 'export') {
@ -975,12 +975,18 @@ class FormFile
}
}
require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
$i = 0;
foreach ($file_list as $file) {
$i++;
require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
$ecmfile = new EcmFiles($this->db);
$ecmfile->fetch($file['rowid']);
if (!empty($file['rowid'])) {
$ecmfile = new EcmFiles($this->db);
$ecmfile->fetch($file['rowid']);
} else {
$ecmfile = null;
}
// Define relative path for download link (depends on module)
$relativepath = (string) $file["name"]; // Cas general
@ -1007,22 +1013,25 @@ class FormFile
} else {
$out .= '<span class="spanoverflow">';
}
// $out .= '<a class="documentdownload paddingright" ';
// if (getDolGlobalInt('MAIN_DISABLE_FORCE_SAVEAS') == 2) {
// $out .= 'target="_blank" ';
// }
// $out .= 'href="'.$documenturl.'?modulepart='.$modulepart.'&file='.urlencode($relativepath).($param ? '&'.$param : '').'"';
if (is_object($ecmfile)) {
$out .= $ecmfile->getNomUrl(1, $modulepart, 0, 0, ' documentdownload');
} else {
$out .= '<a class="documentdownload paddingright" ';
if (getDolGlobalInt('MAIN_DISABLE_FORCE_SAVEAS') == 2) {
$out .= 'target="_blank" ';
}
$out .= 'href="'.$documenturl.'?modulepart='.$modulepart.'&file='.urlencode($relativepath).($param ? '&'.$param : '').'"';
// $mime = dol_mimetype($relativepath, '', 0);
// if (preg_match('/text/', $mime)) {
// $out .= ' target="_blank" rel="noopener noreferrer"';
// }
// $out .= ' title="'.dol_escape_htmltag($file["name"]).'"';
// $out .= '>';
// $out .= img_mime($file["name"], $langs->trans("File").': '.$file["name"]);
// $out .= dol_trunc($file["name"], 150);
// $out .= '</a>';
$out .= $ecmfile->getNomUrl(1, $modulepart, 0, 0, ' documentdownload');
$mime = dol_mimetype($relativepath, '', 0);
if (preg_match('/text/', $mime)) {
$out .= ' target="_blank" rel="noopener noreferrer"';
}
$out .= ' title="'.dol_escape_htmltag($file["name"]).'"';
$out .= '>';
$out .= img_mime($file["name"], $langs->trans("File").': '.$file["name"]);
$out .= dol_trunc($file["name"], 150);
$out .= '</a>';
}
$out .= '</span>'."\n";
$out .= $imgpreview;
$out .= '</td>';

View file

@ -769,7 +769,8 @@ class FormTicket
$formcontract = new FormContract($this->db);
print '<tr><td><label for="contract"><span class="">'.$langs->trans("Contract").'</span></label></td><td>';
print img_picto('', 'contract', 'class="pictofixedwidth"');
print $formcontract->select_contract(-1, GETPOSTINT('contactid'), 'contractid', 0, 1, 1, 1);
// socid is for internal users null and not 0 or -1
print $formcontract->select_contract($user->socid ?? -1, GETPOSTINT('contactid'), 'contractid', 0, 1, 1, 1);
print '</td></tr>';
}
}

View file

@ -788,6 +788,9 @@ if (!empty($search_measures) && !empty($search_xaxis)) {
} elseif (preg_match('/\-max$/', $val)) {
$tmpval = preg_replace('/\-max$/', '', $val);
$sql .= "MAX(".$db->ifsql($tmpval.' IS NULL', '0', $tmpval).") as y_".$key.", ";
} elseif (preg_match('/\-stddevpop$/', $val)) {
$tmpval = preg_replace('/\-stddevpop$/', '', $val);
$sql .= "STDDEV_POP(".$db->ifsql($tmpval.' IS NULL', '0', $tmpval).") as y_".$key.", ";
}
}
$sql = preg_replace('/,\s*$/', '', $sql);

View file

@ -122,9 +122,10 @@ abstract class DoliDB implements Database
* Return SQL string to force an index
*
* @param string $nameofindex Name of index
* @param int $mode 0=Use, 1=Force
* @return string SQL string
*/
public function hintindex($nameofindex)
public function hintindex($nameofindex, $mode = 1)
{
return '';
}

View file

@ -200,11 +200,12 @@ class DoliDBMysqli extends DoliDB
* Return SQL string to force an index
*
* @param string $nameofindex Name of index
* @param int $mode 0=Use, 1=Force
* @return string SQL string
*/
public function hintindex($nameofindex)
public function hintindex($nameofindex, $mode = 1)
{
return " FORCE INDEX(".preg_replace('/[^a-z0-9_]/', '', $nameofindex).")";
return " ".($mode == 1 ? 'FORCE' : 'USE')." INDEX(".preg_replace('/[^a-z0-9_]/', '', $nameofindex).")";
}

View file

@ -23,6 +23,9 @@ define('NOTOKENRENEWAL', 1); // Disables token renewal
// Load Dolibarr environment
require '../../../../main.inc.php';
/**
* @var Conf $conf
*/
top_httphead();

View file

@ -23,6 +23,10 @@ define('NOTOKENRENEWAL', 1); // Disables token renewal
// Load Dolibarr environment
require '../../../../main.inc.php';
/**
* @var Conf $conf
* @var Translate $langs
*/
$langs->load("ecm");

View file

@ -23,6 +23,9 @@ define('NOTOKENRENEWAL', 1); // Disables token renewal
// Load Dolibarr environment
require '../../../../main.inc.php';
/**
* @var Conf $conf
*/
top_httphead();

View file

@ -23,6 +23,9 @@ define('NOTOKENRENEWAL', 1); // Disables token renewal
// Load Dolibarr environment
require '../../../../main.inc.php';
/**
* @var Conf $conf
*/
top_httphead();

View file

@ -23,6 +23,9 @@ define('NOTOKENRENEWAL', 1); // Disables token renewal
// Load Dolibarr environment
require '../../../../main.inc.php';
/**
* @var Conf $conf
*/
top_httphead();

View file

@ -127,12 +127,15 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
if (data != null)
{
response($.map( data, function(item) {
console.log("Received answer from ajax GET, we populate array to return to the jquery autocomplete");
if (autoselect == 1 && data.length == 1) {
$("#search_'.$htmlnamejquery.'").val(item.value);
$("#'.$htmlnamejquery.'").val(item.key).trigger("change");
}
var label = "";
if (item.label != null) {
if (item.labelhtml != null) {
label = item.labelhtml.toString();
} else if (item.label != null) {
label = item.label.toString();
}
var update = {};
@ -148,7 +151,6 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
});
}
console.log("Return value from GET to the rest of code");
return { label: label,
value: item.value,
id: item.key,

View file

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2024 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
@ -97,15 +97,13 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu
'table' => $object->table_element,
'tablefromt' => $tablepath
);
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
$arrayofmesures[$tablealias.'.'.$key.'-stddevpop'] = array(
'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($val['label']).' <span class="opacitymedium">('.$langs->trans("StandardDeviationPop").')</span>',
'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']),
'position' => ($position + ($count * 100000)).'.5',
'table' => $object->table_element,
'tablefromt' => $tablepath
);
}
$arrayofmesures[$tablealias.'.'.$key.'-stddevpop'] = array(
'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($val['label']).' <span class="opacitymedium">('.$langs->trans("StandardDeviationPop").')</span>',
'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']),
'position' => ($position + ($count * 100000)).'.5',
'table' => $object->table_element,
'tablefromt' => $tablepath
);
}
}
// Add extrafields to Measures
@ -142,15 +140,13 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu
'table' => $object->table_element,
'tablefromt' => $tablepath
);
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
$arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-stddevpop'] = array(
'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' <span class="opacitymedium">('.$langs->trans("StandardDeviationPop").')</span>',
'labelnohtml' => $labelofobject.': '.$langs->trans($val),
'position' => ($position + ($count * 100000)).'.5',
'table' => $object->table_element,
'tablefromt' => $tablepath
);
}
$arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-stddevpop'] = array(
'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' <span class="opacitymedium">('.$langs->trans("StandardDeviationPop").')</span>',
'labelnohtml' => $labelofobject.': '.$langs->trans($val),
'position' => ($position + ($count * 100000)).'.5',
'table' => $object->table_element,
'tablefromt' => $tablepath
);
}
}
}
@ -595,7 +591,7 @@ function fillArrayOfFilterFields($object, $tablealias, $labelofobject, &$arrayof
'position' => 1000 + (int) $extrafields->attributes[$object->table_element]['pos'][$key] + ($count * 100000),
'table' => $object->table_element,
'tablefromt' => $tablepath,
'type' => $val['type'] // TODO: Check this, seems a copy/paste error
'type' => $extrafields->attributes[$object->table_element]['type'][$key],
);
}
}

View file

@ -2181,11 +2181,11 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
}
// Use a convertisser Doc to Text
$useFullTextIndexation = getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION');
$useFullTextIndexation = getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT');
if (empty($useFullTextIndexation) && $forceFullTextIndexation == '1') {
if (getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION_PDFTOTEXT')) {
if (getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT_PDFTOTEXT')) {
$useFullTextIndexation = 'pdftotext';
} elseif (getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION_DOCLING')) {
} elseif (getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT_DOCLING')) {
$useFullTextIndexation = 'docling';
}
}
@ -2213,7 +2213,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
// We also exclude '/temp/' dir and 'documents/admin/documents'
// We make escapement here and call executeCLI without escapement because we don't want to have the '*.log' escaped.
$cmd = getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION_PDFTOTEXT', 'pdftotext')." -htmlmeta '".escapeshellcmd($filetoprocess)."' - ";
$cmd = getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT_PDFTOTEXT', 'pdftotext')." -htmlmeta '".escapeshellcmd($filetoprocess)."' - ";
$resultexec = $utils->executeCLI($cmd, $outputfile, 0, null, 1);
if (!$resultexec['error']) {
@ -2239,7 +2239,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
// We also exclude '/temp/' dir and 'documents/admin/documents'
// We make escapement here and call executeCLI without escapement because we don't want to have the '*.log' escaped.
$cmd = getDolGlobalString('MAIN_USE_FULL_TEXT_INDEXATION_DOCLING', 'docling')." --from pdf --to text '".escapeshellcmd($filetoprocess)."'";
$cmd = getDolGlobalString('MAIN_SAVE_FILE_CONTENT_AS_TEXT_DOCLING', 'docling')." --from pdf --to text '".escapeshellcmd($filetoprocess)."'";
$resultexec = $utils->executeCLI($cmd, $outputfile, 0, null, 1);
if (!$resultexec['error']) {

View file

@ -1555,7 +1555,7 @@ function dol_get_object_properties($obj, $properties = [])
* @see https://php.net/manual/language.oop5.cloning.php
* @phan-suppress PhanTypeExpectedObjectPropAccess
*/
function dol_clone($object, $native = 0)
function dol_clone($object, $native = 2)
{
if ($native == 0) {
// deprecated method, use the method with native = 2 instead
@ -1641,7 +1641,7 @@ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1)
/**
* Clean a string to use it as a path name. Similar to dol_sanitizeFileName but accept / and \ chars.
* Replace also '--' and ' -' strings, they are used for parameters separation (Note: ' - ' is allowed).
* Replace also '--' and ' -' strings, they are used for parameters separation (Note: ' - ' and 'x-y' is allowed).
*
* @param string $str String to clean
* @param string $newstr String to replace bad chars with

View file

@ -28,7 +28,7 @@
* \brief File of class to build ODT documents for assets
*/
require_once DOL_DOCUMENT_ROOT . '/asset/core/modules/asset/modules_asset.php';
require_once DOL_DOCUMENT_ROOT . '/core/modules/asset/modules_asset.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';

View file

@ -33,7 +33,7 @@
* \brief File of class to generate document from standard template
*/
require_once DOL_DOCUMENT_ROOT . '/asset/core/modules/asset/modules_asset.php';
require_once DOL_DOCUMENT_ROOT . '/core/modules/asset/modules_asset.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';

View file

@ -2,8 +2,8 @@
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2022-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2022 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -10,6 +10,7 @@
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Nick Fragoulis
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 Éric Seigne <eric.seigne@cap-rel.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
@ -162,7 +163,7 @@ class pdf_strato extends ModelePDFContract
$outputlangs->loadLangs(array("main", "dict", "companies", "contracts", "compta"));
// Show Draft Watermark
if ($object->statut == $object::STATUS_DRAFT && (getDolGlobalString('CONTRACT_DRAFT_WATERMARK'))) {
if ($object->status == $object::STATUS_DRAFT && (getDolGlobalString('CONTRACT_DRAFT_WATERMARK'))) {
$this->watermark = getDolGlobalString('CONTRACT_DRAFT_WATERMARK');
}
@ -268,11 +269,24 @@ class pdf_strato extends ModelePDFContract
$tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10);
// Display notes
if (!empty($object->note_public)) {
$notetoshow = empty($object->note_public) ? '' : $object->note_public;
// Extrafields in note
$extranote = $this->getExtrafieldsInHtml($object, $outputlangs);
if (!empty($extranote)) {
$notetoshow = dol_concatdesc($notetoshow, $extranote);
}
if (!empty($notetoshow)) {
$tab_top -= 2;
$substitutionarray = pdf_getSubstitutionArray($outputlangs, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
$notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($object->note_public), 0, 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
$height_note = $nexY - $tab_top;
@ -658,7 +672,7 @@ class pdf_strato extends ModelePDFContract
$pdf->SetTextColor(0, 0, 60);
$title = $outputlangs->transnoentities($titlekey);
$title .= ' '.$outputlangs->convToOutputCharset($object->ref);
if ($object->statut == $object::STATUS_DRAFT) {
if ($object->status == $object::STATUS_DRAFT) {
$pdf->SetTextColor(128, 0, 0);
$title .= ' - '.$outputlangs->transnoentities("NotValidated");
}

View file

@ -796,10 +796,17 @@ class pdf_crabe extends ModelePDFFactures
}
$this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete
$vatcode = $object->lines[$i]->vat_src_code;
if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) {
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0;
if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) {
$this->tva_array[$vatrate . ($vatcode ? ' (' . $vatcode . ')' : '')]['tot_ht'] = 0;
}
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne, 'tot_ht'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] + $object->lines[$i]->total_ht);
} else {
if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) {
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0;
}
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
}
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
if ($posYAfterImage > $posYAfterDescription) {
$nexY = $posYAfterImage;
@ -1161,6 +1168,65 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('', '', $default_font_size - 1);
krsort($this->tva_array);
// Show VAT details
if ($object->total_tva != 0 && getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
$pdf->SetFillColor(224, 224, 224);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("VAT");
$pdf->MultiCell(25, 4, $titre, 0, 'L', true);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 25, $posy);
$titre = $outputlangs->transnoentities("NetTotal");
$pdf->MultiCell(25, 4, $titre, 0, 'L', true);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 50, $posy);
$titre = $outputlangs->transnoentities("VATAmount");
$pdf->MultiCell(25, 4, $titre, 0, 'L', true);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 75, $posy);
$titre = $outputlangs->transnoentities("AmountTotal");
$pdf->MultiCell(25, 4, $titre, 0, 'L', true);
$posy = $pdf->GetY();
$tot_ht = 0;
$tot_tva = 0;
$tot_ttc = 0;
foreach ($this->tva_array as $tvakey => $tvaval) {
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = round((float) $tvakey, 2) . "%";
$pdf->MultiCell(25, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 25, $posy);
$titre = price($tvaval['tot_ht']);
$pdf->MultiCell(25, 4, $titre, 0, 'L');
$tot_ht += $tvaval['tot_ht'];
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 50, $posy);
$titre = price($tvaval['amount']);
$pdf->MultiCell(25, 4, $titre, 0, 'L');
$tot_tva += $tvaval['amount'];
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 75, $posy);
$titre = price($tvaval['tot_ht'] + $tvaval['amount']);
$pdf->MultiCell(25, 4, $titre, 0, 'L');
$tot_ttc += ($tvaval['tot_ht'] + $tvaval['amount']);
$posy = $pdf->GetY();
}
}
// If France, show VAT mention if not applicable
if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) {
$pdf->SetFont('', 'B', $default_font_size - 2);
@ -1456,6 +1522,16 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', 1);
if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
$index++;
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_tva), 0, 'R', 1);
}
// Show VAT by rates and total
$pdf->SetFillColor(248, 248, 248);
@ -1542,34 +1618,35 @@ class pdf_crabe extends ModelePDFFactures
}
}
// VAT
foreach ($this->tva_array as $tvakey => $tvaval) {
if ($tvakey != 0) { // On affiche pas taux 0
$this->atleastoneratenotnull++;
if (!getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
// VAT
foreach ($this->tva_array as $tvakey => $tvaval) {
if ($tvakey != 0) { // On affiche pas taux 0
$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = '';
if (preg_match('/\*/', $tvakey)) {
$tvakey = str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
$tvacompl = '';
if (preg_match('/\*/', $tvakey)) {
$tvakey = str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : '');
$totalvat .= ' ';
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
$totalvat .= vatrate($tvaval['vatrate'], true).$tvacompl;
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
$totalvat .= $tvaval['vatcode'].$tvacompl;
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
$totalvat .= $tvacompl;
} else {
$totalvat .= vatrate($tvaval['vatrate'], true).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
}
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', 1);
}
$totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : '');
$totalvat .= ' ';
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
$totalvat .= vatrate($tvaval['vatrate'], true).$tvacompl;
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
$totalvat .= $tvaval['vatcode'].$tvacompl;
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
$totalvat .= $tvacompl;
} else {
$totalvat .= vatrate($tvaval['vatrate'], true).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
}
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', 1);
}
}
@ -2232,7 +2309,7 @@ class pdf_crabe extends ModelePDFFactures
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
$pdf->MultiCell($widthrecbox - 2, 4, $carac_client, 0, $ltrdirection);
// Show shipping address
// Show shipping/delivery address
if (getDolGlobalInt('INVOICE_SHOW_SHIPPING_ADDRESS')) {
$idaddressshipping = $object->getIdContact('external', 'SHIPPING');

View file

@ -1042,10 +1042,17 @@ class pdf_octopus extends ModelePDFFactures
}
$this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete
$vatcode = $object->lines[$i]->vat_src_code;
if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) {
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0;
if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) {
$this->tva_array[$vatrate . ($vatcode ? ' (' . $vatcode . ')' : '')]['tot_ht'] = 0;
}
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne, 'tot_ht'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] + $object->lines[$i]->total_ht);
} else {
if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) {
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0;
}
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
}
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
$nexY = max($nexY, $posYAfterImage);
@ -1328,6 +1335,65 @@ class pdf_octopus extends ModelePDFFactures
$pdf->SetFont('', '', $default_font_size - 1);
krsort($this->tva_array);
// Show VAT details
if ($object->total_tva != 0 && getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
$pdf->SetFillColor(224, 224, 224);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("VAT");
$pdf->MultiCell(25, 4, $titre, 0, 'L', true);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 25, $posy);
$titre = $outputlangs->transnoentities("NetTotal");
$pdf->MultiCell(25, 4, $titre, 0, 'L', true);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 50, $posy);
$titre = $outputlangs->transnoentities("VATAmount");
$pdf->MultiCell(25, 4, $titre, 0, 'L', true);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 75, $posy);
$titre = $outputlangs->transnoentities("AmountTotal");
$pdf->MultiCell(25, 4, $titre, 0, 'L', true);
$posy = $pdf->GetY();
$tot_ht = 0;
$tot_tva = 0;
$tot_ttc = 0;
foreach ($this->tva_array as $tvakey => $tvaval) {
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = round((float) $tvakey, 2) . "%";
$pdf->MultiCell(25, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 25, $posy);
$titre = price($tvaval['tot_ht']);
$pdf->MultiCell(25, 4, $titre, 0, 'L');
$tot_ht += $tvaval['tot_ht'];
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 50, $posy);
$titre = price($tvaval['amount']);
$pdf->MultiCell(25, 4, $titre, 0, 'L');
$tot_tva += $tvaval['amount'];
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 75, $posy);
$titre = price($tvaval['tot_ht'] + $tvaval['amount']);
$pdf->MultiCell(25, 4, $titre, 0, 'L');
$tot_ttc += ($tvaval['tot_ht'] + $tvaval['amount']);
$posy = $pdf->GetY();
}
}
// If France, show VAT mention if not applicable
if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) {
$pdf->SetFont('', 'B', $default_font_size - 2);
@ -1617,6 +1683,16 @@ class pdf_octopus extends ModelePDFFactures
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht - $remise, 0, $outputlangs), 0, 'R', 1);
}
if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
$index++;
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_tva), 0, 'R', 1);
}
// Show VAT by rates and total
$pdf->SetFillColor(248, 248, 248);
@ -1704,49 +1780,51 @@ class pdf_octopus extends ModelePDFFactures
}
//}
// VAT
$tvas = array();
$nblines = count($object->lines);
for ($i = 0; $i < $nblines; $i++) {
$tvaligne = $object->lines[$i]->total_tva;
$vatrate = (string) $object->lines[$i]->tva_tx;
if (!getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
// VAT
$tvas = array();
$nblines = count($object->lines);
for ($i = 0; $i < $nblines; $i++) {
$tvaligne = $object->lines[$i]->total_tva;
$vatrate = (string) $object->lines[$i]->tva_tx;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) {
$vatrate .= '*';
}
if (! isset($tvas[$vatrate])) {
$tvas[$vatrate] = 0;
}
$tvas[$vatrate] += $tvaligne;
}
foreach ($tvas as $tvakey => $tvaval) {
if ($tvakey != 0) { // On affiche pas taux 0
$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = '';
if (preg_match('/\*/', $tvakey)) {
$tvakey = str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
if (($object->lines[$i]->info_bits & 0x01) == 0x01) {
$vatrate .= '*';
}
$totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : '');
$totalvat .= ' ';
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
$totalvat .= $tvaval['vatcode'].$tvacompl;
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
$totalvat .= $tvacompl;
} else {
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
if (! isset($tvas[$vatrate])) {
$tvas[$vatrate] = 0;
}
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$tvas[$vatrate] += $tvaligne;
}
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', 1);
foreach ($tvas as $tvakey => $tvaval) {
if ($tvakey != 0) { // On affiche pas taux 0
$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = '';
if (preg_match('/\*/', $tvakey)) {
$tvakey = str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : '');
$totalvat .= ' ';
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
$totalvat .= $tvaval['vatcode'].$tvacompl;
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
$totalvat .= $tvacompl;
} else {
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
}
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', 1);
}
}
}
@ -2397,7 +2475,7 @@ class pdf_octopus extends ModelePDFFactures
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
$pdf->MultiCell($widthrecbox - 2, 4, $carac_client, 0, $ltrdirection);
// Show shipping address
// Show shipping/delivery address
if (getDolGlobalInt('INVOICE_SHOW_SHIPPING_ADDRESS')) {
$idaddressshipping = $object->getIdContact('external', 'SHIPPING');

View file

@ -1,18 +1,19 @@
<?php
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2021-2024 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2022-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Nick Fragoulis
/* Copyright (C) 2004-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2018-2024 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2022-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Nick Fragoulis
* Copyright (C) 2024 Franck Moreau
*
* 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
@ -961,10 +962,17 @@ class pdf_sponge extends ModelePDFFactures
}
$this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete
$vatcode = $object->lines[$i]->vat_src_code;
if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) {
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0;
if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) {
$this->tva_array[$vatrate . ($vatcode ? ' (' . $vatcode . ')' : '')]['tot_ht'] = 0;
}
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne, 'tot_ht'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] + $object->lines[$i]->total_ht);
} else {
if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) {
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0;
}
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
}
$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne);
$nexY = max($nexY, $posYAfterImage);
@ -1260,6 +1268,65 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetFont('', '', $default_font_size - 1);
krsort($this->tva_array);
// Show VAT details
if ($object->total_tva != 0 && getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
$pdf->SetFillColor(224, 224, 224);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("VAT");
$pdf->MultiCell(25, 4, $titre, 0, 'L', true);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 25, $posy);
$titre = $outputlangs->transnoentities("NetTotal");
$pdf->MultiCell(25, 4, $titre, 0, 'L', true);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 50, $posy);
$titre = $outputlangs->transnoentities("VATAmount");
$pdf->MultiCell(25, 4, $titre, 0, 'L', true);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 75, $posy);
$titre = $outputlangs->transnoentities("AmountTotal");
$pdf->MultiCell(25, 4, $titre, 0, 'L', true);
$posy = $pdf->GetY();
$tot_ht = 0;
$tot_tva = 0;
$tot_ttc = 0;
foreach ($this->tva_array as $tvakey => $tvaval) {
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = round((float) $tvakey, 2) . "%";
$pdf->MultiCell(25, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 25, $posy);
$titre = price($tvaval['tot_ht']);
$pdf->MultiCell(25, 4, $titre, 0, 'L');
$tot_ht += $tvaval['tot_ht'];
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 50, $posy);
$titre = price($tvaval['amount']);
$pdf->MultiCell(25, 4, $titre, 0, 'L');
$tot_tva += $tvaval['amount'];
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche + 75, $posy);
$titre = price($tvaval['tot_ht'] + $tvaval['amount']);
$pdf->MultiCell(25, 4, $titre, 0, 'L');
$tot_ttc += ($tvaval['tot_ht'] + $tvaval['amount']);
$posy = $pdf->GetY();
}
}
// If France, show VAT mention if not applicable
if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) {
$pdf->SetFont('', '', $default_font_size - 2);
@ -1711,6 +1778,16 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', 1);
if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
$index++;
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_tva), 0, 'R', 1);
}
// Show VAT by rates and total
$pdf->SetFillColor(248, 248, 248);
@ -1821,34 +1898,36 @@ class pdf_sponge extends ModelePDFFactures
}
}
// VAT
foreach ($this->tva_array as $tvakey => $tvaval) {
if ($tvakey != 0) { // On affiche pas taux 0
$this->atleastoneratenotnull++;
if (!getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
// VAT
foreach ($this->tva_array as $tvakey => $tvaval) {
if ($tvakey != 0) { // On affiche pas taux 0
$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = '';
if (preg_match('/\*/', $tvakey)) {
$tvakey = str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
$tvacompl = '';
if (preg_match('/\*/', $tvakey)) {
$tvakey = str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : '');
$totalvat .= ' ';
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
$totalvat .= $tvaval['vatcode'].$tvacompl;
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
$totalvat .= $tvacompl;
} else {
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
}
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', 1);
}
$totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : '');
$totalvat .= ' ';
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
$totalvat .= $tvaval['vatcode'].$tvacompl;
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
$totalvat .= $tvacompl;
} else {
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
}
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', 1);
}
}
@ -2479,7 +2558,7 @@ class pdf_sponge extends ModelePDFFactures
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
$pdf->MultiCell($widthrecbox - 2, 4, $carac_client, 0, $ltrdirection);
// Show shipping address
// Show shipping/delivery address
if (getDolGlobalInt('INVOICE_SHOW_SHIPPING_ADDRESS')) {
$idaddressshipping = $object->getIdContact('external', 'SHIPPING');

View file

@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.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
@ -123,9 +124,9 @@ abstract class ModelePDFFactures extends CommonDocGenerator
// Load the autoload file generated by composer
if (file_exists(DOL_DOCUMENT_ROOT.'/includes/sprain/swiss-qr-bill/autoload.php')) {
require_once DOL_DOCUMENT_ROOT.'/includes/sprain/swiss-qr-bill/autoload.php';
require_once DOL_DOCUMENT_ROOT.'/includes/sprain/swiss-qr-bill/autoload.php'; // @phpstan-ignore-line
} elseif (file_exists(DOL_DOCUMENT_ROOT.'/includes/autoload.php')) {
require_once DOL_DOCUMENT_ROOT.'/includes/autoload.php';
require_once DOL_DOCUMENT_ROOT.'/includes/autoload.php'; // @phpstan-ignore-line
} else {
$this->error = 'PHP library sprain/swiss-qr-bill was not found. Please install it with:<br>cd '.dirname(DOL_DOCUMENT_ROOT).'; cp composer.json.disabled composer.json; composer require sprain/swiss-qr-bill;';
return false;

View file

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This file is an example to follow to add your own email selector inside
* the Dolibarr email tool.
@ -26,11 +27,24 @@ include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
*/
class mailing_advthirdparties extends MailingTargets
{
/**
* @var string name of mailing module
*/
public $name = 'ThirdPartyAdvancedTargeting';
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
/**
* @var string This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
*/
public $desc = "Third parties";
/**
* @var int
*/
public $require_admin = 0;
/**
* @var string[]
*/
public $require_module = array("none"); // This module should not be displayed as Selector in mailing
/**
@ -38,6 +52,9 @@ class mailing_advthirdparties extends MailingTargets
*/
public $picto = 'company';
/**
* @var string condition to enable module
*/
public $enabled = 'isModEnabled("societe")';

View file

@ -3,6 +3,7 @@
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -39,6 +40,9 @@ class mailing_contacts1 extends MailingTargets
public $require_module = array("societe"); // Module mailing actif si modules require_module actifs
public $require_admin = 0; // Module mailing actif pour user admin ou non
/**
* @var string condition to enable module
*/
public $enabled = 'isModEnabled("societe")';
/**

View file

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2018-2018 Andre Schild <a.schild@aarboard.ch>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2018-2018 Andre Schild <a.schild@aarboard.ch>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This file is an example to follow to add your own email selector inside
* the Dolibarr email tool.
@ -31,15 +32,24 @@ class mailing_eventorganization extends MailingTargets
public $name = 'AttendeesOfOrganizedEvent';
public $desc = "Attendees of an organized event";
/**
* @var int
*/
public $require_admin = 0;
public $require_module = array(); // This module allows to select by categories must be also enabled if category module is not activated
/**
* @var string[] This module allows to select by categories must be also enabled if category module is not activated
*/
public $require_module = array();
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'conferenceorbooth';
/**
* @var string condition to enable module
*/
public $enabled = 'isModEnabled("eventorganization")';

View file

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -42,6 +42,9 @@ class mailing_fraise extends MailingTargets
public $require_module = array('adherent');
/**
* @var string condition to enable module
*/
public $enabled = 'isModEnabled("member")';
/**

Some files were not shown because too many files have changed in this diff Show more