2
0
forked from Wavyzz/dolibarr

Compare commits

...

27 Commits
22.0.2 ... 18.0

Author SHA1 Message Date
Regis Houssin
b1d57a6bd1 FIX sql syntax error (#35588) 2025-10-02 15:45:30 +02:00
ldestailleur
16904d12f8 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-10-02 03:18:10 +02:00
ldestailleur
1525b9c85e Rename label 2025-10-02 03:17:57 +02:00
Marc de Lima Lucio
ffe07999cf FIX: pgsql: error when calculating depreciations (#34213)
* FIX: pgsql: error when calculating depreciations

* FIX: asset deprectiation: optimize sql

* FIX: travis
2025-10-02 02:39:29 +02:00
Regis Houssin
24146d89c5 FIX #35568 (#35569)
* FIX #35568

* FIX clear "thirdparty" object before or during the fetch

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-10-01 19:54:50 +02:00
ldestailleur
477d755bbc Clean CI files 2025-10-01 19:32:40 +02:00
ldestailleur
f85b53a4ca Test CI 2025-10-01 19:29:30 +02:00
ldestailleur
a6e01fe7b7 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-10-01 19:28:46 +02:00
ldestailleur
43c2336683 Log 2025-10-01 19:28:36 +02:00
Thomas C.
e1b919366e FIX : To have only the sender's entity when sending mail (#31053)
* fix

* Update html.formmail.class.php

* Update html.formmail.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
Co-authored-by: lvessiller-opendsi <lvessiller@open-dsi.fr>
2025-10-01 19:18:31 +02:00
ldestailleur
40e4a6959f Fix CI 2025-10-01 19:17:22 +02:00
ldestailleur
52ae202aff Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-10-01 16:59:49 +02:00
ldestailleur
2ca2fe7f28 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-10-01 16:55:23 +02:00
ldestailleur
140310c508 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-10-01 16:55:05 +02:00
ldestailleur
64cf2513bd Clean CI 2025-10-01 16:54:52 +02:00
Marc de Lima Lucio
a3969c1d2c FIX: php 8+ warnings when creating deposits (#35582) 2025-10-01 16:21:05 +02:00
Regis Houssin
d9563ac0ed Update pr-18.yaml (#35577)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-10-01 14:49:29 +02:00
ldestailleur
bea2f674f0 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-10-01 14:34:04 +02:00
ldestailleur
80494870c0 Try to fix CI 18 2025-10-01 14:33:56 +02:00
Eric - CAP-REL
d25847602b missing fk_user_creat value (#35576) 2025-10-01 13:59:27 +02:00
ldestailleur
283efbbffe Test CI 2025-10-01 13:57:10 +02:00
ldestailleur
2e430a71a3 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-10-01 13:54:19 +02:00
ldestailleur
faf2971ff7 Try to fix Ci 18 2025-10-01 13:54:11 +02:00
Regis Houssin
acf5e30b30 FIX missing entity filter (#35517) 2025-09-27 12:07:43 +02:00
ldestailleur
76b5540124 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-09-27 12:06:49 +02:00
ldestailleur
8bb63c5963 Test on autoassign 2025-09-27 12:06:40 +02:00
HENRY Florian
f532f85d8c fix: remove space in global conf test (#35484) 2025-09-26 20:54:21 +02:00
13 changed files with 39 additions and 67 deletions

View File

@@ -1,3 +0,0 @@
# Add this tag for any changes for more than 1 line
"Pending analysis of PR (maintenance team)":
min: 1

View File

@@ -1,21 +0,0 @@
name: "Set label for v18"
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- "18.0"
push:
branches:
- "18.0"
jobs:
changed-lines-count-labeler:
runs-on: ubuntu-latest
name: An action for automatically labelling pull requests based on the changed lines count
steps:
- name: Set a label
uses: vkirilichev/changed-lines-count-labeler@v0.2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/changed-lines-count-labeler.yml
continue-on-error: true

View File

@@ -6,7 +6,7 @@
# Go on Organisation - Secret and variables and create a variable PR18_APP_ID and copy the ID of the previously create ID. Choose the repository access to "Repository Dolibarr".
#
name: Set reviewer for v18
name: Set reviewer and label for v18
on:
pull_request_target:
types: [opened, synchronize, reopened]
@@ -16,11 +16,19 @@ on:
branches:
- "18.0"
permissions:
pull-requests: write
issues: write
jobs:
pr18:
assign-and-label-v18:
runs-on: ubuntu-latest
steps:
#- name: Install GitHub CLI
# run: sudo apt-get install gh
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v2
@@ -36,6 +44,8 @@ jobs:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
url: ${{ github.event.pull_request.html_url }}
run: |
gh pr edit "$url" --add-reviewer rycks
gh pr edit "$url" --add-reviewer lvessiller-opendsi
echo "env.url=${{env.url}}"
gh pr edit "${{env.url}}" --add-reviewer rycks
gh pr edit "${{env.url}}" --add-reviewer lvessiller-opendsi
#gh pr edit "${{env.url}}" --add-reviewer eldy
gh pr edit "${{env.url}}" --add-label "Issue for v18 maintenance Team"

View File

@@ -1,28 +0,0 @@
name: Test github actions
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
push:
env:
ENVGHT: ${{ secrets.GITHUB_TOKEN }}
ENVGHU: ${{ github.token }}
TEST_ACCESS_KEY: ${{ secrets.TEST_ACCESS_KEY }}
TEST_VAR_REPO: ${{ vars.TEST_VAR_REPO }}
ENVLOCAL: "varenvlocal"
jobs:
testjob:
runs-on: ubuntu-latest
steps:
- name: Log
run: |
echo "Run action by ${{ github.actor }}"
echo "github.token=${{ github.token }}"
echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH"
echo "repo-token: ${{secrets.GITHUB_TOKEN}}"
echo "secret repository TEST_ACCESS_KEY: ${{secrets.TEST_ACCESS_KEY}}"
echo "variable repository : ${{vars.TEST_VAR_REPO}}"
echo "ENVLOCAL: ${{env.ENVLOCAL}}"

View File

@@ -928,12 +928,13 @@ class Asset extends CommonObject
}
// Delete old lines
$sql = "DELETE " . MAIN_DB_PREFIX . "asset_depreciation FROM " . MAIN_DB_PREFIX . "asset_depreciation";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab ON ab.doc_type = 'asset' AND ab.fk_docdet = " . MAIN_DB_PREFIX . "asset_depreciation.rowid";
$sql .= " WHERE " . MAIN_DB_PREFIX . "asset_depreciation.fk_asset = " . (int) $this->id;
$sql .= " AND " . MAIN_DB_PREFIX . "asset_depreciation.depreciation_mode = '" . $this->db->escape($mode_key) . "'";
$sql .= " AND ab.fk_docdet IS NULL";
if ($last_depreciation_date !== "") $sql .= " AND " . MAIN_DB_PREFIX . "asset_depreciation.ref != ''";
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "asset_depreciation";
$sql .= " WHERE fk_asset = " . (int) $this->id;
$sql .= " AND depreciation_mode = '" . $this->db->escape($mode_key) . "'";
$sql .= " AND NOT EXISTS (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE doc_type = 'asset' AND fk_docdet = " . MAIN_DB_PREFIX . "asset_depreciation.rowid)";
if ($last_depreciation_date !== "") {
$sql .= " AND ref != ''";
}
$resql = $this->db->query($sql);
if (!$resql) {
$this->errors[] = $langs->trans('AssetErrorClearDepreciationLines') . ': ' . $this->db->lasterror();

View File

@@ -196,6 +196,7 @@ class CashControl extends CommonObject
$sql .= ", cash";
$sql .= ", cheque";
$sql .= ", card";
$sql .= ", fk_user_creat";
$sql .= ") VALUES (";
//$sql .= "'(PROV)', ";
$sql .= ((int) $conf->entity);
@@ -210,6 +211,7 @@ class CashControl extends CommonObject
$sql .= ", ".price2num($this->cash, 'MT');
$sql .= ", ".price2num($this->cheque, 'MT');
$sql .= ", ".price2num($this->card, 'MT');
$sql .= ", ".((int) $user->id);
$sql .= ")";
$this->db->begin();

View File

@@ -1515,6 +1515,9 @@ if (empty($reshook)) {
}
foreach ($TTotalByTva as $tva => &$total) {
if (empty($amountdeposit[$tva])) {
$amountdeposit[$tva] = 0;
}
$coef = $total / $srcobject->total_ttc; // Calc coef
$am = $amount * $coef;
$amount_ttc_diff += $am;
@@ -1539,6 +1542,9 @@ if (empty($reshook)) {
if ($qualified) {
$totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
$tva_tx = $lines[$i]->tva_tx;
if (empty($amountdeposit[$tva_tx])) {
$amountdeposit[$tva_tx] = 0;
}
$amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $valuedeposit) / 100;
}
}

View File

@@ -3240,7 +3240,7 @@ class Facture extends CommonInvoice
$this->date = dol_now();
$this->date_lim_reglement = $this->calculate_date_lim_reglement();
}
if (!empty($conf->global-> INVOICE_CHECK_POSTERIOR_DATE)) {
if (!empty($conf->global->INVOICE_CHECK_POSTERIOR_DATE)) {
$last_of_type = $this->willBeLastOfSameType(true);
if (!$last_of_type[0]) {
$this->error = $langs->transnoentities("ErrorInvoiceIsNotLastOfSameType", $this->ref, dol_print_date($this->date, 'day'), dol_print_date($last_of_type[1], 'day'));

View File

@@ -1146,6 +1146,7 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) {
$objecttmp = new $objectclass($db);
$nbok = 0;
foreach ($toselect as $toselectid) {
$objecttmp->thirdparty = null; // Clear if another value was already set by fetch_thirdparty
$result = $objecttmp->fetch($toselectid);
if ($result > 0) {
$outputlangs = $langs;
@@ -1160,7 +1161,7 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) {
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($objecttmp->default_lang)) {
$newlang = $objecttmp->default_lang; // for thirdparty
}
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && empty($objecttmp->thirdparty)) { //load lang from thirdparty
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && empty($objecttmp->thirdparty)) { //load lang from thirdparty
$objecttmp->fetch_thirdparty();
$newlang = $objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ...
}

View File

@@ -627,7 +627,7 @@ class FormMail extends Form
// Add also email aliases from the c_email_senderprofile table
$sql = "SELECT rowid, label, email FROM ".$this->db->prefix()."c_email_senderprofile";
$sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).")";
$sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).") AND entity IN (".getEntity('c_email_senderprofile').")";
$sql .= " ORDER BY position";
$resql = $this->db->query($sql);
if ($resql) {

View File

@@ -427,7 +427,10 @@ class CommandeFournisseur extends CommonOrder
$this->ref = $obj->ref;
$this->ref_supplier = $obj->ref_supplier;
$this->socid = $obj->fk_soc;
$this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty
$this->fourn_id = $obj->fk_soc;
$this->statut = $obj->fk_statut;
$this->status = $obj->fk_statut;

View File

@@ -1006,6 +1006,7 @@ class FactureFournisseur extends CommonInvoice
$this->extraparams = isset($obj->extraparams) ? (array) json_decode($obj->extraparams, true) : array();
$this->socid = $obj->socid;
$this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty
$this->socnom = $obj->socnom;
// Retrieve all extrafield

View File

@@ -156,7 +156,7 @@ $year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month);
$sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, cp.fk_type, cp.description, cp.halfday, cp.statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
$sql .= " WHERE cp.rowid > 0";
$sql .= " WHERE cp.entity IN (".getEntity('holiday').") AND cp.rowid > 0";
$sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED;
$sql .= " AND (";
$sql .= " (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')";