Commit Graph

1366 Commits

Author SHA1 Message Date
Laurent Destailleur
4cd2e572ae Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2024-11-13 00:30:26 +01:00
uvaldenaire-opendsi
0eee1ad18b Qual: remove php 8.2 warnings by casting trim() argument to string. (#28162) (#31693)
In create and update methods of societe class, the trim function triggered warnings when the argument passed is null.
Cast string properties to string to avoid php warnings when the property is null.

Co-authored-by: UltraViolet33 <93035200+UltraViolet33@users.noreply.github.com>
2024-11-12 19:45:52 +01:00
Laurent Destailleur
ce8c70450c FIX Merge of thirdparties must also move uploaded files 2024-04-23 22:28:15 +02:00
Laurent Destailleur
0ecc442622 Fix merge thirdparties 2024-04-23 22:21:09 +02:00
Laurent Destailleur
2252cf0783 FIX Merge of thirdparties must also move uploaded files 2024-04-23 22:16:44 +02:00
Laurent Destailleur
404ba88107 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2024-04-04 11:19:45 +02:00
Alexandre SPANGARO
a8771d03bd Use getDolGlobalString 2024-03-26 17:30:02 +01:00
Alexandre SPANGARO
049beb9bf8 NEW Constant to select if typent helps define whether the thirdparty is a company 2024-03-26 17:28:26 +01:00
Can Arslan
7112c5a782 FIX: PHP Warning: Undefined variable $lib (#28342) 2024-02-22 02:42:57 +01:00
Laurent Destailleur
e4365c15c6 Fix missing table llx_societe_account into the merge 2024-02-06 11:50:02 +01:00
Laurent Destailleur
1b58a37cf5 Fix label of prospect 2024-01-29 13:41:51 +01:00
Laurent Destailleur
cca01cbda4 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-01-23 22:15:36 +01:00
Laurent Destailleur
b05d1c5f6e Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-01-23 22:03:28 +01:00
Laurent Destailleur
9d40711723 Fix type of prospect level 2024-01-19 16:25:46 +01:00
Florian HENRY
d04cfa89ce FIX: filter by entity on contact is missing 2024-01-19 09:15:30 +01:00
Laurent Destailleur
b28ae5d8d3 Clean code 2023-12-27 12:12:20 +01:00
Laurent Destailleur
a767028464 Clean code 2023-12-20 21:35:23 +01:00
Laurent Destailleur
1f738e5a7b Clean code 2023-12-19 17:46:39 +01:00
Laurent Destailleur
7f5df80efd Debug v19 2023-12-19 11:51:48 +01:00
Laurent Destailleur
98009ea6be Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts:
	ChangeLog
	htdocs/compta/bank/class/account.class.php
	htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
	htdocs/langs/en_US/recruitment.lang
	htdocs/master.inc.php
	htdocs/projet/contact.php
2023-12-17 22:17:14 +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
tnegre
9aa1b32c07 Manage ref_alias for fetch societe 2023-12-11 09:54:50 +01:00
Frédéric FRANCE
61b79fda17 avoid phpstan error with phpdoc 2023-12-06 15:46:39 +01:00
Frédéric FRANCE
53c8a3acf8 clean phpdoc for phpstan (#26905) 2023-12-01 19:51:32 +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
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
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
Maxime Kohlhaas
373a1d544c NEW : add IdProfCheck on thirdparty for BE (xxxx.xxx.xxx) 2023-09-20 18:14:55 +02:00
Laurent Destailleur
91fa48199a Fix warnings 2023-09-10 17:41:22 +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