Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2026-05-12 03:13:50 +02:00
commit 3973b28d34
38 changed files with 350 additions and 722 deletions

View file

@ -26,6 +26,7 @@ The following behaviors are expected and requested of all community members:
* Refrain from demeaning, discriminatory, or harassing behavior and speech.
* Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential.
* Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations.
* Using English language in all communication (even "bad english", or auto translated english, is better than any other language).
## 4. Unacceptable Behavior
@ -42,6 +43,7 @@ The following behaviors are considered harassment and are unacceptable within ou
* Deliberate intimidation, stalking or following (online or in person).
* Advocating for, or encouraging, any of the above behavior.
* Sustained disruption of community events, including talks and presentations.
* Publishing message repeatdly with links to external site orvideos that are not related to the subject of the discussion.
## 5. Consequences of Unacceptable Behavior
@ -82,3 +84,6 @@ This Code of Conduct is distributed under a [Creative Commons Attribution-ShareA
Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](https://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy).
Retrieved on November 22, 2016 from [https://citizencodeofconduct.org/](http://citizencodeofconduct.org/)
Enhanced for Dolibarr project.

60
.github/workflows/moderation.yml vendored Normal file
View file

@ -0,0 +1,60 @@
# Github action to experiment automatic moderation
name: Moderation Bot
on:
issue_comment:
types: [created, edited]
pull_request_review_comment:
types: [created, edited]
permissions:
issues: write
pull-requests: write
jobs:
moderate:
runs-on: ubuntu-latest
steps:
- name: Moderate comments
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const franc = require('franc')
const comment = context.payload.comment.body || ''
const lower = comment.toLowerCase()
// Détection YouTube Music
const forbiddenPatterns = [
'music.youtube.com',
'youtu.be',
'youtube.com/watch'
]
const hasYoutubeMusic = forbiddenPatterns.some(p => lower.includes(p))
// Détection langue
let isEnglish = true
try {
const lang = franc(comment)
isEnglish = lang === 'eng'
} catch (e) {
console.log('Language detection failed:', e)
}
console.log('Detected language:', isEnglish ? 'english' : 'not english')
#if (hasYoutubeMusic || !isEnglish) {
if (hasYoutubeMusic) {
console.log('Deleting comment...')
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id
})
}

View file

@ -30,6 +30,10 @@ if (!defined("NOSESSION")) {
if (!defined("NOHTTPSREDIRECT")) {
define("NOHTTPSREDIRECT", '1');
}
if (!defined('MAIN_VERSION_DISABLE_DB_CHECK')) {
define("MAIN_VERSION_DISABLE_DB_CHECK", '1');
}
/**
* @var Conf $conf

View file

@ -2040,90 +2040,6 @@ parameters:
count: 1
path: ../../../htdocs/compta/index.php
-
message: '#^Variable \$total_ht might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/index.php
-
message: '#^Variable \$total_ttc might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/index.php
-
message: '#^Variable \$tabcompany might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/compta/journal/purchasesjournal.php
-
message: '#^Variable \$tabht might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/journal/purchasesjournal.php
-
message: '#^Variable \$tablocaltax1 might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/journal/purchasesjournal.php
-
message: '#^Variable \$tablocaltax2 might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/journal/purchasesjournal.php
-
message: '#^Variable \$tabttc might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/journal/purchasesjournal.php
-
message: '#^Variable \$tabtva might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/journal/purchasesjournal.php
-
message: '#^Variable \$tabcompany might not be defined\.$#'
identifier: variable.undefined
count: 3
path: ../../../htdocs/compta/journal/sellsjournal.php
-
message: '#^Variable \$tabht might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/journal/sellsjournal.php
-
message: '#^Variable \$tablocaltax1 might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/journal/sellsjournal.php
-
message: '#^Variable \$tablocaltax2 might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/journal/sellsjournal.php
-
message: '#^Variable \$tabttc might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/journal/sellsjournal.php
-
message: '#^Variable \$tabtva might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/journal/sellsjournal.php
-
message: '#^Variable \$morehtmlref might not be defined\.$#'
identifier: variable.undefined
@ -2196,12 +2112,6 @@ parameters:
count: 2
path: ../../../htdocs/compta/paiement.php
-
message: '#^Variable \$marginInfo might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/paiement/card.php
-
message: '#^Ternary operator condition is always false\.$#'
identifier: ternary.alwaysFalse
@ -2346,54 +2256,18 @@ parameters:
count: 1
path: ../../../htdocs/compta/resultat/clientfourn.php
-
message: '#^Variable \$description might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/resultat/clientfourn.php
-
message: '#^Variable \$sql might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/resultat/clientfourn.php
-
message: '#^Variable \$annee might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/resultat/index.php
-
message: '#^Variable \$description might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/resultat/index.php
-
message: '#^Call to function is_array\(\) with non\-empty\-array\<array\{NP\: mixed, N\?\: \(float\|int\), M\?\: non\-empty\-array\<0\|1\|2\|3\|4\|5\|6\|7\|8\|9\|10\|11, mixed\>\}\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../htdocs/compta/resultat/result.php
-
message: '#^Ternary operator condition is always false\.$#'
identifier: ternary.alwaysFalse
count: 1
path: ../../../htdocs/compta/resultat/result.php
-
message: '#^Variable \$code might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/compta/resultat/result.php
-
message: '#^Variable \$description might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/resultat/result.php
-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
@ -2466,36 +2340,18 @@ parameters:
count: 1
path: ../../../htdocs/compta/stats/cabyuser.php
-
message: '#^Variable \$sql might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/stats/cabyuser.php
-
message: '#^Ternary operator condition is always false\.$#'
identifier: ternary.alwaysFalse
count: 1
path: ../../../htdocs/compta/stats/casoc.php
-
message: '#^Variable \$sql might not be defined\.$#'
identifier: variable.undefined
count: 5
path: ../../../htdocs/compta/stats/casoc.php
-
message: '#^Ternary operator condition is always false\.$#'
identifier: ternary.alwaysFalse
count: 1
path: ../../../htdocs/compta/stats/index.php
-
message: '#^Variable \$sql might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/stats/index.php
-
message: '#^Loose comparison using \=\= between ''BOOKKEEPINGCOLLECTED''\|''RECETTES\-DEPENSES'' and ''RECETTES\-DEPENSES'' will always evaluate to true\.$#'
identifier: equal.alwaysTrue
@ -2514,12 +2370,6 @@ parameters:
count: 1
path: ../../../htdocs/compta/stats/supplier_turnover.php
-
message: '#^Variable \$sql might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/compta/stats/supplier_turnover.php
-
message: '#^Ternary operator condition is always false\.$#'
identifier: ternary.alwaysFalse
@ -2532,12 +2382,6 @@ parameters:
count: 1
path: ../../../htdocs/compta/stats/supplier_turnover_by_thirdparty.php
-
message: '#^Variable \$sql might not be defined\.$#'
identifier: variable.undefined
count: 5
path: ../../../htdocs/compta/stats/supplier_turnover_by_thirdparty.php
-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
@ -2604,30 +2448,12 @@ parameters:
count: 1
path: ../../../htdocs/compta/tva/index.php
-
message: '#^Variable \$date_end might not be defined\.$#'
identifier: variable.undefined
count: 4
path: ../../../htdocs/compta/tva/index.php
-
message: '#^Variable \$date_start might not be defined\.$#'
identifier: variable.undefined
count: 4
path: ../../../htdocs/compta/tva/index.php
-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
count: 2
path: ../../../htdocs/compta/tva/payments.php
-
message: '#^Variable \$num might not be defined\.$#'
identifier: variable.undefined
count: 3
path: ../../../htdocs/compta/tva/payments.php
-
message: '#^Call to function is_array\(\) with list\<array\{id\: mixed, descr\: mixed, pid\: mixed, pref\: mixed, ptype\: mixed, payment_id\: mixed, payment_ref\: mixed, payment_amount\: mixed, \.\.\.\}\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -2640,12 +2466,6 @@ parameters:
count: 1
path: ../../../htdocs/contact/ajax/contact.php
-
message: '#^Variable \$action might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/contact/ajax/contact.php
-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
@ -2766,36 +2586,6 @@ parameters:
count: 1
path: ../../../htdocs/core/actions_builddoc.inc.php
-
message: '#^Variable \$action might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/core/actions_comments.inc.php
-
message: '#^Variable \$id might not be defined\.$#'
identifier: variable.undefined
count: 3
path: ../../../htdocs/core/actions_comments.inc.php
-
message: '#^Variable \$idcomment might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/core/actions_comments.inc.php
-
message: '#^Variable \$withproject might not be defined\.$#'
identifier: variable.undefined
count: 3
path: ../../../htdocs/core/actions_comments.inc.php
-
message: '#^Variable \$id might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/core/actions_dellink.inc.php
-
message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -2844,12 +2634,6 @@ parameters:
count: 1
path: ../../../htdocs/core/actions_massactions.inc.php
-
message: '#^Variable \$classfile might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/actions_printing.inc.php
-
message: '#^Call to function is_array\(\) with list\<mixed\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -3318,12 +3102,6 @@ parameters:
count: 1
path: ../../../htdocs/core/class/fileupload.class.php
-
message: '#^Variable \$object might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/class/fileupload.class.php
-
message: '#^Call to function is_array\(\) with non\-empty\-array will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -3390,12 +3168,6 @@ parameters:
count: 8
path: ../../../htdocs/core/class/html.form.class.php
-
message: '#^Variable \$select_encoder might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/class/html.formbarcode.class.php
-
message: '#^Call to function is_array\(\) with non\-empty\-array will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -3414,12 +3186,6 @@ parameters:
count: 1
path: ../../../htdocs/core/class/html.formcompany.class.php
-
message: '#^Variable \$idprof might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/class/html.formcompany.class.php
-
message: '#^Call to function is_array\(\) with array\<Link\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -3486,12 +3252,6 @@ parameters:
count: 1
path: ../../../htdocs/core/class/html.formother.class.php
-
message: '#^Variable \$labeltoshow might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/class/html.formprojet.class.php
-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
@ -3804,12 +3564,6 @@ parameters:
count: 3
path: ../../../htdocs/core/class/utils.class.php
-
message: '#^Variable \$moduleobj might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/class/utils.class.php
-
message: '#^Parameter \#1 \$table of static method Diff\:\:generatePartialDiff\(\) expects array\<array\{string, int\<0, 2\>\}\>, array\<array\<int\>\> given\.$#'
identifier: argument.type
@ -3840,24 +3594,6 @@ parameters:
count: 2
path: ../../../htdocs/core/customreports.php
-
message: '#^Variable \$page might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/customreports.php
-
message: '#^Variable \$sortfield might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/customreports.php
-
message: '#^Variable \$sortorder might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/customreports.php
-
message: '#^Property DoliDBMysqli\:\:\$db \(mysqli\) in empty\(\) is not falsy\.$#'
identifier: empty.property
@ -3954,12 +3690,6 @@ parameters:
count: 1
path: ../../../htdocs/core/lib/admin.lib.php
-
message: '#^Variable \$resarray might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/core/lib/admin.lib.php
-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
@ -5328,12 +5058,6 @@ parameters:
count: 1
path: ../../../htdocs/expedition/shipment.php
-
message: '#^Variable \$socid might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/expedition/stats/month.php
-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
@ -5496,12 +5220,6 @@ parameters:
count: 10
path: ../../../htdocs/fourn/card.php
-
message: '#^Variable \$contact might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/fourn/class/api_supplier_orders.class.php
-
message: '#^Call to function method_exists\(\) with \$this\(CommandeFournisseur\) and ''getLibStatut'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -6060,12 +5778,6 @@ parameters:
count: 1
path: ../../../htdocs/hrm/lib/hrm_evaluation.lib.php
-
message: '#^Variable \$job might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/hrm/position.php
-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
@ -6090,24 +5802,12 @@ parameters:
count: 2
path: ../../../htdocs/hrm/skill_card.php
-
message: '#^Variable \$result might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/hrm/skill_card.php
-
message: '#^Call to function is_array\(\) with list will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 2
path: ../../../htdocs/hrm/skill_tab.php
-
message: '#^Variable \$object might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/hrm/skill_tab.php
-
message: '#^Ternary operator condition is always true\.$#'
identifier: ternary.alwaysTrue
@ -6324,12 +6024,6 @@ parameters:
count: 1
path: ../../../htdocs/index.php
-
message: '#^Variable \$boxwork might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/index.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
@ -6486,12 +6180,6 @@ parameters:
count: 1
path: ../../../htdocs/loan/payment/payment.php
-
message: '#^Variable \$result might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/loan/schedule.php
-
message: '#^Call to function is_array\(\) with array\<mixed\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -6606,30 +6294,6 @@ parameters:
count: 3
path: ../../../htdocs/modulebuilder/index.php
-
message: '#^Variable \$class might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/modulebuilder/index.php
-
message: '#^Variable \$moduleobj might not be defined\.$#'
identifier: variable.undefined
count: 4
path: ../../../htdocs/modulebuilder/index.php
-
message: '#^Variable \$object might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/modulebuilder/index.php
-
message: '#^Variable \$outputfilezip might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/modulebuilder/index.php
-
message: '#^Variable \$proparrayofkeyval in isset\(\) always exists and is not nullable\.$#'
identifier: isset.variable
@ -7266,12 +6930,6 @@ parameters:
count: 6
path: ../../../htdocs/printing/admin/printing.php
-
message: '#^Variable \$classfile might not be defined\.$#'
identifier: variable.undefined
count: 3
path: ../../../htdocs/printing/admin/printing.php
-
message: '#^Result of \|\| is always true\.$#'
identifier: booleanOr.alwaysTrue
@ -7638,12 +7296,6 @@ parameters:
count: 1
path: ../../../htdocs/product/stock/massstockmove.php
-
message: '#^Variable \$producttmp might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/product/stock/massstockmove.php
-
message: '#^Loose comparison using \=\= between 1 and 2 will always evaluate to false\.$#'
identifier: equal.alwaysFalse
@ -7704,12 +7356,6 @@ parameters:
count: 1
path: ../../../htdocs/product/stock/replenish.php
-
message: '#^Variable \$id might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/product/stock/replenish.php
-
message: '#^Call to function property_exists\(\) with \$this\(StockTransfer\) and ''socid'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -7806,12 +7452,6 @@ parameters:
count: 4
path: ../../../htdocs/projet/activity/perweek.php
-
message: '#^Variable \$res might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/projet/admin/project.php
-
message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -7962,48 +7602,12 @@ parameters:
count: 1
path: ../../../htdocs/projet/element.php
-
message: '#^Variable \$dateformat might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/projet/ganttchart.inc.php
-
message: '#^Variable \$dateformatinput might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/projet/ganttchart.inc.php
-
message: '#^Variable \$datehourformat might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/projet/ganttchart.inc.php
-
message: '#^Variable \$task_dependencies might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/projet/ganttchart.inc.php
-
message: '#^Variable \$tasks might not be defined\.$#'
identifier: variable.undefined
count: 5
path: ../../../htdocs/projet/ganttchart.inc.php
-
message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../htdocs/projet/ganttview.php
-
message: '#^Variable \$param might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/projet/ganttview.php
-
message: '#^Comparison operation "\>" between 0 and 0 is always false\.$#'
identifier: greater.alwaysFalse
@ -8058,18 +7662,6 @@ parameters:
count: 3
path: ../../../htdocs/projet/list.php
-
message: '#^Variable \$permissiontoadd might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/projet/list.php
-
message: '#^Variable \$permissiontoread might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/projet/list.php
-
message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -8100,18 +7692,6 @@ parameters:
count: 1
path: ../../../htdocs/projet/tasks.php
-
message: '#^Variable \$massactionbutton might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/projet/tasks.php
-
message: '#^Variable \$permissiontodelete might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/projet/tasks.php
-
message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -8988,30 +8568,6 @@ parameters:
count: 1
path: ../../../htdocs/reception/class/reception.class.php
-
message: '#^Variable \$mesgs might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/reception/contact.php
-
message: '#^Variable \$objectsrc might not be defined\.$#'
identifier: variable.undefined
count: 6
path: ../../../htdocs/reception/contact.php
-
message: '#^Variable \$result might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/reception/contact.php
-
message: '#^Variable \$origin might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/reception/document.php
-
message: '#^Call to function method_exists\(\) with Reception and ''fetch_lines'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -9030,12 +8586,6 @@ parameters:
count: 2
path: ../../../htdocs/recruitment/admin/setup.php
-
message: '#^Variable \$res might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/recruitment/admin/setup.php
-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
@ -9048,12 +8598,6 @@ parameters:
count: 1
path: ../../../htdocs/recruitment/admin/setup_candidatures.php
-
message: '#^Variable \$res might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/recruitment/admin/setup_candidatures.php
-
message: '#^Left side of && is always false\.$#'
identifier: booleanAnd.leftAlwaysFalse
@ -9174,24 +8718,12 @@ parameters:
count: 2
path: ../../../htdocs/recruitment/recruitmentcandidature_card.php
-
message: '#^Variable \$text might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/recruitment/recruitmentcandidature_card.php
-
message: '#^Variable \$maxlength might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/recruitment/recruitmentcandidature_list.php
-
message: '#^Variable \$lineid might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/recruitment/recruitmentjobposition_applications.php
-
message: '#^Variable \$maxlength might not be defined\.$#'
identifier: variable.undefined
@ -9294,12 +8826,6 @@ parameters:
count: 1
path: ../../../htdocs/salaries/payments.php
-
message: '#^Variable \$resql might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/salaries/payments.php
-
message: '#^Loose comparison using \=\= between ''salaire'' and ''bank\-transfer'' will always evaluate to false\.$#'
identifier: equal.alwaysFalse
@ -9432,18 +8958,6 @@ parameters:
count: 1
path: ../../../htdocs/societe/consumption.php
-
message: '#^Variable \$sql might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/societe/consumption.php
-
message: '#^Variable \$where might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/societe/consumption.php
-
message: '#^Call to function is_object\(\) with Societe will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -9480,12 +8994,6 @@ parameters:
count: 1
path: ../../../htdocs/societe/paymentmodes.php
-
message: '#^Variable \$service might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/societe/paymentmodes.php
-
message: '#^Loose comparison using \=\= between ''add_customer_price'' and ''add_customer_price'' will always evaluate to true\.$#'
identifier: equal.alwaysTrue
@ -9504,12 +9012,6 @@ parameters:
count: 2
path: ../../../htdocs/societe/price.php
-
message: '#^Variable \$massaction might not be defined\.$#'
identifier: variable.undefined
count: 4
path: ../../../htdocs/societe/website.php
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
@ -9528,12 +9030,6 @@ parameters:
count: 1
path: ../../../htdocs/stripe/charge.php
-
message: '#^Variable \$type might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/stripe/charge.php
-
message: '#^Loose comparison using \=\= between 7 and 4 will always evaluate to false\.$#'
identifier: equal.alwaysFalse
@ -9570,30 +9066,12 @@ parameters:
count: 1
path: ../../../htdocs/supplier_proposal/card.php
-
message: '#^Variable \$buyingprice might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/supplier_proposal/card.php
-
message: '#^Variable \$classname might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/supplier_proposal/card.php
-
message: '#^Variable \$fk_account might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/supplier_proposal/card.php
-
message: '#^Variable \$fournprice might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/supplier_proposal/card.php
-
message: '#^Call to function method_exists\(\) with \$this\(SupplierProposal\) and ''getLibStatut'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -9642,12 +9120,6 @@ parameters:
count: 1
path: ../../../htdocs/supplier_proposal/list.php
-
message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/takepos/admin/bar.php
-
message: '#^Left side of && is always true\.$#'
identifier: booleanAnd.leftAlwaysTrue
@ -9672,18 +9144,6 @@ parameters:
count: 3
path: ../../../htdocs/takepos/freezone.php
-
message: '#^Variable \$db might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/takepos/genimg/index.php
-
message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/takepos/genimg/qr.php
-
message: '#^Property CommonObjectLine\:\:\$product \(Product\) in empty\(\) is not falsy\.$#'
identifier: empty.property
@ -9732,12 +9192,6 @@ parameters:
count: 3
path: ../../../htdocs/takepos/pay.php
-
message: '#^Variable \$user might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/takepos/printbox.php
-
message: '#^Loose comparison using \!\= between non\-empty\-string and '''' will always evaluate to true\.$#'
identifier: notEqual.alwaysTrue
@ -9780,12 +9234,6 @@ parameters:
count: 2
path: ../../../htdocs/theme/md/style.css.php
-
message: '#^Variable \$menumanager might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/theme/md/style.css.php
-
message: '#^Loose comparison using \=\= between ''setsubject'' and ''setsubject'' will always evaluate to true\.$#'
identifier: equal.alwaysTrue
@ -10014,12 +9462,6 @@ parameters:
count: 1
path: ../../../htdocs/user/notify/card.php
-
message: '#^Variable \$dolibarr_main_authentication might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/user/passwordforgotten.php
-
message: '#^Call to function is_array\(\) with array will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -10392,12 +9834,6 @@ parameters:
count: 1
path: ../../../htdocs/website/index.php
-
message: '#^Variable \$atleastonepage might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/website/index.php
-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse

View file

@ -10,7 +10,7 @@
return [
// # Issue statistics:
// PhanUndeclaredProperty : 380+ occurrences
// PhanUndeclaredGlobalVariable : 45+ occurrences
// PhanUndeclaredGlobalVariable : 40+ occurrences
// PhanTypeMismatchArgument : 35+ occurrences
// PhanTypeMismatchProperty : 20+ occurrences
// PhanTypeInvalidDimOffset : 10+ occurrences
@ -94,7 +94,6 @@ return [
'htdocs/core/modules/member/modules_cards.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanUndeclaredProperty'],
@ -109,7 +108,6 @@ return [
'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'],
'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/core/multicompany_page.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/tpl/extrafields_view.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/core/tpl/massactions_pre.tpl.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/core/tpl/passwordreset.tpl.php' => ['PhanUndeclaredGlobalVariable'],

View file

@ -2619,9 +2619,9 @@ class BookKeeping extends CommonObject
* If ACCOUNTING_LABEL_OPERATION_ON_TRANSFER is 1, we concat thirdparty name, ref.
* If ACCOUNTING_LABEL_OPERATION_ON_TRANSFER is 2, we return just thirdparty name
*
* @param string $thirdpartyname Thirdparty name
* @param string $reference Reference of the element
* @param string $labelaccount Label of the accounting account
* @param string $thirdpartyname Thirdparty name
* @param ?string $reference Reference of the element
* @param ?string $labelaccount Label of the accounting account
* @param int<0,1> $full 0=Default, 1=Keep label intact (no trunc so HTML content is not corrupted)
* @return string Label of the operation
*/

View file

@ -282,17 +282,15 @@ if ($result) {
//$line = new SupplierInvoiceLine($db);
//$line->fetch($obj->fdid);
$tabfac[$obj->rowid]["date"] = $db->jdate($obj->df);
$tabfac[$obj->rowid]["datereg"] = $db->jdate($obj->dlr);
$tabfac[$obj->rowid]["ref"] = $obj->ref_supplier.' ('.$obj->ref.')';
$tabfac[$obj->rowid]["refsologest"] = $obj->ref;
$tabfac[$obj->rowid]["refsuppliersologest"] = $obj->ref_supplier;
$tabfac[$obj->rowid]["type"] = $obj->type;
$tabfac[$obj->rowid]["description"] = $obj->description;
$tabfac[$obj->rowid]["close_code"] = $obj->close_code; // close_code = 'replaced' for replacement invoices (not used in most european countries)
//$tabfac[$obj->rowid]["fk_facturefourndet"] = $obj->fdid;
// Avoid warnings
if (!array_key_exists($obj->rowid, $tabfac)) {
$tabfac[$obj->rowid] = array();
$tabttc[$obj->rowid] = array();
$tabht[$obj->rowid] = array();
$tabtva[$obj->rowid] = array();
$tablocaltax1[$obj->rowid] = array();
$tablocaltax2[$obj->rowid] = array();
}
if (!isset($tabttc[$obj->rowid][$compta_soc])) {
$tabttc[$obj->rowid][$compta_soc] = 0;
}
@ -309,6 +307,16 @@ if ($result) {
$tablocaltax2[$obj->rowid][$compta_localtax2] = 0;
}
$tabfac[$obj->rowid]["date"] = $db->jdate($obj->df);
$tabfac[$obj->rowid]["datereg"] = $db->jdate($obj->dlr);
$tabfac[$obj->rowid]["ref"] = $obj->ref_supplier.' ('.$obj->ref.')';
$tabfac[$obj->rowid]["refsologest"] = $obj->ref;
$tabfac[$obj->rowid]["refsuppliersologest"] = $obj->ref_supplier;
$tabfac[$obj->rowid]["type"] = $obj->type;
$tabfac[$obj->rowid]["description"] = $obj->description;
$tabfac[$obj->rowid]["close_code"] = $obj->close_code; // close_code = 'replaced' for replacement invoices (not used in most european countries)
//$tabfac[$obj->rowid]["fk_facturefourndet"] = $obj->fdid;
// VAT Reverse charge
if (($mysoc->country_code == 'FR' || getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) && $obj->vat_reverse_charge == 1 && (in_array($obj->country_code, $country_code_in_EEC) || getDolGlobalString('ACCOUNTING_REVERSE_CHARGE_ALSO_NON_EEC'))) {
$rcvatdata = getTaxesFromId($obj->product_buy_vat . ($obj->product_buy_default_vat_code ? ' (' . $obj->product_buy_default_vat_code . ')' : ''), $mysoc, $mysoc, 0);
@ -325,6 +333,11 @@ if ($result) {
$def_tva[$obj->rowid][$rcd_compta_tva][$vat_key] = $val_value;
}
if (!array_key_exists($obj->rowid, $tabrctva)) {
$tabrctva[$obj->rowid] = array();
$tabrclocaltax1[$obj->rowid] = array();
$tabrclocaltax2[$obj->rowid] = array();
}
if (!isset($tabrctva[$obj->rowid][$rcc_compta_tva])) {
$tabrctva[$obj->rowid][$rcc_compta_tva] = 0;
}
@ -476,10 +489,10 @@ if ($action == 'writebookkeeping' && !$error && $user->hasRight('accounting', 'b
$invoicestatic->id = (int) $key;
$invoicestatic->ref = (string) $val["refsologest"];
$invoicestatic->ref_supplier = $val["refsuppliersologest"];
$invoicestatic->ref_supplier = (string) $val["refsuppliersologest"];
$invoicestatic->type = $val["type"];
$invoicestatic->description = html_entity_decode(dol_trunc($val["description"], 32));
$invoicestatic->close_code = $val["close_code"];
$invoicestatic->description = html_entity_decode(dol_trunc((string) $val["description"], 32));
$invoicestatic->close_code = (string) $val["close_code"];
$date = dol_print_date($val["date"], 'day');
@ -859,11 +872,11 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
$companystatic->fournisseur = 1;
$invoicestatic->id = (int) $key;
$invoicestatic->ref = $val["refsologest"];
$invoicestatic->ref_supplier = $val["refsuppliersologest"];
$invoicestatic->ref = (string) $val["refsologest"];
$invoicestatic->ref_supplier = (string) $val["refsuppliersologest"];
$invoicestatic->type = $val["type"];
$invoicestatic->description = dol_trunc(html_entity_decode($val["description"]), 32);
$invoicestatic->close_code = $val["close_code"];
$invoicestatic->description = dol_trunc(html_entity_decode((string) $val["description"]), 32);
$invoicestatic->close_code = (string) $val["close_code"];
$date = dol_print_date($val["date"], 'day');
@ -887,7 +900,7 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
//if ($mt) {
print '"'.$key.'"'.$sep;
print '"'.$date.'"'.$sep;
print '"'.$val["refsologest"].'"'.$sep;
print '"'.((string) $val["refsologest"]).'"'.$sep;
print '"'.csvClean(dol_trunc($companystatic->name, 32)).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg($companystatic->accountancy_code_supplier_general).'"'.$sep;
@ -908,7 +921,7 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
//if ($mt) {
print '"'.$key.'"'.$sep;
print '"'.$date.'"'.$sep;
print '"'.$val["refsologest"].'"'.$sep;
print '"'.((string) $val["refsologest"]).'"'.$sep;
print '"'.csvClean(dol_trunc($companystatic->name, 32)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
@ -960,7 +973,7 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
if ($mt) {
print '"'.$key.'"'.$sep;
print '"'.$date.'"'.$sep;
print '"'.$val["refsologest"].'"'.$sep;
print '"'.((string) $val["refsologest"]).'"'.$sep;
print '"'.csvClean(dol_trunc($companystatic->name, 32)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
@ -980,7 +993,7 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
if ($mt) {
print '"'.$key.'"'.$sep;
print '"'.$date.'"'.$sep;
print '"'.$val["refsologest"].'"'.$sep;
print '"'.((string) $val["refsologest"]).'"'.$sep;
print '"'.csvClean(dol_trunc($companystatic->name, 32)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
@ -1114,11 +1127,11 @@ if (empty($action) || $action == 'view') {
$companystatic->fournisseur = 1;
$invoicestatic->id = (int) $key;
$invoicestatic->ref = $val["refsologest"];
$invoicestatic->ref_supplier = $val["refsuppliersologest"];
$invoicestatic->ref = (string) $val["refsologest"];
$invoicestatic->ref_supplier = (string) $val["refsuppliersologest"];
$invoicestatic->type = $val["type"];
$invoicestatic->description = dol_trunc(html_entity_decode($val["description"]), 32);
$invoicestatic->close_code = $val["close_code"];
$invoicestatic->description = dol_trunc(html_entity_decode((string) $val["description"]), 32);
$invoicestatic->close_code = (string) $val["close_code"];
$date = dol_print_date($val["date"], 'day');

View file

@ -11,7 +11,7 @@
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2021-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Rafael San José <rsanjose@alxarafe.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -682,6 +682,7 @@ if (isModEnabled('invoice') && isModEnabled('order') && $user->hasRight("command
print '</tr>';
$tot_ht = $tot_ttc = $tot_tobill = 0;
$total_ht = $total_ttc = 0;
$societestatic = new Societe($db);
while ($i < $num) {
$obj = $db->fetch_object($resql);

View file

@ -148,6 +148,12 @@ if (in_array($db->type, array('mysql', 'mysqli'))) {
}
$tabfac = array();
$tabcompany = array();
$tabht = array();
$tabtva = array();
$tabttc = array();
$tablocaltax1 = array();
$tablocaltax2 = array();
$result = $db->query($sql);
if ($result) {
@ -156,12 +162,6 @@ if ($result) {
$cptfour = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER', $langs->trans("CodeNotDef"));
$cpttva = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT', $langs->trans("CodeNotDef"));
$tabht = array();
$tabtva = array();
$tabttc = array();
$tablocaltax1 = array();
$tablocaltax2 = array();
$tabcompany = array();
$i = 0;
while ($i < $num) {
@ -185,6 +185,31 @@ if ($result) {
$account_localtax2 = getLocalTaxesFromRate($obj->tva_tx, 2, $mysoc, $obj->thirdparty);
$compta_localtax2 = (!empty($account_localtax2[2]) ? $account_localtax2[2] : $langs->trans("CodeNotDef"));
// Avoid warnings
if (!array_key_exists($obj->rowid, $tabfac)) {
$tabfac[$obj->rowid] = array();
$tabttc[$obj->rowid] = array();
$tabht[$obj->rowid] = array();
$tabtva[$obj->rowid] = array();
$tablocaltax1[$obj->rowid] = array();
$tablocaltax2[$obj->rowid] = array();
}
if (!isset($tabttc[$obj->rowid][$compta_soc])) {
$tabttc[$obj->rowid][$compta_soc] = 0;
}
if (!isset($tabht[$obj->rowid][$compta_prod])) {
$tabht[$obj->rowid][$compta_prod] = 0;
}
if (!isset($tabtva[$obj->rowid][$compta_tva])) {
$tabtva[$obj->rowid][$compta_tva] = 0;
}
if (!isset($tablocaltax1[$obj->rowid][$compta_localtax1])) {
$tablocaltax1[$obj->rowid][$compta_localtax1] = 0;
}
if (!isset($tablocaltax2[$obj->rowid][$compta_localtax2])) {
$tablocaltax2[$obj->rowid][$compta_localtax2] = 0;
}
$tabfac[$obj->rowid]["date"] = $obj->datef;
$tabfac[$obj->rowid]["ref"] = $obj->ref_supplier;
$tabfac[$obj->rowid]["type"] = $obj->type;
@ -222,15 +247,16 @@ print "</tr>\n";
$invoicestatic = new FactureFournisseur($db);
$companystatic = new Fournisseur($db);
foreach ($tabfac as $key => $val) {
$invoicestatic->id = (int) $key;
$invoicestatic->ref = $val["ref"];
$invoicestatic->type = $val["type"];
if (count($tabfac) && count($tabht) && count($tabtva) && count($tablocaltax1) && count($tablocaltax2) && count($tabttc)) { // Check for static analysis
foreach ($tabfac as $key => $val) {
$invoicestatic->id = (int) $key;
$invoicestatic->ref = (string) $val["ref"];
$invoicestatic->type = $val["type"];
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
$lines = array(
$lines = array(
array(
'var' => $tabht[$key],
'label' => $langs->trans('Products'),
@ -253,26 +279,27 @@ foreach ($tabfac as $key => $val) {
'nomtcheck' => true,
'inv' => true
)
);
);
foreach ($lines as $line) {
foreach ($line['var'] as $k => $mt) {
if (isset($line['nomtcheck']) || $mt) {
print '<tr class="oddeven">';
print '<td class="nowraponall">'.dol_print_date($db->jdate($val["date"]), 'day')."</td>";
print '<td class="tdoverflowmax150">'.$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td>";
print "<td>".$line['label']."</td>";
foreach ($lines as $line) {
foreach ($line['var'] as $k => $mt) {
if (isset($line['nomtcheck']) || $mt) {
print '<tr class="oddeven">';
print '<td class="nowraponall">'.dol_print_date($db->jdate($val["date"]), 'day')."</td>";
print '<td class="tdoverflowmax150">'.$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td>";
print "<td>".$line['label']."</td>";
if (isset($line['inv'])) {
print '<td class="right">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right">'.($mt >= 0 ? price($mt) : '')."</td>";
} else {
print '<td class="right">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right">'.($mt < 0 ? price(-$mt) : '')."</td>";
if (isset($line['inv'])) {
print '<td class="right">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right">'.($mt >= 0 ? price($mt) : '')."</td>";
} else {
print '<td class="right">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right">'.($mt < 0 ? price(-$mt) : '')."</td>";
}
print "</tr>";
}
print "</tr>";
}
}
}

View file

@ -162,15 +162,15 @@ if (in_array($db->type, array('mysql', 'mysqli'))) {
}
$tabfac = array();
$tabht = array();
$tabtva = array();
$tablocaltax1 = array();
$tablocaltax2 = array();
$tabttc = array();
$tabcompany = array();
$result = $db->query($sql);
if ($result) {
$tabht = array();
$tabtva = array();
$tablocaltax1 = array();
$tablocaltax2 = array();
$tabttc = array();
$tabcompany = array();
$account_localtax1 = 0;
$account_localtax2 = 0;

View file

@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -541,6 +541,7 @@ if ($resql) {
$invoice = new Facture($db);
$invoice->fetch($objp->facid);
$marginInfo = null;
// Add Margin
if (isModEnabled('margin') && getDolGlobalInt('MARGIN_SHOW_MARGIN_ON_PAYMENT')) {
@ -577,7 +578,7 @@ if ($resql) {
}
// Add margin
if (isModEnabled('margin') && getDolGlobalInt('MARGIN_SHOW_MARGIN_ON_PAYMENT')) {
if (isModEnabled('margin') && getDolGlobalInt('MARGIN_SHOW_MARGIN_ON_PAYMENT') && $marginInfo !== null) {
print '<td class="right">'.price($marginInfo['total_margin']).'</td>';
}

View file

@ -10,7 +10,7 @@
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -189,6 +189,7 @@ $total_ttc = 0;
$builddate = '';
$name = '';
$period = '';
$description = '';
// Affiche en-tete de rapport
if ($modecompta == "CREANCES-DETTES") {
@ -449,6 +450,8 @@ if ($modecompta == 'BOOKKEEPING') {
if (!empty($date_start) && !empty($date_end)) {
$sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
}
} else {
$sql = '';
}
$sql .= " AND f.entity IN (".getEntity('invoice').")";
if ($socid) {
@ -1541,6 +1544,7 @@ if ($modecompta == 'BOOKKEEPING') {
$action = "balanceclient";
$object = array(&$total_ht, &$total_ttc);
$parameters = array();
$parameters["mode"] = $modecompta;
$parameters["date_start"] = $date_start;
$parameters["date_end"] = $date_end;

View file

@ -7,7 +7,7 @@
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -155,6 +155,7 @@ $name = '';
$period = '';
$periodlink = '';
$exportlink = '';
$description = '';
$encaiss = array();
$encaiss_ttc = array();
@ -995,6 +996,7 @@ if (isModEnabled('accounting') && ($modecompta == 'BOOKKEEPING')) {
$action = "balance";
$object = array(&$encaiss, &$encaiss_ttc, &$decaiss, &$decaiss_ttc);
$parameters = array();
$parameters["mode"] = $modecompta;
// Initialize a technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('externalbalance'));

View file

@ -3,7 +3,7 @@
* Copyright (C) 2016-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2020 Laurent Destailleur <eldy@destailleur.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -207,6 +207,7 @@ $builddate = 0;
$name = '';
$period = '';
$calcmode = 0;
$description = '';
$form = new Form($db);
@ -373,9 +374,12 @@ if ($modecompta == 'CREANCES-DETTES') {
$vars[$un_cat['code']] = 0;
}
$code = null;
// Previous Fiscal year (N-1)
foreach ($sommes as $code => $det) {
$vars[$code] = empty($det['NP']) ? 0 : $det['NP'];
foreach ($sommes as $code_idx => $det) {
$code = $code_idx;
$vars[$code_idx] = empty($det['NP']) ? 0 : $det['NP'];
}
$result = strtr($formula, $vars);
@ -397,7 +401,7 @@ if ($modecompta == 'CREANCES-DETTES') {
}
}
if (!isset($sommes[$code])) {
if ($code !== null && !isset($sommes[$code])) {
$sommes[$code] = array();
}
// Year N
@ -409,9 +413,10 @@ if ($modecompta == 'CREANCES-DETTES') {
}
// Current fiscal year (N)
if (is_array($sommes) && !empty($sommes)) {
foreach ($sommes as $code => $det) {
$vars[$code] = empty($det['N']) ? 0 : $det['N'];
if (!empty($sommes)) {
foreach ($sommes as $code_idx => $det) {
$code = $code_idx;
$vars[$code_idx] = empty($det['N']) ? 0 : $det['N'];
}
}
@ -435,8 +440,9 @@ if ($modecompta == 'CREANCES-DETTES') {
// Detail by month
foreach ($months as $k => $v) {
if (($k + 1) >= $date_startmonth && (($date_startmonth <= $date_endmonth && ($k + 1) <= $date_endmonth) || ($date_startmonth > $date_endmonth))) {
foreach ($sommes as $code => $det) {
$vars[$code] = empty($det['M'][$k]) ? 0 : $det['M'][$k];
foreach ($sommes as $code_idx => $det) {
$code = $code_idx;
$vars[$code_idx] = empty($det['M'][$k]) ? 0 : $det['M'][$k];
}
$result = strtr($formula, $vars);
$result = str_replace('--', '+', $result);
@ -461,8 +467,9 @@ if ($modecompta == 'CREANCES-DETTES') {
if ($date_startmonth > $date_endmonth) {
foreach ($months as $k => $v) {
if (($k + 1) < $date_startmonth && ($k + 1) <= $date_endmonth) {
foreach ($sommes as $code => $det) {
$vars[$code] = empty($det['M'][$k]) ? 0 : $det['M'][$k];
foreach ($sommes as $code_idx => $det) {
$code = $code_idx;
$vars[$code_idx] = empty($det['M'][$k]) ? 0 : $det['M'][$k];
}
$result = strtr($formula, $vars);
$result = str_replace('--', '+', $result);

View file

@ -5,7 +5,7 @@
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
* Copyright (C) 2018-2026 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>
* Copyright (C) 2024-2026 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
@ -262,6 +262,7 @@ foreach ($headerparams as $key => $value) {
$catotal = 0;
$catotal_ht = 0;
$sql = '';
if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc";

View file

@ -7,7 +7,7 @@
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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,6 +283,7 @@ $name = array();
// Show Array
$catotal = 0;
$catotal_ht = 0;
$sql = '';
if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT DISTINCT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.fk_pays,";

View file

@ -5,7 +5,7 @@
* Copyright (C) 2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2018-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Benjamin B. <b.crozon@trebisol.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -220,6 +220,7 @@ if ($modecompta == "RECETTES-DEPENSES" || $modecompta == "BOOKKEEPINGCOLLECTED")
}
report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode);
$sql = '';
if (isModEnabled('accounting')) {
if ($modecompta != 'BOOKKEEPING') {
@ -499,13 +500,13 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) {
//var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end);
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
if ($annee_decalage > $minyear && $case <= $casenow) {
if ($modecompta=='CREANCES-DETTES') {
$cumulative_previous_year = (!empty($cumulative_ht[$caseprev])?$cumulative_ht[$caseprev]:0);
$cumulative_year = (!empty($cumulative_ht[$case])?$cumulative_ht[$case]:0);
if ($modecompta == 'CREANCES-DETTES') {
$cumulative_previous_year = (!empty($cumulative_ht[$caseprev]) ? $cumulative_ht[$caseprev] : 0);
$cumulative_year = (!empty($cumulative_ht[$case]) ? $cumulative_ht[$case] : 0);
$isset_cumulative_previous_year = isset($cumulative_ht[$caseprev]);
} else {
$cumulative_previous_year = (!empty($cumulative[$caseprev])?$cumulative[$caseprev]:0);
$cumulative_year = (!empty($cumulative[$case])?$cumulative[$case]:0);
$cumulative_previous_year = (!empty($cumulative[$caseprev]) ? $cumulative[$caseprev] : 0);
$cumulative_year = (!empty($cumulative[$case]) ? $cumulative[$case] : 0);
$isset_cumulative_previous_year = isset($cumulative_ht[$caseprev]);
}
if (!empty($cumulative_previous_year) && !empty($cumulative_year)) {
@ -648,11 +649,11 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) {
// Percentage total
if ($annee > $minyear && $annee <= max($nowyear, $maxyear)) {
if ($modecompta == 'CREANCES-DETTES') {
$total_previous_year = (!empty($total_ht[$annee - 1])?$total_ht[$annee - 1]:0);
$total_year = (!empty($total_ht[$annee])?$total_ht[$annee]:0);
$total_previous_year = (!empty($total_ht[$annee - 1]) ? $total_ht[$annee - 1] : 0);
$total_year = (!empty($total_ht[$annee]) ? $total_ht[$annee] : 0);
} else {
$total_previous_year = (!empty($total[$annee - 1])?$total[$annee - 1]:0);
$total_year = (!empty($total[$annee])?$total[$annee]:0);
$total_previous_year = (!empty($total[$annee - 1]) ? $total[$annee - 1] : 0);
$total_year = (!empty($total[$annee]) ? $total[$annee] : 0);
}
if (!empty($total_previous_year) && !empty($total_year)) {
$percent = (round(($total_year - $total_previous_year) / $total_previous_year, 4) * 100);

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2020 Maxime Kohlhaas <maxime@atm-consulting.fr>
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -246,6 +246,8 @@ if (isModEnabled('accounting')) {
}
$sql = '';
if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";

View file

@ -309,6 +309,7 @@ $amount_ht = array();
$address_zip = array();
$address_town = array();
$address_pays = array();
$sql = '';
if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT DISTINCT s.rowid as socid, s.nom as name, s.zip, s.town, s.fk_pays,";

View file

@ -7,7 +7,7 @@
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2021 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -57,6 +57,19 @@ $month_start = $month_current;
$refresh = true;
include DOL_DOCUMENT_ROOT.'/compta/tva/initdatesforvat.inc.php';
/**
* Variables from include:
*
* @var int $date_start
* @var int $date_end
* @var string $date_start_month
* @var string $date_start_year
* @var string $date_start_day
* @var string $date_end_month
* @var string $date_end_year
* @var string $date_end_day
*/
'
@phan-var-force int $date_start
@phan-var-force int $date_end
@ -410,6 +423,7 @@ if ($refresh === true) {
$action = "tva";
$object = array(&$x_coll, &$x_paye, &$x_both);
$parameters = array();
$parameters["mode"] = $modetax;
$parameters["year"] = $y;
$parameters["month"] = $m;

View file

@ -150,6 +150,7 @@ if (preg_match('/^cs\./', $sortfield)
//print $sql;
dol_syslog("compta/tva/payments.php: select payment", LOG_DEBUG);
$num = 0;
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);

View file

@ -2,7 +2,7 @@
/* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2007-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -69,7 +69,7 @@ if ($id > 0) {
// Security check
if ($user->socid > 0) {
unset($action);
$action = null;
$socid = $user->socid;
$object->id = $socid;
}

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2011-2015 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>
* Copyright (C) 2024-2026 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
@ -31,12 +31,18 @@
* @var User $user
*
* @var string $contextpage
* @var ?string $action
* @var int $withproject
* @var int $idcomment
* @var int $id
*/
// Next should be define in the including php source file
'
@phan-var-force ?string $action
@phan-var-force int $withproject
@phan-var-force int $idcomment
@phan-var-force int $id
';
require_once DOL_DOCUMENT_ROOT.'/core/class/comment.class.php';

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2015-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -26,6 +26,7 @@
// $action must be defined
// $object must be defined
// $id must be defined
// $permissiondellink must be defined
/**
@ -35,7 +36,14 @@
*
* @var string $action
* @var int $permissiondellink
* @var int $id
*/
'
@phan-var-force CommonObject $object
@phan-var-force string $action
@phan-var-force int $permissiondellink
@phan-var-force int $id
';
$dellinkid = GETPOSTINT('dellinkid');
$addlink = GETPOST('addlink', 'alpha');

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2014-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -46,12 +46,17 @@ if ($action == 'print_file' && $user->hasRight('printing', 'read')) {
if (!empty($list)) {
$printerfound = 0;
foreach ($list as $driver) {
$classfile = null;
foreach ($dirmodels as $dir) {
if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) {
$classfile = dol_buildpath($dir, 0).$driver.'.modules.php';
$tmpclassfile = dol_buildpath($dir, 0).$driver.'.modules.php';
if (file_exists($tmpclassfile)) {
$classfile = $tmpclassfile;
break;
}
}
if ($classfile === null) {
continue;
}
require_once $classfile;
$classname = 'printing_'.$driver;
$printer = new $classname($db);

View file

@ -3,7 +3,7 @@
/* Copyright (C) 2011-2022 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -83,6 +83,7 @@ class FileUpload
}
$object_ref = 'UndefinedReference';
$object = null;
// If pathname and filename are null then we can still upload files if we have specified upload_dir on $options
if ($pathname !== null && $filename !== null) {
// Get object from its id and type

View file

@ -86,6 +86,7 @@ class FormBarCode
$disable = 'disabled';
}
$select_encoder = '';
if (!empty($conf->use_javascript_ajax)) {
$select_encoder = '<form action="'.DOL_URL_ROOT.'/admin/barcode.php" method="POST" id="form'.$idForm.'">';
$select_encoder .= '<input type="hidden" name="token" value="'.newToken().'">';

View file

@ -980,35 +980,30 @@ class FormCompany extends Form
$formlength = 0;
if (!getDolGlobalString('MAIN_DISABLEPROFIDRULES')) {
if ($country_code == 'FR') {
if (isset($idprof)) {
if ($idprof == 1) {
$formlength = 9;
} elseif ($idprof == 2) {
$formlength = 14;
} elseif ($idprof == 3) {
$formlength = 5; // 4 digits and 1 letter since january
} elseif ($idprof == 4) {
$formlength = 32; // No maximum as we need to include a town name in this id
}
if ($idprof == 1) {
$formlength = 9;
} elseif ($idprof == 2) {
$formlength = 14;
} elseif ($idprof == 3) {
$formlength = 5; // 4 digits and 1 letter since january
} elseif ($idprof == 4) {
$formlength = 32; // No maximum as we need to include a town name in this id
}
} elseif ($country_code == 'ES') {
if ($idprof == 1) {
$formlength = 9; //CIF/NIF/NIE 9 digits
}
if ($idprof == 2) {
} elseif ($idprof == 2) {
$formlength = 12; //NASS 12 digits without /
}
if ($idprof == 3) {
} elseif ($idprof == 3) {
$formlength = 5; //CNAE 5 digits
}
if ($idprof == 4) {
} elseif ($idprof == 4) {
$formlength = 32; //depend of college
}
}
}
$selected = $preselected;
if (!$selected && isset($idprof)) {
if (!$selected) {
if ($idprof == 1 && !empty($this->idprof1)) {
$selected = $this->idprof1;
} elseif ($idprof == 2 && !empty($this->idprof2)) {

View file

@ -827,6 +827,8 @@ class FormProjets extends Form
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
$out = '';
$labeltoshow = '';
if (empty($lineOnly)) {
// Search Invoice
$sql = "SELECT f.rowid, f.ref as fref,";
@ -911,6 +913,7 @@ class FormProjets extends Form
$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoiceLine . '" name="' . $htmlNameInvoiceLine . '">';
}
$num = $this->db->num_rows($resql);
if ($num) {
while ($obj = $this->db->fetch_object($resql)) {

View file

@ -3,7 +3,7 @@
* Copyright (C) 2021 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2023-2024 William Mead <william.mead@manchenumerique.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -817,6 +817,7 @@ class Utils
dol_include_once($modulelowercase.'/core/modules/mod'.$module.'.class.php');
$class = 'mod'.$module;
$moduleobj = null;
if (class_exists($class)) {
try {
$moduleobj = new $class($this->db);
@ -831,7 +832,7 @@ class Utils
exit;
}
$arrayversion = explode('.', $moduleobj->version, 3);
$arrayversion = $moduleobj === null ? array() : explode('.', $moduleobj->version, 3);
if (count($arrayversion)) {
$FILENAMEASCII = strtolower($module).'.asciidoc';
$FILENAMEDOC = strtolower($module).'.html';

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2020-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -44,10 +44,6 @@
* @var User $user
*
* @var ?int[] $toselect Items selected on page, only used to see if not empty here
* @var ?int $SHOWLEGEND Show legend or not
* @var string $customreportkey Custom report key
* @var string $customsql Custom SQL
* @var ?string[] $search_groupby Array with the third dimension
*/
'
@phan-var-force ?int[] $toselect
@ -97,9 +93,9 @@ if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) {
}
$search_measures = array_map('sanititzekey', $search_measures);
$search_xaxis = array_map('sanititzekey', isset($search_xaxis) ? $search_xaxis : array());
$search_xaxis = array_map('sanititzekey', $search_xaxis);
$search_yaxis = array_map('sanititzekey', $search_yaxis);
$search_groupby = array_map('sanititzekey', isset($search_groupby) ? $search_groupby : array());
$search_groupby = array_map('sanititzekey', $search_groupby);
// Load variable for pagination
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
@ -116,9 +112,23 @@ if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) {
$object = null;
} else {
// When included into a main page
/**
* @var ?int $SHOWLEGEND Show legend or not
* @var string $customreportkey Custom report key
* @var ?string $customsql Custom SQL
* @var ?string[] $search_groupby Array with the third dimension
* @var int $page
* @var string $sortfield
* @var string $sortorder
*/
'
@phan-var-force int<0,1> $SHOWLEGEND
@phan-var-force string customreportkey
@phan-var-force string $customreportkey
@phan-var-force ?string $customsql
@phan-var-force ?string[] $search_groupby Array with the third dimension
@phan-var-force int $page
@phan-var-force string $sortfield
@phan-var-force string $sortorder
';
// $search_measures, $search_xaxis or $search_yaxis may have been defined by the parent.

View file

@ -4,7 +4,7 @@
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2023 Eric Seigne <eric.seigne@cap-rel.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
*
@ -1276,6 +1276,7 @@ function activateModule($value, $withdeps = 1, $noconfverification = 0, $options
foreach ($modulestringorarray as $modulestring) {
$activate = false;
$activateerr = '';
$resarray = array();
foreach ($modulesdir as $dir) {
if (file_exists($dir.$modulestring.".class.php")) {
$resarray = activateModule($modulestring, 1, 0, $options);

View file

@ -6,7 +6,7 @@
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2019-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2023 Lenin Rivas <lenin.rivas777@gmail.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 William Mead <william@m34d.com>
*
* This program is free software; you can redistribute it and/or modify
@ -764,7 +764,7 @@ function dol_fileperm($pathoffile)
* Make replacement of strings into a file.
*
* @param string $srcfile Source file (can't be a directory)
* @param array<string,string|int> $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...)
* @param array<string,null|string|int> $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...)
* @param string $destfile Destination file (can't be a directory). If empty, will be same than source file.
* @param string $newmask Mask for new file. '0' by default means getDolGlobalString('MAIN_UMASK'). Example: '0666'.
* @param int $indexdatabase 1=index new file into database.
@ -823,7 +823,7 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask
$content = make_substitutions($content, $arrayreplacement, null);
} else {
foreach ($arrayreplacement as $key => $value) {
$content = preg_replace($key, $value, $content);
$content = preg_replace($key, (string) $value, $content);
}
}
@ -985,9 +985,9 @@ function dol_copy($srcfile, $destfile, $newmask = '0', $overwriteifexists = 1, $
* @param string $destfile Destination file (a directory)
* @param string $newmask Mask for new file ('0' by default means getDolGlobalString('MAIN_UMASK')). Example: '0666'
* @param int $overwriteifexists Overwrite file if exists (1 by default)
* @param array<string,string> $arrayreplacement Array to use to replace filenames with another one during the copy (works only on file names, not on directory names).
* @param ?array<string,string> $arrayreplacement Array to use to replace filenames with another one during the copy (works only on file names, not on directory names).
* @param int $excludesubdir 0=Do not exclude subdirectories, 1=Exclude subdirectories, 2=Exclude subdirectories if name is not a 2 chars (used for country codes subdirectories).
* @param string[] $excludefileext Exclude some file extensions
* @param ?string[] $excludefileext Exclude some file extensions
* @param int $excludearchivefiles Exclude archive files that start with v+timestamp or d+timestamp (0 by default)
* @return int Return integer <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK
* @see dol_copy()
@ -3675,17 +3675,17 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$email_split = explode('@', $_SESSION['email_customer']);
$sqlprotectagainstexternals = 'SELECT t.rowid, t.fk_soc FROM '.MAIN_DB_PREFIX.'ticket t';
$sqlprotectagainstexternals.= ' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id = t.rowid';
$sqlprotectagainstexternals.= ' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople c ON c.rowid = ec.fk_socpeople';
$sqlprotectagainstexternals.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_contact tc ON tc.element = "ticket" AND tc.rowid = ec.fk_c_type_contact';
$sqlprotectagainstexternals.= ' WHERE t.ref LIKE "'.$db->sanitize($refname).'"';
$sqlprotectagainstexternals.= ' AND (';
$sqlprotectagainstexternals.= ' (';
$sqlprotectagainstexternals.= ' tc.rowid IS NOT NULL';
$sqlprotectagainstexternals.= ' AND c.email = "'.$db->sanitize($email_split[0]).'@'.$db->sanitize($email_split[1]).'"';
$sqlprotectagainstexternals.= ' )';
$sqlprotectagainstexternals.= ' OR t.origin_email = "'.$db->sanitize($email_split[0]).'@'.$db->sanitize($email_split[1]).'"';
$sqlprotectagainstexternals.= ' )';
$sqlprotectagainstexternals .= ' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id = t.rowid';
$sqlprotectagainstexternals .= ' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople c ON c.rowid = ec.fk_socpeople';
$sqlprotectagainstexternals .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_contact tc ON tc.element = "ticket" AND tc.rowid = ec.fk_c_type_contact';
$sqlprotectagainstexternals .= ' WHERE t.ref LIKE "'.$db->sanitize($refname).'"';
$sqlprotectagainstexternals .= ' AND (';
$sqlprotectagainstexternals .= ' (';
$sqlprotectagainstexternals .= ' tc.rowid IS NOT NULL';
$sqlprotectagainstexternals .= ' AND c.email = "'.$db->sanitize($email_split[0]).'@'.$db->sanitize($email_split[1]).'"';
$sqlprotectagainstexternals .= ' )';
$sqlprotectagainstexternals .= ' OR t.origin_email = "'.$db->sanitize($email_split[0]).'@'.$db->sanitize($email_split[1]).'"';
$sqlprotectagainstexternals .= ' )';
}
$original_file = $conf->ticket->multidir_output[$entity].'/'.$original_file;
// If modulepart=module_user_temp Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart/temp/iduser

View file

@ -10203,9 +10203,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
'__MYCOMPANY_NAME__' => $mysoc->name,
'__MYCOMPANY_EMAIL__' => $mysoc->email,
'__MYCOMPANY_URL__' => $mysoc->url,
'__MYCOMPANY_PHONE__' => dol_print_phone($mysoc->phone, '', 0, 0, '', " ", '', '', -1),
'__MYCOMPANY_PHONEMOBILE__' => dol_print_phone($mysoc->phone_mobile, '', 0, 0, '', " ", '', '', -1),
'__MYCOMPANY_FAX__' => dol_print_phone($mysoc->fax, '', 0, 0, '', " ", '', '', -1),
'__MYCOMPANY_PHONE__' => dol_print_phone((string) $mysoc->phone, '', 0, 0, '', " ", '', '', -1),
'__MYCOMPANY_PHONEMOBILE__' => dol_print_phone((string) $mysoc->phone_mobile, '', 0, 0, '', " ", '', '', -1),
'__MYCOMPANY_FAX__' => dol_print_phone((string) $mysoc->fax, '', 0, 0, '', " ", '', '', -1),
'__MYCOMPANY_PROFID1__' => $mysoc->idprof1,
'__MYCOMPANY_PROFID2__' => $mysoc->idprof2,
'__MYCOMPANY_PROFID3__' => $mysoc->idprof3,
@ -10676,7 +10676,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
// Show structured communication
if (getDolGlobalString('INVOICE_PAYMENT_ENABLE_STRUCTURED_COMMUNICATION') && $object->element == 'facture') {
include_once DOL_DOCUMENT_ROOT . '/core/lib/functions_be.lib.php';
$substitutionarray['__PAYMENT_STRUCTURED_COMMUNICATION__'] = dolBECalculateStructuredCommunication($object->ref, $object->type);
$substitutionarray['__PAYMENT_STRUCTURED_COMMUNICATION__'] = dolBECalculateStructuredCommunication((string) $object->ref, $object->type);
}
if (getDolGlobalString('PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD') && is_object($object) && $object->element == 'propal') {
@ -10725,7 +10725,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
/** @var Propal $object */
$substitutionarray['__URL_PROPOSAL__'] = DOL_MAIN_URL_ROOT . "/comm/propal/card.php?id=" . $object->id;
require_once DOL_DOCUMENT_ROOT . '/core/lib/signature.lib.php';
$substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'proposal', $object->ref, 1, $object);
$substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'proposal', (string) $object->ref, 1, $object);
}
if (is_object($object) && $object->element == 'commande') {
'@phan-var-force Commande $object';
@ -10742,14 +10742,14 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
/** @var Contrat $object */
$substitutionarray['__URL_CONTRACT__'] = DOL_MAIN_URL_ROOT . "/contrat/card.php?id=" . $object->id;
require_once DOL_DOCUMENT_ROOT . '/core/lib/signature.lib.php';
$substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'contract', $object->ref, 1, $object);
$substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'contract', (string) $object->ref, 1, $object);
}
if (is_object($object) && $object->element == 'fichinter') {
'@phan-var-force Fichinter $object';
/** @var Fichinter $object */
$substitutionarray['__URL_FICHINTER__'] = DOL_MAIN_URL_ROOT . "/fichinter/card.php?id=" . $object->id;
require_once DOL_DOCUMENT_ROOT . '/core/lib/signature.lib.php';
$substitutionarray['__ONLINE_SIGN_FICHINTER_URL__'] = getOnlineSignatureUrl(0, 'fichinter', $object->ref, 1, $object);
$substitutionarray['__ONLINE_SIGN_FICHINTER_URL__'] = getOnlineSignatureUrl(0, 'fichinter', (string) $object->ref, 1, $object);
}
if (is_object($object) && $object->element == 'supplier_proposal') {
'@phan-var-force SupplierProposal $object';

View file

@ -336,7 +336,7 @@ function pdf_getHeightForLogo($logo, $url = false)
*
* @param TCPDF $pdf PDF initialized object
* @param string $htmlcontent HTML Content
* @return int Height
* @return float Height
* @see getStringHeight()
*/
function pdfGetHeightForHtmlContent($pdf, $htmlcontent)

View file

@ -716,6 +716,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</div><div class="fichehalfright">';
$MAXEVENT = 10;
$morehtmlcenter = '<div class="nowraponall">';
$morehtmlcenter .= dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id);
$morehtmlcenter .= dolGetButtonTitle($langs->trans('FullList'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id);
$morehtmlcenter .= '</div>';
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'conferenceorboothattendee', 0, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for attendee
print '</div></div>';
}

View file

@ -33,6 +33,12 @@
-- To rebuild sequence for postgresql after insert, by forcing id autoincrement fields:
-- -- VPGSQL8.2 SELECT dol_util_rebuild_sequences();
-- Vxx forgotten
ALTER TABLE llx_c_email_templates ADD COLUMN content_lines text;
-- V23 forgotten
ALTER TABLE llx_categorie_project_task DROP FOREIGN KEY fk_categorie_project_task_rowid;

View file

@ -317,7 +317,7 @@ if (getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') && getDolGlobalString('MAIN_
if (!getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') && getDolGlobalString('MAIN_VERSION_LAST_INSTALL') && getDolGlobalString('MAIN_VERSION_LAST_INSTALL') != DOL_VERSION) {
$checkifupgraderequired = true;
}
if ($checkifupgraderequired) {
if ($checkifupgraderequired && !defined('MAIN_VERSION_DISABLE_DB_CHECK')) {
$versiontocompare = getDolGlobalString('MAIN_VERSION_LAST_UPGRADE', getDolGlobalString('MAIN_VERSION_LAST_INSTALL'));
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$dolibarrversionlastupgrade = preg_split('/[.-]/', $versiontocompare);