Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into fix_phpstan_avai…
Browse files Browse the repository at this point in the history
…labilities
  • Loading branch information
frederic34 committed Dec 5, 2024
2 parents e26595b + c9a3908 commit 15af354
Show file tree
Hide file tree
Showing 144 changed files with 510 additions and 726 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/pr-18.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install GitHub CLI
run: |
Expand All @@ -36,7 +36,10 @@ jobs:
#REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
run: |
# shellcheck disable=2086
echo "GH_TOKEN=$GH_TOKEN"
# shellcheck disable=2086
pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH)
# shellcheck disable=2086
gh pr edit $pr_number --add-reviewer "$REVIEWER"
continue-on-error: true
342 changes: 0 additions & 342 deletions build/phpstan/phpstan-baseline.neon

Large diffs are not rendered by default.

43 changes: 9 additions & 34 deletions dev/tools/phan/baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
return [
// # Issue statistics:
// PhanUndeclaredProperty : 560+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 370+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 350+ occurrences
// PhanUndeclaredGlobalVariable : 300+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 230+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 180+ occurrences
// PhanTypeMismatchProperty : 140+ occurrences
// PhanPluginUnknownPropertyType : 130+ occurrences
// PhanPluginUnknownArrayMethodParamType : 120+ occurrences
// PhanPossiblyUndeclaredVariable : 110+ occurrences
// PhanPluginUnknownPropertyType : 120+ occurrences
// PhanPossiblyUndeclaredVariable : 80+ occurrences
// PhanPluginUndeclaredVariableIsset : 60+ occurrences
// PhanRedefineFunction : 45+ occurrences
// PhanTypeExpectedObjectPropAccess : 45+ occurrences
Expand All @@ -30,27 +30,26 @@ return [
// PhanTypeComparisonFromArray : 10+ occurrences
// PhanTypeMismatchDimFetchNullable : 10+ occurrences
// PhanUndeclaredMethod : 10+ occurrences
// PhanEmptyForeach : 9 occurrences
// PhanEmptyForeach : 8 occurrences
// PhanTypeArraySuspiciousNull : 8 occurrences
// PhanPluginBothLiteralsBinaryOp : 7 occurrences
// PhanPluginDuplicateExpressionBinaryOp : 7 occurrences
// PhanPluginSuspiciousParamPosition : 7 occurrences
// PhanTypeArraySuspiciousNull : 7 occurrences
// PhanPossiblyNullTypeMismatchProperty : 5 occurrences
// PhanParamTooMany : 4 occurrences
// PhanPluginDuplicateArrayKey : 4 occurrences
// PhanEmptyFQSENInClasslike : 3 occurrences
// PhanInvalidFQSENInClasslike : 3 occurrences
// PhanTypeMismatchReturn : 3 occurrences
// PhanPluginUnknownArrayPropertyType : 2 occurrences
// PhanTypeExpectedObjectPropAccessButGotNull : 2 occurrences
// PhanTypeMismatchDimAssignment : 2 occurrences
// PhanTypeSuspiciousStringExpression : 2 occurrences
// PhanAccessMethodProtected : 1 occurrence
// PhanPluginUnknownArrayPropertyType : 1 occurrence
// PhanTypeConversionFromArray : 1 occurrence

// Currently, file_suppressions and directory_suppressions are the only supported suppressions
'file_suppressions' => [
'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanUndeclaredProperty'],
'htdocs/adherents/list.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/adherents/type.php' => ['PhanTypeMismatchProperty'],
Expand Down Expand Up @@ -129,7 +128,6 @@ return [
'htdocs/compta/tva/clients.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'],
'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullableInternal'],
'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'],
'htdocs/contact/perso.php' => ['PhanTypeMismatchProperty'],
'htdocs/contrat/agenda.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/contrat/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/contrat/class/api_contracts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
Expand All @@ -138,26 +136,6 @@ return [
'htdocs/core/actions_printing.inc.php' => ['PhanUndeclaredProperty'],
'htdocs/core/actions_sendmails.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/core/ajax/ajaxdirtree.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/boxes/box_actions.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/boxes/box_actions_future.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/boxes/box_external_rss.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/boxes/box_graph_invoices_permonth.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/boxes/box_graph_invoices_supplier_permonth.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/boxes/box_graph_nb_tickets_type.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/boxes/box_graph_new_vs_close_ticket.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/boxes/box_graph_orders_permonth.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/boxes/box_graph_orders_supplier_permonth.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/boxes/box_graph_product_distribution.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/boxes/box_graph_propales_permonth.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/boxes/box_graph_ticket_by_severity.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/boxes/box_last_modified_ticket.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/boxes/box_last_ticket.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/boxes/box_project.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/boxes/box_project_opportunities.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/boxes/box_services_contracts.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/boxes/box_task.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/boxes/box_validated_projects.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/class/canvas.class.php' => ['PhanParamTooMany', 'PhanUndeclaredMethod'],
'htdocs/core/class/ccountry.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/cgenericdic.class.php' => ['PhanUndeclaredProperty'],
Expand Down Expand Up @@ -353,7 +331,6 @@ return [
'htdocs/fourn/paiement/document.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/ftp/admin/ftpclient.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/ftp/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/holiday/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/holiday/card_group.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/holiday/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/holiday/view_log.php' => ['PhanTypeMismatchDimFetch'],
Expand Down Expand Up @@ -388,7 +365,7 @@ return [
'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanUndeclaredProperty'],
'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/knowledgemanagement/knowledgerecord_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/loan/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/loan/card.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/loan/document.php' => ['PhanUndeclaredProperty'],
'htdocs/loan/note.php' => ['PhanUndeclaredProperty'],
'htdocs/loan/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
Expand All @@ -407,7 +384,7 @@ return [
'htdocs/opcachepreload.php' => ['PhanEmptyForeach'],
'htdocs/opensurvey/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/opensurvey/class/opensurveysondage.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/opensurvey/list.php' => ['PhanEmptyForeach', 'PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/opensurvey/list.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/opensurvey/results.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'],
'htdocs/opensurvey/wizard/choix_date.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/opensurvey/wizard/create_survey.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
Expand All @@ -418,7 +395,7 @@ return [
'htdocs/partnership/partnership_list.php' => ['PhanUndeclaredProperty'],
'htdocs/printing/index.php' => ['PhanUndeclaredProperty'],
'htdocs/product/admin/product.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/product/ajax/products.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/product/ajax/products.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/product/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/product/class/api_products.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
'htdocs/product/class/html.formproduct.class.php' => ['PhanUndeclaredProperty'],
Expand Down Expand Up @@ -567,14 +544,12 @@ return [
'htdocs/theme/eldy/btn.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/eldy/dropdown.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/eldy/flags-sprite.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/eldy/info-box.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/eldy/main_menu_fa_icons.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/eldy/progress.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/md/badges.inc.php' => ['PhanRedefineFunction'],
'htdocs/theme/md/btn.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/theme/md/dropdown.inc.php' => ['PhanUndeclaredGlobalVariable'],
'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' => ['PhanUndeclaredProperty'],
'htdocs/ticket/class/actions_ticket.class.php' => ['PhanUndeclaredProperty'],
Expand Down
4 changes: 2 additions & 2 deletions htdocs/adherents/class/adherent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class Adherent extends CommonObject


/**
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
Expand Down Expand Up @@ -3108,7 +3108,7 @@ public function sendReminderForExpiredSubscription($daysbeforeendlist = '10', $f
$listofmembersko[$adherent->id] = $adherent->id;
} else {
$thirdpartyres = $adherent->fetch_thirdparty();
if ($thirdpartyres === -1 ) {
if ($thirdpartyres === -1) {
$languagecodeformember = $mysoc->default_lang;
} else {
// Language code to use ($languagecodeformember) is default language of thirdparty, if no thirdparty, the language found from country of member then country of thirdparty, and if still not found we use the language of company.
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/class/subscription.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class Subscription extends CommonObject
public $fk_bank;

/**
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
Expand Down
12 changes: 6 additions & 6 deletions htdocs/asset/class/asset.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ class Asset extends CommonObject
*/

/**
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'noteditable' => 0, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => "Reference of object"),
'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => '2', 'validate' => 1,),
'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,),
'fk_asset_model' => array('type' => 'integer:AssetModel:asset/class/assetmodel.class.php:1:((status:=:1) and (entity:IN:__SHARED_ENTITIES__))', 'label' => 'AssetModel', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => 1,),
'qty' => array('type' => 'real', 'label' => 'Qty', 'enabled' => 1, 'position' => 50, 'notnull' => 1, 'visible' => 0, 'default' => '1', 'isameasure' => 1, 'css' => 'maxwidth75imp', 'validate' => 1,),
'acquisition_type' => array('type' => 'smallint', 'label' => 'AssetAcquisitionType', 'enabled' => 1, 'position' => 60, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array('0' => 'AssetAcquisitionTypeNew', '1' => 'AssetAcquisitionTypeOccasion'), 'validate' => 1,),
'asset_type' => array('type' => 'smallint', 'label' => 'AssetType', 'enabled' => 1, 'position' => 70, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array('0' => 'AssetTypeIntangible', '1' => 'AssetTypeTangible', '2' => 'AssetTypeInProgress', '3' => 'AssetTypeFinancial'), 'validate' => 1,),
'acquisition_type' => array('type' => 'smallint', 'label' => 'AssetAcquisitionType', 'enabled' => 1, 'position' => 60, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetAcquisitionTypeNew', 1 => 'AssetAcquisitionTypeOccasion'), 'validate' => 1,),
'asset_type' => array('type' => 'smallint', 'label' => 'AssetType', 'enabled' => 1, 'position' => 70, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetTypeIntangible', 1 => 'AssetTypeTangible', 2 => 'AssetTypeInProgress', 3 => 'AssetTypeFinancial'), 'validate' => 1,),
'not_depreciated' => array('type' => 'boolean', 'label' => 'AssetNotDepreciated', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'default' => '0', 'visible' => 1, 'validate' => 1,),
'date_acquisition' => array('type' => 'date', 'label' => 'AssetDateAcquisition', 'enabled' => 1, 'position' => 90, 'notnull' => 1, 'visible' => 1,),
'date_start' => array('type' => 'date', 'label' => 'AssetDateStart', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => -1,),
Expand All @@ -115,7 +115,7 @@ class Asset extends CommonObject
'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => 0,),
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'position' => 1010, 'notnull' => -1, 'visible' => 0,),
'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '0', 'visible' => 2, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '9' => 'Canceled'), 'validate' => 1,),
'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '0', 'visible' => 2, 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 9 => 'Canceled'), 'validate' => 1,),
);

/**
Expand Down Expand Up @@ -1114,7 +1114,7 @@ public function calculationDepreciation()
} else {
$nb_days = min($nb_days_in_year, $nb_days_real);
}
$depreciation_ht = (double) price2num($period_amount * $nb_days / $nb_days_in_year, 'MT');
$depreciation_ht = (float) price2num($period_amount * $nb_days / $nb_days_in_year, 'MT');
}
if (getDolGlobalInt('ASSET_ROUND_INTEGER_NUMBER_UPWARDS') == 1) {
if ($idx_loop < $max_loop) { // avoid last depreciation value
Expand Down
Loading

0 comments on commit 15af354

Please sign in to comment.