Skip to content

Commit

Permalink
Merge branch 'develop' of [email protected]:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
eldy committed Oct 19, 2024
2 parents 2e12ab4 + a181031 commit 9c98321
Show file tree
Hide file tree
Showing 156 changed files with 2,398 additions and 1,299 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ NEW value for FICHINTER_DISABLE_DETAILS. If FICHINTER_DISABLE_DETAILS is set to

For developers:
---------------

QUAL line classes for various business object classes have been moved to individual files.


WARNING:
Expand Down
45 changes: 18 additions & 27 deletions dev/tools/phan/baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@
*/
return [
// # Issue statistics:
// PhanUndeclaredProperty : 800+ occurrences
// PhanUndeclaredProperty : 770+ occurrences
// PhanPluginUnknownPropertyType : 710+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 600+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 410+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 400+ occurrences
// PhanUndeclaredGlobalVariable : 380+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 310+ occurrences
// PhanPluginUnknownArrayMethodParamType : 260+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 300+ occurrences
// PhanPluginUnknownArrayMethodParamType : 250+ occurrences
// PhanPossiblyUndeclaredVariable : 200+ occurrences
// PhanTypeMismatchProperty : 170+ occurrences
// PhanPluginUnknownArrayFunctionParamType : 95+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 70+ occurrences
// PhanPluginUndeclaredVariableIsset : 65+ occurrences
// PhanPluginUnknownArrayPropertyType : 60+ occurrences
// PhanPluginUnknownArrayPropertyType : 55+ occurrences
// PhanPluginUnknownArrayFunctionReturnType : 50+ occurrences
// PhanRedefineFunction : 50+ occurrences
// PhanPluginEmptyStatementIf : 45+ occurrences
// PhanTypeMismatchDimFetch : 40+ occurrences
// PhanTypeExpectedObjectPropAccess : 25+ occurrences
// PhanTypeInvalidDimOffset : 25+ occurrences
// PhanTypeExpectedObjectPropAccess : 40+ occurrences
// PhanTypeInvalidDimOffset : 35+ occurrences
// PhanTypeMismatchDimFetch : 30+ occurrences
// PhanPluginUnknownObjectMethodCall : 15+ occurrences
// PhanTypeComparisonFromArray : 15+ occurrences
// PhanUndeclaredConstant : 15+ occurrences
Expand All @@ -52,8 +52,6 @@ return [
'file_suppressions' => [
'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanUndeclaredProperty'],
'htdocs/accountancy/class/accountingjournal.class.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/accountancy/journal/purchasesjournal.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/adherents/list.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/admin/fckeditor.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/api/class/api_access.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'],
Expand Down Expand Up @@ -210,7 +208,7 @@ return [
'htdocs/compta/tva/index.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullableInternal'],
'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'],
'htdocs/contact/canvas/actions_contactcard_common.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousNonTraversableForeach'],
'htdocs/contact/canvas/actions_contactcard_common.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'],
'htdocs/contact/card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/contact/class/contact.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'],
'htdocs/contact/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
Expand Down Expand Up @@ -360,19 +358,16 @@ return [
'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/commande/modules_commande.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgumentNullableInternal'],
'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/delivery/mod_delivery_saphir.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/expedition/doc/pdf_espadon.modules.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/core/modules/facture/doc/pdf_crabe.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/facture/modules_facture.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/fichinter/mod_pacific.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanUndeclaredProperty'],
Expand All @@ -395,7 +390,6 @@ return [
'htdocs/core/modules/printsheet/modules_labels.php' => ['PhanParamTooMany'],
'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/project/doc/pdf_baleine.modules.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
Expand All @@ -408,10 +402,10 @@ return [
'htdocs/core/modules/societe/mod_codecompta_digitaria.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
Expand Down Expand Up @@ -743,7 +737,6 @@ return [
'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/public/test/test_forms.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/public/ticket/create_ticket.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty'],
'htdocs/public/ticket/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/public/ticket/view.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/public/webportal/webportal.main.inc.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction'],
Expand Down Expand Up @@ -790,7 +783,6 @@ return [
'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/societe/ajax/ajaxcompanies.php' => ['PhanUndeclaredProperty'],
'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/societe/card.php' => ['PhanTypeMismatchProperty'],
'htdocs/societe/checkvat/checkVatPopup.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/societe/class/api_contacts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
Expand Down Expand Up @@ -835,13 +827,12 @@ return [
'htdocs/theme/md/flags-sprite.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/md/info-box.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/md/progress.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/ticket/card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/ticket/card.php' => ['PhanUndeclaredProperty'],
'htdocs/ticket/class/actions_ticket.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/ticket/class/api_tickets.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/ticket/class/api_tickets.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/ticket/class/cticketcategory.class.php' => ['PhanUndeclaredProperty'],
'htdocs/ticket/class/ticket.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/ticket/class/ticket.class.php' => ['PhanUndeclaredProperty'],
'htdocs/ticket/class/ticketstats.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/ticket/contact.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/ticket/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/ticket/list.php' => ['PhanTypeComparisonFromArray'],
'htdocs/ticket/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
Expand Down
2 changes: 1 addition & 1 deletion dev/tools/phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
'exclude_file_regex' => '@^(' // @phpstan-ignore-line
.'dummy' // @phpstan-ignore-line
// mymodule seen in cti, but not in git.
.'|htdocs/custom/mymodule/.*' // @phpstan-ignore-line
.'|htdocs/custom/.*' // Ignore all custom modules @phpstan-ignore-line
.'|htdocs/.*/canvas/.*/tpl/.*.tpl.php' // @phpstan-ignore-line
//.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line
// Included as stub (better analysis)
Expand Down
36 changes: 6 additions & 30 deletions htdocs/accountancy/class/accountancysystem.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* Class to manage accountancy systems
*/
class AccountancySystem
class AccountancySystem extends CommonObject
{
/**
* @var DoliDB Database handler.
Expand Down Expand Up @@ -58,17 +58,13 @@ class AccountancySystem
public $rowid;

/**
* @var int ID
*/
public $fk_pcg_version;

/**
* @var int pcg version
* @var string Accountancy system code
*/
public $pcg_version;

/**
* @var string ref
* @var string Ref of accountancy system. Duplicate property with ->pcg_version.
* @see $pcg_version
*/
public $ref;

Expand All @@ -77,31 +73,11 @@ class AccountancySystem
*/
public $active;

/**
* @var string pcg type
*/
public $pcg_type;

/**
* @var string Accountancy System numero
*/
public $numero;

/**
* @var string Accountancy System label
*/
public $label;

/**
* @var string account number
*/
public $account_number;

/**
* @var string account parent
*/
public $account_parent;

/**
* Constructor
*
Expand Down Expand Up @@ -190,12 +166,12 @@ public function create($user)
$result = $this->rowid;
} else {
$result = - 2;
$this->error = "AccountancySystem::Create Error $result";
$this->error = "AccountancySystem::Create Error $result: " . $this->db->lasterror();
dol_syslog($this->error, LOG_ERR);
}
} else {
$result = - 1;
$this->error = "AccountancySystem::Create Error $result";
$this->error = "AccountancySystem::Create Error $result: " . $this->db->lasterror();
dol_syslog($this->error, LOG_ERR);
}

Expand Down
17 changes: 17 additions & 0 deletions htdocs/accountancy/journal/sellsjournal.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,23 @@
'code_compta' => $compta_soc
);

// After the line is processed
$parameters = array(
'obj' => $obj,
'tabfac' => &$tabfac,
'tabht' => &$tabht,
'tabtva' => &$tabtva,
'def_tva' => &$def_tva,
'tabwarranty' => &$tabwarranty,
'tabrevenuestamp' => &$tabrevenuestamp,
'tabttc' => &$tabttc,
'tablocaltax1' => &$tablocaltax1,
'tablocaltax2' => &$tablocaltax2,
'tabcompany' => &$tabcompany,
'vatdata_cache' => &$vatdata_cache,
);
$reshook = $hookmanager->executeHooks('processingJournalData', $parameters); // Note that $action and $object may have been modified by hook

$i++;

// Check for too many lines.
Expand Down
5 changes: 4 additions & 1 deletion htdocs/comm/mailing/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@

$trackid = 'emailing-test';
$upload_dir_tmp = $upload_dir;
$mailfile = new CMailFile($tmpsujet, $object->sendto, $object->email_from, $tmpbody, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $object->email_errorsto, $arr_css, $trackid, '', 'emailing', '', $upload_dir_tmp);
$mailfile = new CMailFile($tmpsujet, $object->sendto, $object->email_from, $tmpbody, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $object->email_errorsto, $arr_css, $trackid, '', 'emailing', $object->email_replyto, $upload_dir_tmp);

$result = $mailfile->sendfile();
if ($result) {
Expand Down Expand Up @@ -833,6 +833,8 @@

print '<tr class="fieldsforemail"><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.getDolGlobalString('MAILING_EMAIL_ERRORSTO', getDolGlobalString('MAIN_MAIL_ERRORS_TO')).'"></td></tr>';

print '<tr class="fieldsforemail"><td>'.$langs->trans("MailReply").'</td><td><input class="flat minwidth200" name="replyto" value="'.getDolGlobalString('MAILING_EMAIL_REPLYTO', getDolGlobalString('MAIN_MAIL_REPLY_TO')).'"></td></tr>';

// Other attributes
$parameters = array();
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
Expand Down Expand Up @@ -1377,6 +1379,7 @@
// To
if ($object->messtype != 'sms') {
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td>'.dol_print_email($object->email_errorsto, 0, 0, 0, 0, 1).'</td></tr>';
print '<tr><td>'.$langs->trans("MailReply").'</td><td>'.dol_print_email($object->email_replyto, 0, 0, 0, 0, 1).'</td></tr>';
}

print '</table>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,7 @@
$productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
} else {
$generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
$generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
$generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
}

if ($reliquat > $generic_product->stock_reel) {
Expand Down
Loading

0 comments on commit 9c98321

Please sign in to comment.