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

This commit is contained in:
ldestailleur 2025-09-23 22:03:24 +02:00
commit 6f15fcc66c
5 changed files with 29 additions and 78 deletions

View file

@ -156,60 +156,6 @@ parameters:
count: 1
path: ../../../htdocs/accountancy/bookkeeping/export.php
-
message: '#^Property AccountancyCategory\:\:\$active \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 4
path: ../../../htdocs/accountancy/class/accountancycategory.class.php
-
message: '#^Property AccountancyCategory\:\:\$category_type \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 4
path: ../../../htdocs/accountancy/class/accountancycategory.class.php
-
message: '#^Property AccountancyCategory\:\:\$code \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 4
path: ../../../htdocs/accountancy/class/accountancycategory.class.php
-
message: '#^Property AccountancyCategory\:\:\$fk_country \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 4
path: ../../../htdocs/accountancy/class/accountancycategory.class.php
-
message: '#^Property AccountancyCategory\:\:\$formula \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 4
path: ../../../htdocs/accountancy/class/accountancycategory.class.php
-
message: '#^Property AccountancyCategory\:\:\$label \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 4
path: ../../../htdocs/accountancy/class/accountancycategory.class.php
-
message: '#^Property AccountancyCategory\:\:\$position \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 4
path: ../../../htdocs/accountancy/class/accountancycategory.class.php
-
message: '#^Property AccountancyCategory\:\:\$range_account \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 4
path: ../../../htdocs/accountancy/class/accountancycategory.class.php
-
message: '#^Property AccountancyCategory\:\:\$sens \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 4
path: ../../../htdocs/accountancy/class/accountancycategory.class.php
-
message: '#^Call to function is_array\(\) with list\<string\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -3894,12 +3840,6 @@ parameters:
count: 2
path: ../../../htdocs/compta/sociales/class/cchargesociales.class.php
-
message: '#^Property Cchargesociales\:\:\$fk_pays \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 2
path: ../../../htdocs/compta/sociales/class/cchargesociales.class.php
-
message: '#^Property Cchargesociales\:\:\$libelle \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -69,47 +69,47 @@ class AccountancyCategory // extends CommonObject
public $id;
/**
* @var string Accountancy code
* @var ?string Accountancy code
*/
public $code;
/**
* @var string Accountancy Category label
* @var ?string Accountancy Category label
*/
public $label;
/**
* @var string Accountancy range account
* @var ?string Accountancy range account
*/
public $range_account;
/**
* @var int Sens of the account: 0: credit - debit, 1: debit - credit
* @var ?int Sens of the account: 0: credit - debit, 1: debit - credit
*/
public $sens;
/**
* @var int Category type of accountancy
* @var ?int Category type of accountancy
*/
public $category_type;
/**
* @var string Formula
* @var ?string Formula
*/
public $formula;
/**
* @var int Position
* @var ?int Position
*/
public $position;
/**
* @var int country id
* @var ?int country id
*/
public $fk_country;
/**
* @var int Is active
* @var ?int Is active
*/
public $active;

View file

@ -691,14 +691,15 @@ class Orders extends DolibarrApi
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$contacts = $this->commande->liste_contact();
foreach (array('internal', 'external') as $source) {
$contacts = $this->commande->liste_contact(-1, $source);
foreach ($contacts as $contact) {
if ($contact['id'] == $contactid && $contact['code'] == $type) {
$result = $this->commande->delete_contact($contact['rowid']);
foreach ($contacts as $contact) {
if ($contact['id'] == $contactid && $contact['code'] == $type) {
$result = $this->commande->delete_contact($contact['rowid']);
if (!$result) {
throw new RestException(500, 'Error when deleted the contact');
if (!$result) {
throw new RestException(500, 'Error when deleting the contact '.$contact['rowid']);
}
}
}
}

View file

@ -697,6 +697,9 @@ class Invoices extends DolibarrApi
if (!$result) {
throw new RestException(404, 'Invoice not found');
}
if ($this->invoice->status != 0) {
throw new RestException(403, 'Invoice not in Draft Status : '.$this->invoice->getLibStatut(1));
}
$updateRes = $this->invoice->deleteLine($lineid, $id);
if ($updateRes > 0) {

View file

@ -42,9 +42,10 @@
* @param int<-1,1> $ssl_verifypeer -1=Auto (no ssl check on dev, check on prod), 0=No ssl check, 1=Always ssl check
* @param int $timeoutconnect Timeout connect
* @param int $timeoutresponse Timeout response
* @param array<int, mixed> $otherCurlOptions Array of other curl options to set. Example: array(CURLOPT_SSL_VERIFYPEER => false)
* @return array{http_code:int,content:string,curl_error_no:int,curl_error_msg:string} Returns an associative array containing the response from the server array('http_code'=>http response code, 'content'=>response, 'curl_error_no'=>errno, 'curl_error_msg'=>errmsg...)
*/
function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = 1, $addheaders = array(), $allowedschemes = array('http', 'https'), $localurl = 0, $ssl_verifypeer = -1, $timeoutconnect = 0, $timeoutresponse = 0)
function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = 1, $addheaders = array(), $allowedschemes = array('http', 'https'), $localurl = 0, $ssl_verifypeer = -1, $timeoutconnect = 0, $timeoutresponse = 0, $otherCurlOptions = array())
{
// Get global variables for proxy use
$USE_PROXY = getDolGlobalInt('MAIN_PROXY_USE');
@ -194,6 +195,12 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
}
}
if (is_array($otherCurlOptions)) {
foreach ($otherCurlOptions as $option => $value) {
curl_setopt($ch, $option, $value);
}
}
$newUrl = $url;
$maxRedirection = 5;
$info = array();