Commit Graph

1866 Commits

Author SHA1 Message Date
Laurent Destailleur
d92c65ad91 FIX infinite loop in API call/trigger by adding a caller 2023-12-15 12:15:33 +01:00
Laurent Destailleur
fb083a6cfc Fix warning with rector 2023-12-13 16:33:17 +01:00
Laurent Destailleur
e040219fdc Fix phpcs 2023-12-13 12:45:07 +01:00
Frédéric FRANCE
61b79fda17 avoid phpstan error with phpdoc 2023-12-06 15:46:39 +01:00
Frédéric FRANCE
91d8758e52
fix phpstan 2023-12-02 22:28:04 +01:00
Laurent Destailleur
c30cb9c14f
Merge pull request #26932 from matthieu-michou-wattandsea/patch-3
Update api_thirdparties.class.php
2023-12-02 21:18:24 +01:00
matthieu-michou-wattandsea
71a1c6a497
Update api_thirdparties.class.php
fix API REST changed POST to PUT in thirdparties addCategory
2023-12-02 10:30:01 +01:00
matthieu-michou-wattandsea
ff995afd1e
Update api_contacts.class.php
fix API REST addCategory
2023-12-02 10:20:38 +01:00
Frédéric FRANCE
53c8a3acf8
clean phpdoc for phpstan (#26905) 2023-12-01 19:51:32 +01:00
Laurent Destailleur
3a78357253 Try an implementation a fix to avoid infinite loop in sync api - trigger 2023-11-29 16:20:37 +01:00
Laurent Destailleur
56e8872ddc Clean code+warnings: The delete() method of AdherentType, Contact,
Delivery, MultiCurrency, CurrencyRate now need $user as first parameter.
2023-11-28 15:33:42 +01:00
Pascal Hubrecht
f1e384cc51
FIX #26881 (#26883) 2023-11-28 11:30:48 +01:00
Laurent Destailleur
075ee02901 Fix php8.2 warnings 2023-11-27 12:08:48 +01:00
Laurent Destailleur
ed122e5408 Clean depracted table 2023-11-20 17:46:57 +01:00
Laurent Destailleur
07a3774749 Debug v19 2023-11-17 23:44:02 +01:00
Laurent Destailleur
6ca0154784 Fix management of password type with pass_crypted 2023-11-17 22:09:35 +01:00
Laurent Destailleur
a48e541093 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts:
	htdocs/accountancy/class/bookkeeping.class.php
	htdocs/accountancy/journal/expensereportsjournal.php
	htdocs/core/class/html.formadmin.class.php
	htdocs/core/lib/functions.lib.php
2023-11-12 23:18:19 +01:00
Laurent Destailleur
2f340a1a77 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0
Conflicts:
	htdocs/accountancy/journal/expensereportsjournal.php
	htdocs/comm/propal/card.php
2023-11-12 23:06:31 +01:00
Laurent Destailleur
3118b9fb4c Debug v19 2023-11-09 15:50:42 +01:00
Florian Mortgat
835cf9bbc7
FIX v17: Param $notrigger in $societe->create() causes method to return true regardless of actual result of database functions (#26499) 2023-11-07 19:02:18 +01:00
Laurent Destailleur
774cfce57b Fix must update facture_fourn_rec when merging thirdparties 2023-10-31 18:15:15 +01:00
Alexandre Janniaux
c3b3840f08
QUAL Refactor merging companies and fix #26272 with Reception objects (#26320)
* societe: add missing model_pdf field

The field is used by the class but wasn't declared.

* societe: expose Societe::mergeCompany

The code is directly copied from societe/card.php with as less changes
as possible.

The original code came from deb91ad7c1.

* societe: remove fields from property copy

$phone_pro and $fk_project are not existing for societe. This was added
from deb91ad7c1.

* SocieteTest: test the merge functionality

This test is a simple smoke test to check that the mergeCompany() will
work correctly on simple case and actually merge the details of the
company.

More complex deduplication pattern with objects referencing the deleted
Societe object, will be written for each of the different object class
in their respective test file.

* societe: card: use the new mergeCompany function

Since the code is almost the same, there should be no differences in
behaviour right now.

* societe: api_thirdparties: use Societe::mergeCompany()

* societe: fix issue when merging companies

When a Societe object is merged against another, its related objects are
supposed to reference the new Societe object so that the databse doesn't
raise foreign key errors.

The list references the objects that need to be transformed, and
Reception objects weren't part of this list.

Fix #26272

* ReceptionTest: check company merge hook

Before a Societe object is destroyed from the database, every object
referencing the FK should be destroyed or should reference another
object.

In the case of two companies being merged, the case arises and Reception
objects need to be moved to the new company. This commit brings a
non-regression test for this case.

Refs #26272

* Update societe.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2023-10-26 16:30:38 +02:00
Laurent Destailleur
a318031034 QUAL Standardize code. Renamed ID of user properties into ->user_xxx_id 2023-10-24 11:37:29 +02:00
Alexandre Janniaux
9fe9eee18a
FIX|Fix some minor issues on Reception and add a new test for it (#26310)
* reception: reOpen: mirror $this->statut in $this->status

$this->statut is the deprecated variable, $this->status should also get
the correct value.

* reception: setDraft: mirror $this->statut in $this->status

$this->statut is the deprecated variable, $this->status should also get
the correct value.

* reception: add missing $weight field

Fix warning:

    Undefined property: Reception::$weight

* societe: add country_id field

* reception: use getDolGlobalInt when suitable

Using empty() implies that the value actually exists on the stdClass at
$conf->global, but it's not always the case. getDolGlobalInt will handle
this smoothly by checking first, which solves warnings like those:

    Undefined property: stdClass::$STOCK_CALCULATE_ON_RECEPTION

* ReceptionTest: add new test

The test checks the usual workflow of the Reception class, with, on the
one hand, the common CRUD operations:
 - create
 - fetch
 - update
 - delete

And on the other hand, the status handling for Reception:
 - valid: STATUS_DRAFT -> STATUS_VALID
 - setClosed: STATUS_VALID -> STATUS_CLOSED
 - reOpen: STATUS_CLOSED -> STATUS_VALID
 - setDraft: STATUS_VALID -> STATUS_DRAFT

The stocks lines are not tested yet, and the error cases, like any other
transition not described above, are not tested either. The permissions
for some of the operations are hardcoded for the test and there is no
failure check when the permission is not set yet.
2023-10-21 16:28:30 +02:00
Laurent Destailleur
3ce02f1181 Debug v19 2023-10-18 18:37:00 +02:00
Laurent Destailleur
2cfa9f8290 Debug v19 2023-10-17 15:43:56 +02:00
Laurent Destailleur
b8c8e903c2 Fix php8.2 warnings 2023-10-15 18:39:13 +02:00
Laurent Destailleur
df454003da FIX php8.2 2023-10-09 15:44:57 +02:00
Dev2a
fcd4c4e429 Fix: Change access to $conf->global to function getDolGlobal (automatique) 2023-10-08 23:19:49 +02:00
Laurent Destailleur
d3dc6615db Remove deprecated use of ->modelpdf (good is ->model_pdf) 2023-10-02 21:49:08 +02:00
Laurent Destailleur
7bbc3bab05 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop 2023-09-27 17:17:41 +02:00
Regis Houssin
be9adbec41 FIX uniformize getEntity sql request 2023-09-27 00:05:36 +02:00
pascal
80f060c771 fix tab indentation 2023-09-26 18:43:25 +02:00
pascal
871f896962 implementation of properties filter 2023-09-26 18:04:48 +02:00
Maxime Kohlhaas
373a1d544c NEW : add IdProfCheck on thirdparty for BE (xxxx.xxx.xxx) 2023-09-20 18:14:55 +02:00
VESSILLER
30f907cf17 Update from develop 2023-09-12 14:25:04 +02:00
Laurent Destailleur
fb02c41105 Clean code and remove warnings 2023-09-11 11:28:30 +02:00
Laurent Destailleur
91fa48199a Fix warnings 2023-09-10 17:41:22 +02:00
Laurent Destailleur
bc71380410 Fix sql errors 2023-09-09 21:16:58 +02:00
Laurent Destailleur
9ce32c0213 Merge branch
'develop_add_all_id_prof_checker_for_code_compta_customer_and_supplier'
of https://github.com/OPEN-DSI/dolibarr into
OPEN-DSI-develop_add_all_id_prof_checker_for_code_compta_customer_and_supplier
2023-09-09 12:08:41 +02:00
Laurent Destailleur
c6dbb3d434
Merge branch 'develop' into dev_sign_soeciete_rib 2023-09-09 11:55:30 +02:00
Laurent Destailleur
aab30d7638 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop 2023-09-08 15:33:04 +02:00
Laurent Destailleur
99406caa3a Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2023-09-08 15:26:21 +02:00
Laurent Destailleur
ef01b6a1e9 Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0 2023-09-08 14:32:28 +02:00
Frédéric FRANCE
26dff90658 deprecate set_as_client 2023-09-06 14:38:35 +02:00
Maxime Kohlhaas
7a51977cbd Fix missing 2023-09-06 08:47:31 +02:00
Florian HENRY
36f051617d fix syntax 2023-08-28 15:38:33 +02:00
HENRY Florian
a283c6f30c
Merge branch 'develop' into dev_sign_soeciete_rib 2023-08-28 15:18:30 +02:00
Laurent Destailleur
b49c326824 Clean deprecated code on old fields skype, twitter, ... 2023-08-26 10:57:49 +02:00
Laurent Destailleur
038e50ce84 Add the external system payment name in list of fields for payment modes 2023-08-22 11:31:57 +02:00