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

This commit is contained in:
Laurent Destailleur 2024-10-26 13:53:12 +02:00
commit e295ee48fc
70 changed files with 676 additions and 355 deletions

View file

@ -14,39 +14,40 @@ return [
// PhanPossiblyUndeclaredGlobalVariable : 580+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 400+ occurrences
// PhanUndeclaredGlobalVariable : 350+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 300+ occurrences
// PhanPluginUnknownArrayMethodParamType : 240+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 290+ occurrences
// PhanPluginUnknownArrayMethodParamType : 220+ occurrences
// PhanPossiblyUndeclaredVariable : 200+ occurrences
// PhanTypeMismatchProperty : 160+ occurrences
// PhanTypeMismatchProperty : 170+ occurrences
// PhanPluginUnknownArrayFunctionParamType : 95+ occurrences
// PhanPluginUndeclaredVariableIsset : 65+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 65+ occurrences
// PhanPluginUnknownArrayPropertyType : 55+ occurrences
// PhanPluginUnknownArrayFunctionReturnType : 50+ occurrences
// PhanRedefineFunction : 50+ occurrences
// PhanPluginEmptyStatementIf : 45+ occurrences
// PhanPluginUnknownArrayPropertyType : 40+ occurrences
// PhanTypeExpectedObjectPropAccess : 40+ occurrences
// PhanTypeInvalidDimOffset : 35+ occurrences
// PhanTypeMismatchDimFetch : 30+ occurrences
// PhanPluginUnknownObjectMethodCall : 15+ occurrences
// PhanUndeclaredConstant : 15+ occurrences
// PhanUndeclaredMethod : 15+ occurrences
// PhanEmptyForeach : 10+ occurrences
// PhanPluginConstantVariableNull : 10+ occurrences
// PhanPossiblyNullTypeMismatchProperty : 10+ occurrences
// PhanTypeArraySuspiciousNull : 10+ occurrences
// PhanTypeComparisonFromArray : 10+ occurrences
// PhanTypeMismatchDimFetchNullable : 10+ occurrences
// PhanUndeclaredMethod : 10+ occurrences
// PhanPluginSuspiciousParamPosition : 9 occurrences
// PhanPluginBothLiteralsBinaryOp : 8 occurrences
// PhanPluginSuspiciousParamPosition : 8 occurrences
// PhanPluginDuplicateExpressionBinaryOp : 7 occurrences
// PhanPossiblyNullTypeMismatchProperty : 6 occurrences
// PhanPossiblyNullTypeMismatchProperty : 7 occurrences
// PhanParamTooMany : 5 occurrences
// PhanPluginDuplicateArrayKey : 4 occurrences
// PhanEmptyFQSENInClasslike : 3 occurrences
// PhanInvalidFQSENInClasslike : 3 occurrences
// PhanTypeExpectedObjectPropAccessButGotNull : 2 occurrences
// PhanAccessMethodProtected : 1 occurrence
// PhanParamTooFew : 1 occurrence
// PhanTypeConversionFromArray : 1 occurrence
// Currently, file_suppressions and directory_suppressions are the only supported suppressions
@ -62,8 +63,7 @@ return [
'htdocs/api/class/api_status.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/asset/admin/setup.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/asset/class/assetaccountancycodes.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'],
'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanTypeInvalidDimOffset'],
'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'],
'htdocs/asset/depreciation.php' => ['PhanPluginEmptyStatementIf'],
'htdocs/asset/disposal.php' => ['PhanPluginEmptyStatementIf'],
@ -78,7 +78,6 @@ return [
'htdocs/bom/bom_card.php' => ['PhanUndeclaredProperty'],
'htdocs/bom/bom_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/bom/class/api_boms.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/bom/class/bom.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/bom/tpl/objectline_edit.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/bom/tpl/objectline_view.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/bookcal/availabilities_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
@ -99,7 +98,6 @@ return [
'htdocs/comm/action/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/class/api_agendaevents.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/class/cactioncomm.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/comm/action/class/ical.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'],
'htdocs/comm/action/document.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/comm/action/index.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayFunctionParamType', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/info.php' => ['PhanUndeclaredProperty'],
@ -108,14 +106,10 @@ return [
'htdocs/comm/action/peruser.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanTypeComparisonFromArray'],
'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/comm/mailing/cibles.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/comm/mailing/class/advtargetemailing.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'],
'htdocs/comm/mailing/class/html.formadvtargetemailing.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/comm/mailing/class/mailing.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/comm/mailing/index.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/propal/card.php' => ['PhanTypeMismatchProperty'],
'htdocs/comm/propal/class/api_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/comm/propal/class/propal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/comm/propal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/comm/propal/list.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/commande/class/commande.class.php' => ['PhanUndeclaredProperty'],
@ -128,9 +122,8 @@ return [
'htdocs/compta/bank/annuel.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/bank/bankentries_list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/bank/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/bank/class/account.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/compta/bank/class/account.class.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/bank/class/api_bankaccounts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/bank/class/bankcateg.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/compta/bank/graph.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/bank/line.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/bank/releve.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
@ -144,15 +137,12 @@ return [
'htdocs/compta/cashcontrol/cashcontrol_list.php' => ['PhanTypeMismatchProperty'],
'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullableInternal'],
'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/deplacement/class/deplacement.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/compta/deplacement/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/facture/agenda-rec.php' => ['PhanPluginEmptyStatementIf'],
'htdocs/compta/facture/card.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/facture/class/facture.class.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/facture/class/facturestats.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/compta/facture/class/paymentterm.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/compta/facture/contact.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/invoicetemplate_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
@ -164,23 +154,19 @@ return [
'htdocs/compta/journal/purchasesjournal.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/journal/sellsjournal.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/localtax/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/localtax/class/localtax.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/localtax/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/localtax/index.php' => ['PhanRedefineFunction'],
'htdocs/compta/localtax/list.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/paiement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetch'],
'htdocs/compta/paiement/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/compta/paiement/cheque/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/paiement/cheque/class/remisecheque.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredMethod'],
'htdocs/compta/paiement/cheque/list.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/paiement/class/cpaiement.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/compta/paiement/class/paiement.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/paiement/cheque/list.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/paiement/class/paiement.class.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/compta/paiement/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/paiement_charge.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/paiement_vat.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/payment_vat/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/prelevement/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/prelevement/class/rejetprelevement.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty'],
'htdocs/compta/prelevement/demandes.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/prelevement/factures.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/prelevement/line.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
@ -190,8 +176,6 @@ return [
'htdocs/compta/resultat/index.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/resultat/result.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/sociales/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'],
'htdocs/compta/sociales/class/cchargesociales.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'],
'htdocs/compta/sociales/class/paymentsocialcontribution.class.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/sociales/list.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/compta/sociales/payments.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/stats/byratecountry.php' => ['PhanPluginEmptyStatementIf'],
@ -203,15 +187,12 @@ return [
'htdocs/compta/stats/supplier_turnover_by_prodserv.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/stats/supplier_turnover_by_thirdparty.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/tva/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/compta/tva/class/tva.class.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/tva/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
'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'],
'htdocs/contact/card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/contact/class/contact.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'],
'htdocs/contact/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/contact/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/contact/perso.php' => ['PhanTypeMismatchProperty'],
@ -258,14 +239,13 @@ return [
'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' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/core/class/cgenericdic.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/core/class/commonhookactions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'],
'htdocs/core/class/ccountry.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/cgenericdic.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/commonhookactions.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanUndeclaredProperty'],
'htdocs/core/class/commonorder.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/class/commonpeople.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/commonsocialnetworks.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/commonstickergenerator.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'],
'htdocs/core/class/conf.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchProperty'],
'htdocs/core/class/ctypent.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/class/ctyperesource.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
@ -354,7 +334,7 @@ return [
'htdocs/core/modules/barcode/modules_barcode.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/cheque/doc/pdf_blochet.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanUndeclaredMethod'],
'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanParamTooFew', 'PhanPluginSuspiciousParamPosition'],
'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'],
@ -377,7 +357,7 @@ return [
'htdocs/core/modules/mailings/modules_mailings.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'],
'htdocs/core/modules/mailings/thirdparties.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/member/doc/doc_generic_member_odt.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/member/doc/pdf_standard_member.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/core/modules/member/doc/pdf_standard_member.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchProperty'],
'htdocs/core/modules/member/modules_cards.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
@ -385,8 +365,8 @@ return [
'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/core/modules/printing/modules_printing.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/printing/printgcp.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'],
'htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchProperty'],
'htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchProperty'],
'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'],
@ -781,6 +761,7 @@ return [
'htdocs/societe/class/api_contacts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/societe/class/client.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/societe/class/societe.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/societe/class/societeaccount.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/societe/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],

View file

@ -223,6 +223,7 @@ return [
'simplify_ast' => true,
'analyzed_file_extensions' => ['php','inc'],
'globals_type_map' => [
'_Avery_Labels' => 'array<string,array{name:string,paper-size:string,orientation:string,metric:string,marginLeft:float,marginTop:float,NX:int,NY:int,SpaceX:float,SpaceY:float,width:float,height:float,font-size:float,custom_x:float,custom_y:float}>',
'action' => 'string',
'actioncode' => 'string',
'badgeStatus0' => 'string',

View file

@ -400,12 +400,12 @@ if ($result) {
if ($links[$key]['type'] == 'payment') {
$paymentstatic->id = $links[$key]['url_id'];
$paymentstatic->ref = $links[$key]['url_id'];
$paymentstatic->ref = (string) $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentstatic->getNomUrl(2, '', ''); // TODO Do not include list of invoice in tooltip, the dol_string_nohtmltag is ko with this
$tabpay[$obj->rowid]["paymentid"] = $paymentstatic->id;
} elseif ($links[$key]['type'] == 'payment_supplier') {
$paymentsupplierstatic->id = $links[$key]['url_id'];
$paymentsupplierstatic->ref = $links[$key]['url_id'];
$paymentsupplierstatic->ref = (string) $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentsupplierstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentsupplierid"] = $paymentsupplierstatic->id;
} elseif ($links[$key]['type'] == 'company') {
@ -451,7 +451,7 @@ if ($result) {
}
} elseif ($links[$key]['type'] == 'sc') {
$chargestatic->id = $links[$key]['url_id'];
$chargestatic->ref = $links[$key]['url_id'];
$chargestatic->ref = (string) $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' '.$chargestatic->getNomUrl(2);
$reg = array();
@ -486,14 +486,14 @@ if ($result) {
}
} elseif ($links[$key]['type'] == 'payment_donation') {
$paymentdonstatic->id = $links[$key]['url_id'];
$paymentdonstatic->ref = $links[$key]['url_id'];
$paymentdonstatic->ref = (string) $links[$key]['url_id'];
$paymentdonstatic->fk_donation = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentdonstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentdonationid"] = $paymentdonstatic->id;
$tabtp[$obj->rowid][$account_pay_donation] = isset($tabtp[$obj->rowid][$account_pay_donation]) ? $tabtp[$obj->rowid][$account_pay_donation] + $amounttouse : $amounttouse;
} elseif ($links[$key]['type'] == 'member') {
$paymentsubscriptionstatic->id = $links[$key]['url_id'];
$paymentsubscriptionstatic->ref = $links[$key]['url_id'];
$paymentsubscriptionstatic->ref = (string) $links[$key]['url_id'];
$paymentsubscriptionstatic->label = $links[$key]['label'];
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentsubscriptionstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentsubscriptionid"] = $paymentsubscriptionstatic->id;
@ -501,14 +501,14 @@ if ($result) {
$tabtp[$obj->rowid][$account_pay_subscription] = isset($tabtp[$obj->rowid][$account_pay_subscription]) ? $tabtp[$obj->rowid][$account_pay_subscription] + $amounttouse : $amounttouse;
} elseif ($links[$key]['type'] == 'payment_vat') { // Payment VAT
$paymentvatstatic->id = $links[$key]['url_id'];
$paymentvatstatic->ref = $links[$key]['url_id'];
$paymentvatstatic->ref = (string) $links[$key]['url_id'];
$paymentvatstatic->label = $links[$key]['label'];
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentvatstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentvatid"] = $paymentvatstatic->id;
$tabtp[$obj->rowid][$account_pay_vat] = isset($tabtp[$obj->rowid][$account_pay_vat]) ? $tabtp[$obj->rowid][$account_pay_vat] + $amounttouse : $amounttouse;
} elseif ($links[$key]['type'] == 'payment_salary') {
$paymentsalstatic->id = $links[$key]['url_id'];
$paymentsalstatic->ref = $links[$key]['url_id'];
$paymentsalstatic->ref = (string) $links[$key]['url_id'];
$paymentsalstatic->label = $links[$key]['label'];
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentsalstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id;
@ -556,7 +556,7 @@ if ($result) {
$tabpay[$obj->rowid]["paymentexpensereport"] = $paymentexpensereportstatic->id;
} elseif ($links[$key]['type'] == 'payment_various') {
$paymentvariousstatic->id = $links[$key]['url_id'];
$paymentvariousstatic->ref = $links[$key]['url_id'];
$paymentvariousstatic->ref = (string) $links[$key]['url_id'];
$paymentvariousstatic->label = $links[$key]['label'];
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentvariousstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentvariousid"] = $paymentvariousstatic->id;
@ -567,7 +567,7 @@ if ($result) {
$tabtp[$obj->rowid][$account_subledger] = isset($tabtp[$obj->rowid][$account_subledger]) ? $tabtp[$obj->rowid][$account_subledger] + $amounttouse : $amounttouse;
} elseif ($links[$key]['type'] == 'payment_loan') {
$paymentloanstatic->id = $links[$key]['url_id'];
$paymentloanstatic->ref = $links[$key]['url_id'];
$paymentloanstatic->ref = (string) $links[$key]['url_id'];
$paymentloanstatic->fk_loan = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentloanstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentloanid"] = $paymentloanstatic->id;

View file

@ -3,6 +3,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -60,7 +61,7 @@ if ($action == 'set') {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
$db->rollback();
setEventMessages($error, null, 'errors');
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View file

@ -152,7 +152,7 @@ print load_fiche_titre($langs->trans("AdvancedEditor"), $linkback, 'title_setup'
print '<br>';
if (empty($conf->use_javascript_ajax)) {
setEventMessages(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), null, 'errors');
setEventMessages(null, array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), 'errors');
} else {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2021 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -29,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
class AssetAccountancyCodes extends CommonObject
{
/**
* @var array Array with all accountancy codes info by mode.
* @var array<string,array<string,string|array<string,array{label:string,columnbreak?:bool}>>> Array with all accountancy codes info by mode.
* Note : 'economic' mode is mandatory and is the primary accountancy codes
* 'depreciation_asset' and 'depreciation_expense' is mandatory and is used for write depreciation in bookkeeping
*/
@ -64,7 +65,7 @@ class AssetAccountancyCodes extends CommonObject
);
/**
* @var array Array with all accountancy codes by mode.
* @var array<string,array<string,string>> Array with all accountancy codes by mode.
*/
public $accountancy_codes = array();
@ -81,7 +82,7 @@ class AssetAccountancyCodes extends CommonObject
/**
* Fill accountancy_codes property of object (using for data sent by forms)
*
* @return array Array of values
* @return array<string,array<string,string>> Array of values
*/
public function setAccountancyCodesFromPost()
{

View file

@ -70,8 +70,8 @@ class AssetDepreciationOptions extends CommonObject
public $fields = array();
/**
* @var array Array with all deprecation options info by mode.
* Note : economic mode is mandatory and is the primary options
* @var array<string,array{label:string,table:string,fields: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>}>}>
* Note : economic mode is mandatory and is the primary option
*/
public $deprecation_options_fields = array(
'economic' => array(
@ -119,7 +119,7 @@ class AssetDepreciationOptions extends CommonObject
public $fk_user_modif;
/**
* @var array Array with all deprecation options by mode.
* @var array<string,array<string,null|int|float|string>> Array with all deprecation options by mode.
*/
public $deprecation_options = array();
@ -174,7 +174,7 @@ class AssetDepreciationOptions extends CommonObject
* Set object infos for a mode
*
* @param string $mode Depreciation mode (economic, accelerated_depreciation, ...)
* @param int $class_type Type (0:asset, 1:asset model)
* @param int<0,1> $class_type Type (0:asset, 1:asset model)
* @param bool $all_field Get all fields
* @return int Return integer <0 if KO, >0 if OK
*/

View file

@ -383,7 +383,7 @@ class AssetModel extends CommonObject
* @param string $filter Filter as an Universal Search string.
* Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')'
* @param string $filtermode No more used
* @return array|int int <0 if KO, array of pages if OK
* @return AssetModel[]|int int <0 if KO, array of pages if OK
*/
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND')
{

View file

@ -77,7 +77,8 @@ if (empty($reshook)) {
}
}
// Discard if extrafield is a hidden field on form
if (abs($field_info['visible']) != 1 && abs($field_info['visible']) != 3 && abs($field_info['visible']) != 4 && abs($field_info['visible']) != 5) {
$isVisibleAbs = array_key_exists('visible', $field_info) ? abs((int) $field_info['visible']) : 0;
if (!in_array($isVisibleAbs, array(1, 3, 4, 5))) {
continue;
}
if (array_key_exists('enabled', $field_info) && isset($field_info['enabled']) && !verifCond($field_info['enabled'])) {

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2021 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -77,7 +78,8 @@ if (empty($reshook)) {
}
}
// Discard if extrafield is a hidden field on form
if (abs($field_info['visible']) != 1 && abs($field_info['visible']) != 3 && abs($field_info['visible']) != 4 && abs($field_info['visible']) != 5) {
$isVisibleAbs = array_key_exists('visible', $field_info) ? abs((int) $field_info['visible']) : 0;
if (!in_array($isVisibleAbs, array(1, 3, 4, 5))) {
continue;
}
if (array_key_exists('enabled', $field_info) && isset($field_info['enabled']) && !verifCond($field_info['enabled'])) {

View file

@ -590,7 +590,7 @@ class BOM extends CommonObject
* @param ?int $fk_bom_child Id of BOM Child
* @param ?string $import_key Import Key
* @param int $fk_unit Unit
* @param array $array_options extrafields array
* @param array<string,mixed> $array_options extrafields array
* @param ?int $fk_default_workstation Default workstation
* @return int<-3,max> Return integer <0 if KO, Id of created object if OK
*/
@ -698,7 +698,7 @@ class BOM extends CommonObject
* @param int<-1,max> $position Position of BOM-Line in BOM-Lines
* @param ?string $import_key Import Key
* @param int $fk_unit Unit of line
* @param array $array_options extrafields array
* @param array<string,mixed> $array_options extrafields array
* @param ?int $fk_default_workstation Default workstation
* @return int<-3,max> Return integer <0 if KO, Id of updated BOM-Line if OK
*/
@ -1299,7 +1299,7 @@ class BOM extends CommonObject
* @param int<0,1> $hidedetails Hide details of lines
* @param int<0,1> $hidedesc Hide description
* @param int<0,1> $hideref Hide ref
* @param null|array $moreparams Array to provide more information
* @param ?array<string,mixed> $moreparams Array to provide more information
* @return int<0,1> 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -55,7 +56,7 @@ class CActionComm
/**
* @var string label
* @deprecated
* @deprecated Use $label
* @see $label
*/
public $libelle;
@ -87,7 +88,7 @@ class CActionComm
/**
* @var array Used to return value by some methods
* @var array{id:array<int,string>,code:array<string,string>,all:array<string,array{id:string,label:string,type:string,color:mixed,picto:string}>} Used to return value by some methods
*/
public $liste_array;
@ -148,13 +149,13 @@ class CActionComm
/**
* Return list of event types: array(id=>label) or array(code=>label)
*
* @param string|int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
* @param string $idorcode 'id' or 'code' or 'all'
* @param string $excludetype Type to exclude ('system' or 'systemauto')
* @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1 or -2=Keep details and add a combined line per calendar (Default, Auto, BoothConf, ...)
* @param ''|int<0,1> $active 1 or 0 to filter on event state active or not ('' by default = no filter)
* @param 'id'|'code'|'all' $idorcode 'id' or 'code' or 'all'
* @param string $excludetype Type to exclude ('system' or 'systemauto')
* @param int<-2,1> $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1 or -2=Keep details and add a combined line per calendar (Default, Auto, BoothConf, ...)
* @param string $morefilter Add more SQL filter
* @param int $shortlabel 1=Get short label instead of long label
* @return array|int Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.
* @param int<0,1> $shortlabel 1=Get short label instead of long label
* @return int<-1,-1>|array{id:array<int,string>,code:array<string,string>,all:array<string,array{id:string,label:string,type:string,color:mixed,picto:string}>,AC_OTH_AUTO?:mixed} Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.
*/
public function liste_array($active = '', $idorcode = 'id', $excludetype = '', $onlyautoornot = 0, $morefilter = '', $shortlabel = 0)
{

View file

@ -45,7 +45,7 @@ class ICal
public $file_text;
/**
* @var array Array to save iCalendar parse data
* @var array<string,array<'VEVENT'|'VFREEBUSY'|'VTODO',array<int,array<string,string>>>>|array<string,array<int,array<string,array<string,int>>>>|array<string,array<int,array<string,int>>>|array<string,array<int,array<string,string>>> Array to save iCalendar parse data
*/
public $cal;
@ -138,7 +138,7 @@ class ICal
* @param string $uri Url
* @param string $usecachefile Full path of a cache file to use a cache file
* @param int $delaycache Delay in seconds for cache (by default 3600 secondes)
* @return array|string
* @return string|array<string,array<'VEVENT'|'VFREEBUSY'|'VTODO',array<int,array<string,string>>>>|array<string,array<int,array<string,array<string,int>>>>|array<string,array<int,array<string,int>>>|array<string,array<int,array<string,string>>>
*/
public function parse($uri, $usecachefile = '', $delaycache = 3600)
{
@ -277,12 +277,15 @@ class ICal
$key = $this->last_key;
switch ($type) {
case 'VEVENT':
// @phan-suppress-next-line PhanTypeMismatchDimFetch
$value = $this->cal[$type][$this->event_count][$key].$value;
break;
case 'VFREEBUSY':
// @phan-suppress-next-line PhanTypeMismatchDimFetch
$value = $this->cal[$type][$this->freebusy_count][$key].$value;
break;
case 'VTODO':
// @phan-suppress-next-line PhanTypeMismatchDimFetch
$value = $this->cal[$type][$this->todo_count][$key].$value;
break;
}
@ -303,18 +306,22 @@ class ICal
switch ($type) {
case "VTODO":
// @phan-suppress-next-line PhanTypeMismatchReturn
$this->cal[$type][$this->todo_count][$key] = $value;
break;
case "VEVENT":
// @phan-suppress-next-line PhanTypeMismatchReturn
$this->cal[$type][$this->event_count][$key] = $value;
break;
case "VFREEBUSY":
// @phan-suppress-next-line PhanTypeMismatchReturn
$this->cal[$type][$this->freebusy_count][$key] = $value;
break;
default:
// @phan-suppress-next-line PhanTypeMismatchProperty
$this->cal[$type][$key] = $value;
break;
}
@ -326,7 +333,7 @@ class ICal
* Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value");
*
* @param string $text Text
* @return array
* @return array{0:string,1:string}
*/
public function retun_key_value($text)
{
@ -351,7 +358,7 @@ class ICal
* Parse RRULE return array
*
* @param string $value string
* @return array
* @return array<string,string>
*/
public function ical_rrule($value)
{
@ -425,14 +432,14 @@ class ICal
/**
* Return sorted eventlist as array or false if calendar is empty
*
* @return array|false
* @return array<int,array<string,string>>|false
*/
public function get_sort_event_list()
{
// phpcs:enable
$temp = $this->get_event_list();
if (!empty($temp)) {
usort($temp, array(&$this, "ical_dtstart_compare"));
usort($temp, array($this, "ical_dtstart_compare")); // false-positive @phpstan-ignore-line
return $temp;
} else {
return false;
@ -443,9 +450,9 @@ class ICal
/**
* Compare two unix timestamp
*
* @param array $a Operand a
* @param array $b Operand b
* @return integer
* @param array{DTSTART:array{unixtime:string}} $a Operand a
* @param array{DTSTART:array{unixtime:string}} $b Operand b
* @return int
*/
public function ical_dtstart_compare($a, $b)
{
@ -457,7 +464,7 @@ class ICal
/**
* Return eventlist array (not sorted eventlist array)
*
* @return array
* @return array<int,array<string,string>>
*/
public function get_event_list()
{
@ -469,7 +476,7 @@ class ICal
/**
* Return freebusy array (not sort eventlist array)
*
* @return array
* @return array<int,array<string,string>>
*/
public function get_freebusy_list()
{
@ -481,7 +488,7 @@ class ICal
/**
* Return to do array (not sorted todo array)
*
* @return array
* @return array<int,array<string,string>>
*/
public function get_todo_list()
{
@ -493,7 +500,7 @@ class ICal
/**
* Return base calendar data
*
* @return array
* @return array<int,array<string,string>>
*/
public function get_calender_data()
{
@ -505,7 +512,7 @@ class ICal
/**
* Return array with all data
*
* @return array
* @return array<string,array<'VEVENT'|'VFREEBUSY'|'VTODO',array<int,array<string,string>>>>|array<string,array<int,array<string,array<string,int>>>>|array<string,array<int,array<string,int>>>|array<string,array<int,array<string,string>>>
*/
public function get_all_data()
{

View file

@ -2,6 +2,7 @@
/* Advance Targeting Emailing for mass emailing module
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -85,12 +86,12 @@ class AdvanceTargetingMailing extends CommonObject
public $fk_user_mod;
/**
* @var array select target type
* @var array<int,string> select target type
*/
public $select_target_type = array();
/**
* @var array type status comm prospect
* @var array<int,string> type status comm prospect
*/
public $type_statuscommprospect = array();
@ -129,7 +130,7 @@ class AdvanceTargetingMailing extends CommonObject
$customerStatic->loadCacheOfProspStatus();
if (!empty($customerStatic->cacheprospectstatus)) {
foreach ($customerStatic->cacheprospectstatus as $dataProspectSt) {
$this->type_statuscommprospect[$dataProspectSt['id']]=$dataProspectSt['label'];
$this->type_statuscommprospect[$dataProspectSt['id']] = $dataProspectSt['label'];
}
} else {
$this->type_statuscommprospect = array(
@ -398,9 +399,9 @@ class AdvanceTargetingMailing extends CommonObject
/**
* Update object into database
*
* @param User $user User that modifies
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int Return integer <0 if KO, >0 if OK
* @param User $user User that modifies
* @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers
* @return int Return integer <0 if KO, >0 if OK
*/
public function update($user, $notrigger = 0)
{
@ -461,9 +462,9 @@ class AdvanceTargetingMailing extends CommonObject
/**
* Delete object in database
*
* @param User $user User that deletes
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int Return integer <0 if KO, >0 if OK
* @param User $user User that deletes
* @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers
* @return int Return integer <0 if KO, >0 if OK
*/
public function delete($user, $notrigger = 0)
{
@ -503,7 +504,7 @@ class AdvanceTargetingMailing extends CommonObject
* Save query in database to retrieve it
*
* @param User $user User that deletes
* @param array $arrayquery All element to Query
* @param array<string,string|string[]> $arrayquery All element to Query
* @return int Return integer <0 if KO, >0 if OK
*/
public function savequery($user, $arrayquery)
@ -531,7 +532,7 @@ class AdvanceTargetingMailing extends CommonObject
/**
* Load object in memory from database
*
* @param array $arrayquery All element to Query
* @param array<string,string|string[]> $arrayquery All element to Query
* @return int Return integer <0 if KO, >0 if OK
*/
public function query_thirdparty($arrayquery)
@ -638,7 +639,7 @@ class AdvanceTargetingMailing extends CommonObject
}
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'link') {
if ($arrayquery['options_'.$key] > 0) {
$sqlwhere[]= " (te.".$key." = ".((int) $arrayquery["options_".$key]).")";
$sqlwhere[] = " (te.".$key." = ".((int) $arrayquery["options_".$key]).")";
}
} else {
if (is_array($arrayquery['options_'.$key])) {
@ -685,8 +686,8 @@ class AdvanceTargetingMailing extends CommonObject
/**
* Load object in memory from database
*
* @param array $arrayquery All element to Query
* @param int $withThirdpartyFilter add contact with tridparty filter
* @param array<string,string|string[]> $arrayquery All element to Query
* @param int $withThirdpartyFilter add contact with third party filter
* @return int Return integer <0 if KO, >0 if OK
*/
public function query_contact($arrayquery, $withThirdpartyFilter = 0)

View file

@ -53,7 +53,7 @@ class FormAdvTargetEmailing extends Form
/**
* Affiche un champs select contenant une liste
*
* @param array $selected_array à preselectionner
* @param string[] $selected_array à preselectionner
* @param string $htmlname select field
* @return string select field
*/
@ -92,7 +92,7 @@ class FormAdvTargetEmailing extends Form
* Return combo list of activated countries, into language of user
*
* @param string $htmlname of html select object
* @param array $selected_array or Code or Label of preselected country
* @param string[] $selected_array or Code or Label of preselected country
* @return string HTML string with select
*/
public function multiselectState($htmlname = 'state_id', $selected_array = array())
@ -153,7 +153,7 @@ class FormAdvTargetEmailing extends Form
* Return combo list of activated countries, into language of user
*
* @param string $htmlname of html select object
* @param array $selected_array or Code or Label of preselected country
* @param string[] $selected_array or Code or Label of preselected country
* @return string HTML string with select
*/
public function multiselectCountry($htmlname = 'country_id', $selected_array = array())
@ -213,7 +213,7 @@ class FormAdvTargetEmailing extends Form
* Return select list for categories (to use in form search selectors)
*
* @param string $htmlname control name
* @param array $selected_array array of data
* @param string[] $selected_array array of data
* @param User $user User action
* @return string combo list code
*/
@ -259,7 +259,7 @@ class FormAdvTargetEmailing extends Form
* Return select list for categories (to use in form search selectors)
*
* @param string $htmlname of combo list (example: 'search_sale')
* @param array $selected_array selected array
* @param string[] $selected_array selected array
* @return string combo list code
*/
public function multiselectselectLanguage($htmlname = '', $selected_array = array())
@ -351,7 +351,7 @@ class FormAdvTargetEmailing extends Form
* Return combo list with people title
*
* @param string $htmlname Name of HTML select combo field
* @param array $selected_array Array
* @param string[] $selected_array Array
* @return string HTML combo
*/
public function multiselectCivility($htmlname = 'civilite_id', $selected_array = array())
@ -391,8 +391,8 @@ class FormAdvTargetEmailing extends Form
* Return multiselect list of entities.
*
* @param string $htmlname select
* @param array $options_array to manage
* @param array $selected_array to manage
* @param array<string,mixed> $options_array to manage
* @param string[] $selected_array to manage
* @param int $showempty show empty
* @return string HTML combo
*/

View file

@ -150,17 +150,17 @@ class Mailing extends CommonObject
public $extraparams = array();
/**
* @var array statut dest
* @var array<int,string> statut dest
*/
public $statut_dest = array();
/**
* @var array substitutionarray
* @var array<string,string> substitutionarray
*/
public $substitutionarray;
/**
* @var array substitutionarrayfortest
* @var array<string,string> substitutionarrayfortest
*/
public $substitutionarrayfortest;

View file

@ -205,18 +205,21 @@ class Propal extends CommonObject
public $author;
/**
* @deprecated
* @var float
* @deprecated See $total_ht
* @see $total_ht
*/
public $price;
/**
* @deprecated
* @var float
* @deprecated See $total_tva
* @see $total_tva
*/
public $tva;
/**
* @deprecated
* @var float
* @deprecated See $total_ttc
* @see $total_ttc
*/
public $total;
@ -293,6 +296,9 @@ class Propal extends CommonObject
*/
public $availability;
/**
* @var int|string
*/
public $duree_validite;
/**
@ -619,11 +625,11 @@ class Propal extends CommonObject
* @param string $label ???
* @param int|string $date_start Start date of the line
* @param int|string $date_end End date of the line
* @param array $array_options extrafields array
* @param array<string,mixed> $array_options extrafields array
* @param int|null $fk_unit Code of the unit to use. Null to use the default one
* @param string $origin Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be 'orderdet', 'propaldet'..., else 'order','propal,'....
* @param int $origin_id Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be Id of origin object (aka line id), else object id
* @param double $pu_ht_devise Unit price in currency
* @param float $pu_ht_devise Unit price in currency
* @param int $fk_remise_except Id discount if line is from a discount
* @param int $noupdateafterinsertline No update after insert of line
* @return int >0 if OK, <0 if KO
@ -868,11 +874,11 @@ class Propal extends CommonObject
* @param int $type 0/1=Product/service
* @param int|string $date_start Start date of the line
* @param int|string $date_end End date of the line
* @param array $array_options extrafields array
* @param array<string,mixed> $array_options extrafields array
* @param int|null $fk_unit Code of the unit to use. Null to use the default one
* @param double $pu_ht_devise Unit price in currency
* @param float $pu_ht_devise Unit price in currency
* @param int $notrigger disable line update trigger
* @param integer $rang line rank
* @param int $rang line rank
* @return int 0 if OK, <0 if KO
*/
public function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $date_start = '', $date_end = '', $array_options = array(), $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0, $rang = 0)
@ -2975,7 +2981,7 @@ class Propal extends CommonObject
/**
* Returns an array with the numbers of related invoices
*
* @return array Array of invoices
* @return CommonInvoice[] Array of invoices
*/
public function getInvoiceArrayList()
{
@ -2987,7 +2993,7 @@ class Propal extends CommonObject
* Returns an array with id and ref of related invoices
*
* @param int $id Id propal
* @return array|int Array of invoices id
* @return CommonInvoice[]|int Array of invoices id
*/
public function InvoiceArrayList($id)
{
@ -3917,10 +3923,10 @@ class Propal extends CommonObject
*
* @param string $modele Force model to use ('' to not force)
* @param Translate $outputlangs Object langs to use for output
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @param null|array $moreparams Array to provide more information
* @param int<0,1> $hidedetails Hide details of lines
* @param int<0,1> $hidedesc Hide description
* @param int<0,1> $hideref Hide ref
* @param ?array<string,mixed> $moreparams Array to provide more information
* @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)

View file

@ -2027,7 +2027,7 @@ while ($i < $imaxinloop) {
// Availability
if (!empty($arrayfields['ava.rowid']['checked'])) {
print '<td class="center">';
$form->form_availability('', $obj->availability, 'none', 1);
$form->form_availability(0, $obj->availability, 'none', 1);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;

View file

@ -1494,7 +1494,7 @@ if ($resql) {
}
$banklinestatic->id = $objp->rowid;
$banklinestatic->ref = $objp->rowid;
$banklinestatic->ref = (string) $objp->rowid;
print '<tr class="oddeven" '.$backgroundcolor.'>';
@ -1551,25 +1551,25 @@ if ($resql) {
print $banktransferstatic->getNomUrl(0).($labeltoshow ? ' ' : '');
} elseif ($links[$key]['type'] == 'payment') {
$paymentstatic->id = $links[$key]['url_id'];
$paymentstatic->ref = $links[$key]['url_id']; // FIXME This is id, not ref of payment
$paymentstatic->ref = (string) $links[$key]['url_id']; // FIXME This is id, not ref of payment
$paymentstatic->date = $db->jdate($objp->do);
print $paymentstatic->getNomUrl(2).($labeltoshow ? ' ' : '');
} elseif ($links[$key]['type'] == 'payment_supplier') {
$paymentsupplierstatic->id = $links[$key]['url_id'];
$paymentsupplierstatic->ref = $links[$key]['url_id']; // FIXME This is id, not ref of payment
$paymentsupplierstatic->ref = (string) $links[$key]['url_id']; // FIXME This is id, not ref of payment
print $paymentsupplierstatic->getNomUrl(2).($labeltoshow ? ' ' : '');
} elseif ($links[$key]['type'] == 'payment_sc') {
$paymentscstatic->id = $links[$key]['url_id'];
$paymentscstatic->ref = $links[$key]['url_id'];
$paymentscstatic->ref = (string) $links[$key]['url_id'];
$paymentscstatic->label = $links[$key]['label'];
print $paymentscstatic->getNomUrl(2).($labeltoshow ? ' ' : '');
} elseif ($links[$key]['type'] == 'payment_vat') {
$paymentvatstatic->id = $links[$key]['url_id'];
$paymentvatstatic->ref = $links[$key]['url_id'];
$paymentvatstatic->ref = (string) $links[$key]['url_id'];
print $paymentvatstatic->getNomUrl(2).($labeltoshow ? ' ' : '');
} elseif ($links[$key]['type'] == 'payment_salary') {
$paymentsalstatic->id = $links[$key]['url_id'];
$paymentsalstatic->ref = $links[$key]['url_id'];
$paymentsalstatic->ref = (string) $links[$key]['url_id'];
$paymentsalstatic->label = $links[$key]['label'];
print $paymentsalstatic->getNomUrl(2).($labeltoshow ? ' ' : '');
} elseif ($links[$key]['type'] == 'payment_loan') {
@ -1578,15 +1578,15 @@ if ($resql) {
print '</a>'.($labeltoshow ? ' ' : '');
} elseif ($links[$key]['type'] == 'payment_donation') {
$paymentdonationstatic->id = $links[$key]['url_id'];
$paymentdonationstatic->ref = $links[$key]['url_id'];
$paymentdonationstatic->ref = (string) $links[$key]['url_id'];
print $paymentdonationstatic->getNomUrl(2).($labeltoshow ? ' ' : '');
} elseif ($links[$key]['type'] == 'payment_expensereport') {
$paymentexpensereportstatic->id = $links[$key]['url_id'];
$paymentexpensereportstatic->ref = $links[$key]['url_id'];
$paymentexpensereportstatic->ref = (string) $links[$key]['url_id'];
print $paymentexpensereportstatic->getNomUrl(2).($labeltoshow ? ' ' : '');
} elseif ($links[$key]['type'] == 'payment_various') {
$paymentvariousstatic->id = $links[$key]['url_id'];
$paymentvariousstatic->ref = $links[$key]['url_id'];
$paymentvariousstatic->ref = (string) $links[$key]['url_id'];
print $paymentvariousstatic->getNomUrl(2).($labeltoshow ? ' ' : '');
} elseif ($links[$key]['type'] == 'banktransfert') {
// Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail.

View file

@ -56,8 +56,8 @@ class Account extends CommonObject
public $picto = 'account';
/**
* @var int Use id instead of rowid
* @deprecated
* @var int
* @deprecated Use $id instead of $rowid
* @see $id
*/
public $rowid;
@ -71,7 +71,7 @@ class Account extends CommonObject
/**
* Bank account type. Check TYPE_ constants
* @var int
* @deprecated
* @deprecated Use $type
* @see $type
*/
public $courant;
@ -149,7 +149,7 @@ class Account extends CommonObject
* IBAN number
*
* @var string
* @deprecated see $iban
* @deprecated See $iban
*/
public $iban_prefix;
@ -162,7 +162,7 @@ class Account extends CommonObject
/**
* Name of account holder
* @var string
* @deprecated
* @deprecated Use $owner_name
* @see $owner_name
*/
public $proprio;
@ -190,13 +190,19 @@ class Account extends CommonObject
* @var string
*/
public $owner_town;
/**
* @var int
*/
public $owner_country_id;
/**
* @var string
*/
public $owner_country_code;
/**
* Address of the bank account
* @var string
* @deprecated
* @deprecated See $address
* @see $address
*/
public $domiciliation;
@ -206,15 +212,27 @@ class Account extends CommonObject
* @var string
*/
public $address;
/**
* @var int
*/
public $state_id;
/**
* @var string
*/
public $state_code;
/**
* @var string
*/
public $state;
/**
* @var int
*/
public $country_id;
/**
* Variable containing all account types with their respective translated label.
* Defined in __construct
* @var array
* @var array<int,string>
*/
public $type_lib = array();
@ -517,7 +535,7 @@ class Account extends CommonObject
* @param int $fk_bank To search using bank transaction id
* @param int $url_id To search using link to
* @param string $type To search using type
* @return array|int Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error
* @return int<-1,-1>|array<int,array{0:string,1:int,2:string,3:int,url:string,url_id:int,label:string,type:int,fk_bank:int}> Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error
*/
public function get_url($fk_bank = 0, $url_id = 0, $type = '')
{
@ -1850,8 +1868,8 @@ class Account extends CommonObject
*
* Some countries show less or more bank account properties to the user
*
* @param int $includeibanbic 1=Return also key for IBAN and BIC
* @return array Array of fields to show
* @param int<0,1> $includeibanbic 1=Return also key for IBAN and BIC
* @return string[] Array of fields to show
* @see useDetailedBBAN()
*/
public function getFieldsToShow($includeibanbic = 0)
@ -1891,7 +1909,7 @@ class Account extends CommonObject
* - BankAccountNumberKey
* - DeskCode
*
* @return array
* @return string[]
*/
public static function getAccountNumberOrder()
{
@ -1957,14 +1975,14 @@ class Account extends CommonObject
$this->owner_address = 'Owner address';
$this->owner_zip = 'Owner zip';
$this->owner_town = 'Owner town';
$this->owner_country_id = 'Owner country_id';
$this->owner_country_id = 1;
$this->country_id = 1;
return 1;
}
/**
* Function used to replace a thirdparty id with another one.
* Function used to replace a third party id with another one.
*
* @param DoliDB $dbs Database handler
* @param int $origin_id Old thirdparty id
@ -2171,6 +2189,7 @@ class AccountLine extends CommonObjectLine
/**
* User author of the reconciliation
* TODO: variable used only by method info() => is it the same as $fk_user_rappro ?
* @var int
*/
public $user_rappro;

View file

@ -58,12 +58,12 @@ class BankCateg // extends CommonObject
public $error;
/**
* @var array errors
* @var string[] errors
*/
public $errors;
/**
* @var array context
* @var array<string,string> context
*/
public $context;

View file

@ -53,8 +53,17 @@ class Deplacement extends CommonObject
*/
public $fk_element = '';
/**
* @var int
*/
public $fk_soc;
/**
* @var int|string
*/
public $date;
/**
* @var string
*/
public $type;
/**
@ -408,7 +417,7 @@ class Deplacement extends CommonObject
* List of types
*
* @param int $active Active or not
* @return array
* @return array<string,string>
*/
public function listOfTypes($active = 1)
{

View file

@ -34,7 +34,13 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
*/
class FactureStats extends Stats
{
/**
* @var int
*/
public $socid;
/**
* @var int
*/
public $userid;
/**
@ -42,9 +48,21 @@ class FactureStats extends Stats
*/
public $table_element;
/**
* @var string
*/
public $from;
/**
* @var string
*/
public $field;
/**
* @var string
*/
public $where = '';
/**
* @var string
*/
public $join;

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -45,6 +46,9 @@ class PaymentTerm // extends CommonObject
//public $element='c_payment_term'; //!< Id that identify managed objects
//public $table_element='c_payment_term'; //!< Name of table without prefix where object is stored
/**
* @var array<string,string>
*/
public $context = array();
/**
@ -58,13 +62,37 @@ class PaymentTerm // extends CommonObject
*/
public $entity;
/**
* @var string
*/
public $code;
/**
* @var string
*/
public $sortorder;
/**
* @var string
*/
public $active;
/**
* @var string
*/
public $libelle;
/**
* @var string
*/
public $libelle_facture;
/**
* @var string
*/
public $type_cdr;
/**
* @var string
*/
public $nbjour;
/**
* @var string
*/
public $decalage;

View file

@ -1251,8 +1251,11 @@ $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = '';
if ($contextpage != 'poslist') {
$url = DOL_URL_ROOT.'/compta/facture/card.php?action=create';
if (!empty($socid)) {
$url .= '&socid='.$socid;
if (!empty($object->socid)) {
$url .= '&socid='.urlencode((string) $object->socid);
}
if (!empty($object->id)) {
$url .= '&fac_rec='.urlencode((string) $object->id);
}
$newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));

View file

@ -45,10 +45,22 @@ class Localtax extends CommonObject
*/
public $picto = 'payment';
/**
* @var int
*/
public $ltt;
/**
* @var int|string
*/
public $datep;
/**
* @var int|string
*/
public $datev;
/**
* @var string
*/
public $amount;
/**
@ -61,6 +73,9 @@ class Localtax extends CommonObject
*/
public $fk_type;
/**
* @var string
*/
public $paymenttype;
/**
@ -535,7 +550,7 @@ class Localtax extends CommonObject
dol_print_error($this->db);
}
$bank_line_id = $acc->addline($this->datep, $this->paymenttype, $this->label, -abs((float) $this->amount), '', '', $user);
$bank_line_id = $acc->addline($this->datep, $this->paymenttype, $this->label, -abs((float) $this->amount), '', 0, $user);
// Update fk_bank into llx_localtax so we know the line of localtax used to generate the bank entry.
if ($bank_line_id > 0) {

View file

@ -50,18 +50,47 @@ class RemiseCheque extends CommonObject
*/
public $picto = 'payment';
/**
* @var string
*/
public $num;
/**
* @var string
*/
public $intitule;
//! Numero d'erreur Plage 1024-1279
/**
* @var int<-1033,-1024>|int<-18,-18>|int<-2,0> Error number from 1024 to 1279
*/
public $errno;
/**
* @var string
*/
public $type = 'CHQ'; // 'CHQ', 'TRA', ...
/**
* @var float
*/
public $amount;
/**
* @var int|string
*/
public $date_bordereau;
/**
* @var int
*/
public $account_id;
/**
* @var string
*/
public $account_label;
/**
* @var int
*/
public $author_id;
/**
* @var int
*/
public $nbcheque;
/**
@ -143,7 +172,7 @@ class RemiseCheque extends CommonObject
* @param User $user User making creation
* @param int $account_id Bank account for cheque receipt
* @param int $limit Limit ref of cheque to this
* @param array $toRemise array with cheques to remise
* @param int[] $toRemise array with cheques to remise
* @return int Return integer <0 if KO, >0 if OK
*/
public function create($user, $account_id, $limit, $toRemise)
@ -268,7 +297,7 @@ class RemiseCheque extends CommonObject
} else {
$this->errno = -1;
$this->error = $this->db->lasterror();
$this->errno = $this->db->lasterrno();
// $this->errno = $this->db->lasterrno();
}
if (!$this->errno && (getDolGlobalString('MAIN_DISABLEDRAFTSTATUS') || getDolGlobalString('MAIN_DISABLEDRAFTSTATUS_CHEQUE'))) {

View file

@ -4,6 +4,7 @@
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -46,14 +47,26 @@ class Cpaiement extends CommonDict
/**
* @var string
* @deprecated
* @deprecated Use $label
* @see $label
*/
public $libelle;
/**
* @var string
*/
public $type;
/**
* @var int<0,1>
*/
public $active;
/**
* @var string
*/
public $accountancy_code;
/**
* @var string
*/
public $module;
@ -225,9 +238,9 @@ class Cpaiement extends CommonDict
/**
* Update object into database
*
* @param User $user User that modifies
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int Return integer <0 if KO, >0 if OK
* @param User $user User that modifies
* @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers
* @return int Return integer <0 if KO, >0 if OK
*/
public function update(User $user, $notrigger = 0)
{

View file

@ -79,14 +79,16 @@ class Paiement extends CommonObject
public $date;
/**
* @deprecated
* @deprecated Use $amount, $amounts
* @see $amount, $amounts
* @var float
*/
public $total;
/**
* @deprecated
* @deprecated Use $amount, $amounts
* @see $amount, $amounts
* @var float
*/
public $montant;
@ -101,7 +103,7 @@ class Paiement extends CommonObject
public $multicurrency_amount;
/**
* @var float[] array: invoice ID => amount for that invoice (in the main currency)
* @var array<float|string> array: invoice ID => amount for that invoice (in the main currency)
*/
public $amounts = array();
@ -125,6 +127,9 @@ class Paiement extends CommonObject
*/
public $pos_change = 0.0;
/**
* @var int
*/
public $author;
/**
@ -774,12 +779,12 @@ class Paiement extends CommonObject
$label,
$totalamount, // Sign must be positive when we receive money (customer payment), negative when you give money (supplier invoice or credit note)
$this->num_payment,
'',
0,
$user,
$emetteur_nom,
$emetteur_banque,
$accountancycode,
null,
0,
'',
$totalamount_main_currency
);
@ -969,9 +974,6 @@ class Paiement extends CommonObject
$this->error = 'Error -1 '.$this->db->error();
}
if (!$error) {
}
if (!$error) {
$this->datepaye = $date;
$this->date = $date;
@ -1104,7 +1106,7 @@ class Paiement extends CommonObject
* Return list of invoices the payment is related to.
*
* @param string $filter Filter
* @return int|array Return integer <0 if KO or array of invoice id
* @return int|int[] Return integer <0 if KO or array of invoice id
* @see getAmountsArray()
*/
public function getBillsArray($filter = '')
@ -1138,7 +1140,7 @@ class Paiement extends CommonObject
/**
* Return list of amounts of payments.
*
* @return int|array Array of amount of payments
* @return int|array<int,float> Array of amount of payments
* @see getBillsArray()
*/
public function getAmountsArray()

View file

@ -42,9 +42,21 @@ class RejetPrelevement
*/
public $db;
/**
* @var 'direct-debit'|'bank-transfer'
*/
public $type; //prelevement or bank transfer
/**
* @var int
*/
public $bon_id;
/**
* @var User
*/
public $user;
/**
* @var int|string
*/
public $date_rejet;
/**
@ -70,7 +82,7 @@ class RejetPrelevement
*
* @param DoliDB $db Database handler
* @param User $user Object user
* @param string $type Type ('direct-debit' for direct debit or 'bank-transfer' for credit transfer)
* @param 'direct-debit'|'bank-transfer' $type Type ('direct-debit' for direct debit or 'bank-transfer' for credit transfer)
*/
public function __construct($db, $user, $type)
{
@ -105,7 +117,7 @@ class RejetPrelevement
* @param string $motif Motif
* @param int $date_rejet Date reject
* @param int $bonid Bon id
* @param int $facturation 1=Bill the reject
* @param int<0,1> $facturation 1=Bill the reject
* @return int Return >=0 if OK, <0 if KO
*/
public function create($user, $id, $motif, $date_rejet, $bonid, $facturation = 0)
@ -304,8 +316,9 @@ class RejetPrelevement
/**
* Retrieve the list of invoices
*
* @param int $amounts If you want to get the amount of the order for each invoice
* @return array Array List of invoices related to the withdrawal line
* @param int<0,1> $amounts If you want to get the amount of the order for each invoice
* @return array<int|array{0:int,1:float}> Array List of invoices related to the withdrawal line
* @todo A withdrawal line is today linked to one and only one invoice. So the function should return only one object ?
*/
private function getListInvoices($amounts = 0)

View file

@ -4,6 +4,7 @@
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -35,8 +36,14 @@
*/
class Cchargesociales
{
/**
* @var DoliDB
*/
public $db;
/**
* @var int
*/
public $id;
/**
@ -51,7 +58,7 @@ class Cchargesociales
/**
* @var string Label
* @deprecated
* @deprecated Use $label
*/
public $libelle;
@ -60,8 +67,17 @@ class Cchargesociales
*/
public $label;
/**
* @var string
*/
public $deductible;
/**
* @var string
*/
public $active;
/**
* @var string
*/
public $code;
/**
@ -73,10 +89,13 @@ class Cchargesociales
* @var string module
*/
public $module;
/**
* @var string
*/
public $accountancy_code;
/**
* @var array array of errors
* @var string[] array of errors
*/
public $errors = array();
@ -151,13 +170,13 @@ class Cchargesociales
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
//if (!$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
//if ($result < 0) $error++;
//// End call triggers
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
//if ($result < 0) $error++;
//// End call triggers
//}
}

View file

@ -598,7 +598,7 @@ class PaymentSocialContribution extends CommonObject
$label,
$total,
$this->num_payment,
'',
0,
$user,
$emetteur_nom,
$emetteur_banque

View file

@ -597,7 +597,7 @@ class PaymentVAT extends CommonObject
$label,
$total,
$this->num_payment,
'',
0,
$user,
$emetteur_nom,
$emetteur_banque

View file

@ -679,9 +679,9 @@ class Tva extends CommonObject
}
if ($this->amount > 0) {
$bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs((float) $this->amount), $this->num_payment, '', $user);
$bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs((float) $this->amount), $this->num_payment, 0, $user);
} else {
$bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, abs((float) $this->amount), $this->num_payment, '', $user);
$bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, abs((float) $this->amount), $this->num_payment, 0, $user);
}
// Update fk_bank into llx_tva. So we know vat line used to generate bank transaction

View file

@ -33,14 +33,31 @@ abstract class ActionsContactCardCommon
*/
public $db;
/**
* @var string
*/
public $dirmodule;
/**
* @var string
*/
public $targetmodule;
/**
* @var string
*/
public $canvas;
/**
* @var string
*/
public $card;
//! Template container
/**
* @var array<string,mixed> Template container
*/
public $tpl = array();
//! Object container
//!
/**
* @var Contact Object container
*/
public $object;
/**
@ -295,13 +312,13 @@ abstract class ActionsContactCardCommon
$this->object->zip = GETPOST("zipcode");
$this->object->town = GETPOST("town");
$this->object->country_id = GETPOST("country_id") ? GETPOST("country_id") : $mysoc->country_id;
$this->object->state_id = GETPOST("state_id");
$this->object->state_id = GETPOSTINT("state_id");
$this->object->phone_pro = GETPOST("phone_pro");
$this->object->phone_perso = GETPOST("phone_perso");
$this->object->phone_mobile = GETPOST("phone_mobile");
$this->object->fax = GETPOST("fax");
$this->object->email = GETPOST("email");
$this->object->priv = GETPOST("priv");
$this->object->priv = GETPOSTINT("priv");
$this->object->note = GETPOST("note", "restricthtml");
$this->object->canvas = GETPOST("canvas");
@ -309,14 +326,17 @@ abstract class ActionsContactCardCommon
if ($this->object->country_id) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_country WHERE rowid = ".((int) $this->object->country_id);
$resql = $this->db->query($sql);
$obj = null;
if ($resql) {
$obj = $this->db->fetch_object($resql);
} else {
dol_print_error($this->db);
}
$this->object->country_id = $langs->trans("Country".$obj->code) ? $langs->trans("Country".$obj->code) : $obj->label;
$this->object->country_code = $obj->code;
$this->object->country = $langs->trans("Country".$obj->code) ? $langs->trans("Country".$obj->code) : $obj->label;
if ($obj !== null) {
$this->object->country_id = $langs->trans("Country".$obj->code) ? $langs->trans("Country".$obj->code) : $obj->label;
$this->object->country_code = $obj->code;
$this->object->country = $langs->trans("Country".$obj->code) ? $langs->trans("Country".$obj->code) : $obj->label;
}
}
}
}

View file

@ -129,8 +129,17 @@ class Contact extends CommonObject
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -1, 'position' => 1000),
);
/**
* @var string
*/
public $civility_id; // In fact we store civility_code
/**
* @var string
*/
public $civility_code;
/**
* @var string
*/
public $civility;
/**
@ -150,7 +159,7 @@ class Contact extends CommonObject
/**
* @var string The civilite code, not an integer
* @deprecated
* @deprecated Use $civility_code
* @see $civility_code
*/
public $civilite;
@ -204,6 +213,9 @@ class Contact extends CommonObject
* @var int Thirdparty ID
*/
public $socid; // both socid and fk_soc are used
/**
* @var int
*/
public $fk_soc; // both socid and fk_soc are used
/**
@ -216,6 +228,9 @@ class Contact extends CommonObject
*/
public $statut;
/**
* @var string
*/
public $code;
/**
@ -227,7 +242,7 @@ class Contact extends CommonObject
/**
* Email
* @var string
* @deprecated
* @deprecated Use $email
* @see $email
*/
public $mail;
@ -247,7 +262,7 @@ class Contact extends CommonObject
/**
* Array of social-networks
* @var array
* @var array<string,string>
*/
public $socialnetworks;
@ -333,13 +348,16 @@ class Contact extends CommonObject
* Old copy
* @var static
*/
public $oldcopy; // To contains a clone of this when we need to save old properties of object
public $oldcopy; // To contain a clone of this when we need to save old properties of object
/**
* @var array roles
* @var array<int,array{id:int,socid:int,element:string,source:string,code:string,label:string}> roles
*/
public $roles;
/**
* @var array<int,array{id:int,code:string,label:string,picto:string}>
*/
public $cacheprospectstatus = array();
/**
@ -347,8 +365,14 @@ class Contact extends CommonObject
*/
public $fk_prospectlevel;
/**
* @var int
*/
public $stcomm_id;
/**
* @var string
*/
public $statut_commercial;
/**
@ -755,11 +779,11 @@ class Contact extends CommonObject
/**
* Return DN string complete in the LDAP directory for the object
*
* @param array $info Info string loaded by _load_ldap_info
* @param int $mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb)
* 1=Return DN without key inside (ou=xxx,dc=aaa,dc=bbb)
* 2=Return key only (uid=qqq)
* @return string DN
* @param array<string,mixed> $info Info array loaded by _load_ldap_info
* @param int<0,2> $mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb)
* 1=Return DN without key inside (ou=xxx,dc=aaa,dc=bbb)
* 2=Return key only (uid=qqq)
* @return string DN
*/
public function _load_ldap_dn($info, $mode = 0)
{
@ -782,7 +806,7 @@ class Contact extends CommonObject
/**
* Initialize info table (LDAP attributes table)
*
* @return array Attributes info table
* @return array<string,mixed> Attributes info table
*/
public function _load_ldap_info()
{
@ -1867,7 +1891,7 @@ class Contact extends CommonObject
* Get thirdparty contact roles of a given contact
*
* @param string $element Element type
* @return array|int Array of contact roles or -1
* @return array<array{fk_socpeople:int,type_contact:int}>|int<-1,-1> Array of contact roles or -1
* @throws Exception
*/
public function getContactRoles($element = '')

View file

@ -24,9 +24,11 @@
* \brief Code for actions on extrafields admin pages
*/
/** @var ExtraFields $extrafields */
$maxsizestring = 255;
$maxsizeint = 10;
$mesg = array();
$mesg = '';
$mesgs = array();
$extrasize = GETPOST('size', 'intcomma');
$type = GETPOST('type', 'alphanohtml');
@ -69,61 +71,61 @@ if ($action == 'add') {
if (!$type) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"));
$mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"));
$action = 'create';
}
if ($type == 'varchar' && $extrasize <= 0) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Size"));
$mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Size"));
$action = 'edit';
}
if ($type == 'varchar' && $extrasize > $maxsizestring) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorSizeTooLongForVarcharType", $maxsizestring);
$mesgs[] = $langs->trans("ErrorSizeTooLongForVarcharType", $maxsizestring);
$action = 'create';
}
if ($type == 'int' && $extrasize > $maxsizeint) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorSizeTooLongForIntType", $maxsizeint);
$mesgs[] = $langs->trans("ErrorSizeTooLongForIntType", $maxsizeint);
$action = 'create';
}
if ($type == 'stars' && ($extrasize < 1 || $extrasize > 10)) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorSizeForStarsType");
$mesgs[] = $langs->trans("ErrorSizeForStarsType");
$action = 'create';
}
if ($type == 'select' && !$param) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorNoValueForSelectType");
$mesgs[] = $langs->trans("ErrorNoValueForSelectType");
$action = 'create';
}
if ($type == 'sellist' && !$param) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorNoValueForSelectListType");
$mesgs[] = $langs->trans("ErrorNoValueForSelectListType");
$action = 'create';
}
if ($type == 'checkbox' && !$param) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorNoValueForCheckBoxType");
$mesgs[] = $langs->trans("ErrorNoValueForCheckBoxType");
$action = 'create';
}
if ($type == 'link' && !$param) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorNoValueForLinkType");
$mesgs[] = $langs->trans("ErrorNoValueForLinkType");
$action = 'create';
}
if ($type == 'radio' && !$param) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorNoValueForRadioType");
$mesgs[] = $langs->trans("ErrorNoValueForRadioType");
$action = 'create';
}
if ((($type == 'radio') || ($type == 'checkbox')) && $param) {
@ -136,13 +138,13 @@ if ($action == 'add') {
if (count($matches[0]) > 1) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
$mesgs[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
$action = 'create';
}
} else {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
$mesgs[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
$action = 'create';
}
}
@ -153,7 +155,7 @@ if ($action == 'add') {
if (strlen(GETPOST('attrname', 'aZ09')) < 3) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorValueLength", $langs->transnoentitiesnoconv("AttributeCode"), 3);
$mesgs[] = $langs->trans("ErrorValueLength", $langs->transnoentitiesnoconv("AttributeCode"), 3);
$action = 'create';
}
}
@ -163,7 +165,7 @@ if ($action == 'add') {
if (in_array(strtoupper(GETPOST('attrname', 'aZ09')), $listofreservedwords)) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorReservedKeyword", GETPOST('attrname', 'aZ09'));
$mesgs[] = $langs->trans("ErrorReservedKeyword", GETPOST('attrname', 'aZ09'));
$action = 'create';
}
}
@ -233,17 +235,18 @@ if ($action == 'add') {
} else {
$error++;
$mesg = $extrafields->error;
setEventMessages($mesg, null, 'errors');
$mesgs = array_merge($mesgs, $extrafields->errors);
setEventMessages($mesg, $mesgs, 'errors');
}
} else {
$error++;
$langs->load("errors");
$mesg = $langs->trans("ErrorFieldCanNotContainSpecialNorUpperCharacters", $langs->transnoentities("AttributeCode"));
setEventMessages($mesg, null, 'errors');
setEventMessages($mesg, $mesgs, 'errors');
$action = 'create';
}
} else {
setEventMessages($mesg, null, 'errors');
setEventMessages($mesg, $mesgs, 'errors');
}
}
}
@ -255,55 +258,55 @@ if ($action == 'update') {
if (!$type) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"));
$mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"));
$action = 'edit';
}
if ($type == 'varchar' && $extrasize <= 0) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Size"));
$mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Size"));
$action = 'edit';
}
if ($type == 'varchar' && $extrasize > $maxsizestring) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorSizeTooLongForVarcharType", $maxsizestring);
$mesgs[] = $langs->trans("ErrorSizeTooLongForVarcharType", $maxsizestring);
$action = 'edit';
}
if ($type == 'int' && $extrasize > $maxsizeint) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorSizeTooLongForIntType", $maxsizeint);
$mesgs[] = $langs->trans("ErrorSizeTooLongForIntType", $maxsizeint);
$action = 'edit';
}
if ($type == 'select' && !$param) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorNoValueForSelectType");
$mesgs[] = $langs->trans("ErrorNoValueForSelectType");
$action = 'edit';
}
if ($type == 'sellist' && !$param) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorNoValueForSelectListType");
$mesgs[] = $langs->trans("ErrorNoValueForSelectListType");
$action = 'edit';
}
if ($type == 'stars' && ($extrasize < 1|| $extrasize > 10)) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorSizeForStarsType");
$mesgs[] = $langs->trans("ErrorSizeForStarsType");
$action = 'edit';
}
if ($type == 'checkbox' && !$param) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorNoValueForCheckBoxType");
$mesgs[] = $langs->trans("ErrorNoValueForCheckBoxType");
$action = 'edit';
}
if ($type == 'radio' && !$param) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorNoValueForRadioType");
$mesgs[] = $langs->trans("ErrorNoValueForRadioType");
$action = 'edit';
}
if ((($type == 'radio') || ($type == 'checkbox')) && $param) {
@ -316,13 +319,13 @@ if ($action == 'update') {
if (count($matches[0]) > 1) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
$mesgs[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
$action = 'edit';
}
} else {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
$mesgs[] = $langs->trans("ErrorBadFormatValueList", $param_ligne);
$action = 'edit';
}
}
@ -333,7 +336,7 @@ if ($action == 'update') {
if (strlen(GETPOST('attrname', 'aZ09')) < 3 && !getDolGlobalString('MAIN_DISABLE_EXTRAFIELDS_CHECK_FOR_UPDATE')) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorValueLength", $langs->transnoentitiesnoconv("AttributeCode"), 3);
$mesgs[] = $langs->trans("ErrorValueLength", $langs->transnoentitiesnoconv("AttributeCode"), 3);
$action = 'edit';
}
}
@ -343,7 +346,7 @@ if ($action == 'update') {
if (in_array(strtoupper(GETPOST('attrname', 'aZ09')), $listofreservedwords) && !getDolGlobalString('MAIN_DISABLE_EXTRAFIELDS_CHECK_FOR_UPDATE')) {
$error++;
$langs->load("errors");
$mesg[] = $langs->trans("ErrorReservedKeyword", GETPOST('attrname', 'aZ09'));
$mesgs[] = $langs->trans("ErrorReservedKeyword", GETPOST('attrname', 'aZ09'));
$action = 'edit';
}
}
@ -416,7 +419,8 @@ if ($action == 'update') {
} else {
$error++;
$mesg = $extrafields->error;
setEventMessages($mesg, null, 'errors');
$mesgs = array_merge($mesgs, $extrafields->errors);
setEventMessages($mesg, $mesgs, 'errors');
}
} else {
$error++;
@ -425,7 +429,7 @@ if ($action == 'update') {
setEventMessages($mesg, null, 'errors');
}
} else {
setEventMessages($mesg, null, 'errors');
setEventMessages($mesg, $mesgs, 'errors');
}
}
}
@ -443,6 +447,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
exit;
} else {
$mesg = $extrafields->error;
$mesgs = array_merge($mesgs, $extrafields->errors);
}
} else {
$error++;

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -30,13 +31,25 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondict.class.php';
*/
class Ccountry extends CommonDict
{
/**
* @var string
*/
public $element = 'ccountry'; //!< Id that identify managed objects
/**
* @var string
*/
public $table_element = 'c_country'; //!< Name of table without prefix where object is stored
/**
* @var string
*/
public $code_iso;
/**
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-2,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,2>,disabled?:int<0,1>,arrayofkeyval?:array<int,string>,comment?:string,validate?:int<0,1>}>
*/
public $fields = array(
'label' => array('type'=>'varchar(250)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>15, 'notnull'=>-1, 'showoncombobox'=>'1')
'label' => array('type' => 'varchar(250)', 'label' => 'Label', 'enabled' => 1, 'visible' => 1, 'position' => 15, 'notnull' => -1, 'showoncombobox' => 1)
);

View file

@ -48,6 +48,9 @@ class CGenericDic extends CommonDict
*/
public $lines = array();
/**
* @var string
*/
public $code;
/**
@ -55,6 +58,9 @@ class CGenericDic extends CommonDict
*/
public $label;
/**
* @var int<0,1>
*/
public $active;

View file

@ -50,8 +50,8 @@ abstract class CommonHookActions
/**
* Check context of hook
* @param array $parameters Hook parameters.
* @param array|string $allContexts Context to check
* @param array<string,mixed> $parameters Hook parameters.
* @param string[]|string $allContexts Context to check
* @return bool
*/
protected function isContext($parameters, $allContexts)

View file

@ -68,6 +68,9 @@ abstract class CommonStickerGenerator extends CommonDocGenerator
*/
public $db;
/**
* @var string
*/
public $code; // Code of format
// phpcs:disable PEAR.NamingConventions.ValidVariableName.PublicUnderscore
@ -103,10 +106,13 @@ abstract class CommonStickerGenerator extends CommonDocGenerator
protected $_COUNTX = 1;
protected $_COUNTY = 1;
protected $_First = 1;
/**
* @var array{name:string,paper-size:string,orientation:string,metric:string,marginLeft:float,marginTop:float,NX:int,NY:int,SpaceX:float,SpaceY:float,width:float,height:float,font-size:float,custom_x:float,custom_y:float}
*/
public $Tformat;
/**
* @var array
* @var array<string,array{name:string,paper-size:string,orientation:string,metric:string,marginLeft:float,marginTop:float,NX:int,NY:int,SpaceX:float,SpaceY:float,width:float,height:float,font-size:float,custom_x:float,custom_y:float}>
*/
public $_Avery_Labels;
// phpcs:enable
@ -125,7 +131,7 @@ abstract class CommonStickerGenerator extends CommonDocGenerator
/**
* Function to build PDF on disk, then output on HTTP stream.
*
* @param array $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>)
* @param array<string,mixed> $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>)
* @param Translate $outputlangs Lang object for output language
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param string $outputdir Output directory for pdf file
@ -137,9 +143,9 @@ abstract class CommonStickerGenerator extends CommonDocGenerator
/**
* Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0)
*
* @param TCPDF $pdf PDF reference
* @param TCPDF $pdf PDF reference
* @param Translate $outputlangs Output langs
* @param array $param Associative array containing label content and optional parameters
* @param array<string,mixed> $param Associative array containing label content and optional parameters
* @return void
*/
abstract public function addSticker(&$pdf, $outputlangs, $param);

View file

@ -3,6 +3,7 @@
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -357,13 +358,13 @@ class FormActions
/**
* Output html select list of type of event
*
* @param array|string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx'). Can be an array too.
* @param string[]|string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx'). Can be an array too.
* @param string $htmlname Name of select field
* @param string $excludetype A type to exclude ('systemauto', 'system', '')
* @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual", -2=Combined line is disabled (not implemented yet)
* @param int $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value
* @param int $multiselect 1=Allow multiselect of action type
* @param int $nooutput 1=No output
* @param int<-2,1> $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual", -2=Combined line is disabled (not implemented yet)
* @param int<-1,1> $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value
* @param int<0,1> $multiselect 1=Allow multiselect of action type
* @param int<0,1> $nooutput 1=No output
* @param string $morecss More css to add to SELECT component.
* @param int<0,1>|string $showempty 0 or 1 or 'Placeholder string'
* @return string
@ -391,7 +392,7 @@ class FormActions
$selected = 'AC_OTH_AUTO';
}
if (getDolGlobalString('AGENDA_ALWAYS_HIDE_AUTO')) {
if (array_key_exists('AC_OTH_AUTO', $arraylist) && getDolGlobalString('AGENDA_ALWAYS_HIDE_AUTO')) {
unset($arraylist['AC_OTH_AUTO']);
}

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -42,7 +43,6 @@ if ($resql) {
$_Avery_Labels[$row['code']]['metric'] = $row['metric'];
$_Avery_Labels[$row['code']]['marginLeft'] = $row['leftmargin'];
$_Avery_Labels[$row['code']]['marginTop'] = $row['topmargin'];
$_Avery_Labels[$row['code']]['marginTop'] = $row['topmargin'];
$_Avery_Labels[$row['code']]['NX'] = $row['nx'];
$_Avery_Labels[$row['code']]['NY'] = $row['ny'];
$_Avery_Labels[$row['code']]['SpaceX'] = $row['spacex'];

View file

@ -23,6 +23,7 @@
* Copyright (C) 2023 Joachim Kueter <git-jk@bloxera.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Lenin Rivas <lenin.rivas777@gmail.com>
* Copyright (C) 2024 Josep Lluís Amador Teruel <joseplluis@lliuretic.cat>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -8905,6 +8906,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
'__MYCOMPANY_ADDRESS__' => $mysoc->address,
'__MYCOMPANY_ZIP__' => $mysoc->zip,
'__MYCOMPANY_TOWN__' => $mysoc->town,
'__MYCOMPANY_STATE__' => $mysoc->state,
'__MYCOMPANY_COUNTRY__' => $mysoc->country,
'__MYCOMPANY_COUNTRY_ID__' => $mysoc->country_id,
'__MYCOMPANY_COUNTRY_CODE__' => $mysoc->country_code,
@ -8937,6 +8939,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__THIRDPARTY_ADDRESS__'] = '__THIRDPARTY_ADDRESS__';
$substitutionarray['__THIRDPARTY_ZIP__'] = '__THIRDPARTY_ZIP__';
$substitutionarray['__THIRDPARTY_TOWN__'] = '__THIRDPARTY_TOWN__';
$substitutionarray['__THIRDPARTY_STATE__'] = '__THIRDPARTY_STATE__';
$substitutionarray['__THIRDPARTY_IDPROF1__'] = '__THIRDPARTY_IDPROF1__';
$substitutionarray['__THIRDPARTY_IDPROF2__'] = '__THIRDPARTY_IDPROF2__';
$substitutionarray['__THIRDPARTY_IDPROF3__'] = '__THIRDPARTY_IDPROF3__';
@ -9068,6 +9071,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__MEMBER_ADDRESS__'] = (isset($object->address) ? $object->address : '');
$substitutionarray['__MEMBER_ZIP__'] = (isset($object->zip) ? $object->zip : '');
$substitutionarray['__MEMBER_TOWN__'] = (isset($object->town) ? $object->town : '');
$substitutionarray['__MEMBER_STATE__'] = (isset($object->state) ? $object->state : '');
$substitutionarray['__MEMBER_COUNTRY__'] = (isset($object->country) ? $object->country : '');
$substitutionarray['__MEMBER_EMAIL__'] = (isset($object->email) ? $object->email : '');
$substitutionarray['__MEMBER_BIRTH__'] = (isset($birthday) ? $birthday : '');
@ -9107,6 +9111,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__THIRDPARTY_ADDRESS__'] = (is_object($object) ? $object->address : '');
$substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object) ? $object->zip : '');
$substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object) ? $object->town : '');
$substitutionarray['__THIRDPARTY_STATE__'] = (is_object($object) ? $object->state : '');
$substitutionarray['__THIRDPARTY_COUNTRY_ID__'] = (is_object($object) ? $object->country_id : '');
$substitutionarray['__THIRDPARTY_COUNTRY_CODE__'] = (is_object($object) ? $object->country_code : '');
$substitutionarray['__THIRDPARTY_IDPROF1__'] = (is_object($object) ? $object->idprof1 : '');
@ -9131,6 +9136,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__THIRDPARTY_ADDRESS__'] = (is_object($object->thirdparty) ? $object->thirdparty->address : '');
$substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object->thirdparty) ? $object->thirdparty->zip : '');
$substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object->thirdparty) ? $object->thirdparty->town : '');
$substitutionarray['__THIRDPARTY_STATE__'] = (is_object($object->thirdparty) ? $object->thirdparty->state : '');
$substitutionarray['__THIRDPARTY_COUNTRY_ID__'] = (is_object($object->thirdparty) ? $object->thirdparty->country_id : '');
$substitutionarray['__THIRDPARTY_COUNTRY_CODE__'] = (is_object($object->thirdparty) ? $object->thirdparty->country_code : '');
$substitutionarray['__THIRDPARTY_IDPROF1__'] = (is_object($object->thirdparty) ? $object->thirdparty->idprof1 : '');

View file

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Víctor Ortiz Pérez <victor@accett.com.mx>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Víctor Ortiz Pérez <victor@accett.com.mx>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -139,7 +140,7 @@ function dol_convertToWord($num, $langs, $currency = '', $centimes = false)
$concatWords .= ' '.$langs->transnoentities('and');
}
$concatWords .= ' '.dol_convertToWord($decimalpart, $langs, '', true);
$concatWords .= ' '.dol_convertToWord((float) $decimalpart, $langs, '', true);
if (!empty($currency)) {
$concatWords .= ' '.$langs->transnoentities('centimes');
}

View file

@ -264,6 +264,21 @@ function invoice_rec_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT . '/compta/facture/list.php?search_fk_fac_rec_source=' . $object->id;
$head[$h][1] = $langs->trans('InvoicesGeneratedFromRec');
//count facture rec
$nbFacture = 0;
$sql = "SELECT COUNT(rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."facture";
$sql .= " WHERE fk_fac_rec_source = ".((int) $object->id);
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
$nbFacture = $obj->nb;
} else {
dol_syslog('Failed to count invoices with invoice model '.$db->lasterror(), LOG_ERR);
}
if ($nbFacture > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbFacture.'</span>';
}
$head[$h][2] = 'generated';
$h++;
@ -365,6 +380,22 @@ function supplier_invoice_rec_prepare_head($object)
}
$head[$h][0] = DOL_URL_ROOT . '/fourn/facture/list.php?search_fk_fac_rec_source=' . $object->id;
$head[$h][1] = $langs->trans('InvoicesGeneratedFromRec');
//count facture rec
$nbFactureFourn = 0;
$sql = "SELECT COUNT(rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn";
$sql .= " WHERE fk_fac_rec_source = ".((int) $object->id);
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
$nbFactureFourn = $obj->nb;
} else {
dol_syslog('Failed to count invoices with supplier invoice model '.$db->lasterror(), LOG_ERR);
}
if ($nbFactureFourn > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbFactureFourn.'</span>';
}
$head[$h][2] = 'generated';
$h++;

View file

@ -111,6 +111,18 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Fonction to generate document on disk
*
* @param RemiseCheque $object Object RemiseCheque
* @param string $_dir Directory
* @param string $number Number
* @param Translate $outputlangs Lang output object
* @return int<-1,1> 1=ok, 0=ko
*/
abstract public function write_file($object, $_dir, $number, $outputlangs);
// phpcs:enable
}

View file

@ -353,8 +353,9 @@ class pdf_standard_member extends CommonStickerGenerator
$filename .= '.pdf';
// standard format or custom
if ($this->Tformat['paper-size'] != 'custom') {
$this->format = $this->Tformat['paper-size'];
$paper_size = $this->Tformat['paper-size'];
if (!is_string($paper_size) || $paper_size != 'custom') {
$this->format = $paper_size;
} else {
//custom
$resolution = array($this->Tformat['custom_x'], $this->Tformat['custom_y']);

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright (C) 2014-2023 Frederic France <frederic.france@netlogic.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2014-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright (C) 2014-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2014-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -5,6 +5,7 @@
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Francis Appels <francis.appels@yahoo.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -247,8 +248,9 @@ class pdf_standardlabel extends CommonStickerGenerator
}
$this->type = 'pdf';
// standard format or custom
if ($this->Tformat['paper-size'] != 'custom') {
$this->format = $this->Tformat['paper-size'];
$paper_size = $this->Tformat['paper-size'];
if (!is_string($paper_size) || $paper_size != 'custom') {
$this->format = $paper_size;
} else {
//custom
$resolution = array($this->Tformat['custom_x'], $this->Tformat['custom_y']);
@ -337,7 +339,7 @@ class pdf_standardlabel extends CommonStickerGenerator
dolChmod($file);
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1;
}

View file

@ -5,6 +5,7 @@
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Francis Appels <francis.appels@yahoo.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -270,8 +271,9 @@ class pdf_tcpdflabel extends CommonStickerGenerator
}
$this->type = 'pdf';
// standard format or custom
if ($this->Tformat['paper-size'] != 'custom') {
$this->format = $this->Tformat['paper-size'];
$paper_size = $this->Tformat['paper-size'];
if (!is_string($paper_size) || $paper_size != 'custom') {
$this->format = $paper_size;
} else {
//custom
$resolution = array($this->Tformat['custom_x'], $this->Tformat['custom_y']);
@ -360,7 +362,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
dolChmod($file);
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1;
}

View file

@ -1019,8 +1019,8 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer
/**
* Show total to pay
*
* @param TCPDF $pdf Object PDF
* @param Facture $object Object invoice
* @param TCPDF $pdf Object PDF
* @param StockTransfer $object Object StockTransfer
* @param int $deja_regle Montant deja regle
* @param int $posy Position depart
* @param Translate $outputlangs Object langs

View file

@ -729,7 +729,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
* Show miscellaneous information (payment mode, payment term, ...)
*
* @param TCPDF $pdf Object PDF
* @param CommandeFournisseur $object Object to show
* @param CommandeFournisseur $object Object to show
* @param int $posy Y
* @param Translate $outputlangs Langs object
* @return integer
@ -793,8 +793,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
* Show total to pay
*
* @param TCPDF $pdf Object PDF
* @param Facture $object Object invoice
* @param int $deja_regle Montant deja regle
* @param CommandeFournisseur $object Object CommandeFournisseur
* @param int $deja_regle Amount already paid
* @param int $posy Position depart
* @param Translate $outputlangs Object langs
* @return int Position pour suite

View file

@ -524,7 +524,7 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments
// translate amount
$currency = $conf->currency;
$translateinletter = strtoupper(dol_convertToWord(price2num($object->amount, 'MT'), $outputlangs, $currency));
$translateinletter = strtoupper(dol_convertToWord((float) price2num($object->amount, 'MT'), $outputlangs, $currency));
$pdf->SetXY($this->marge_gauche + 50, $posy);
$pdf->SetFont('', '', $default_font_size - 3);
$pdf->MultiCell(90, 8, $translateinletter, 0, 'L', 1);

View file

@ -1,14 +1,14 @@
<?php
/* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2021 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2016 Florian Henry <florian.henry@atm-consulting.fr>
* Copyright (C) 2017-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2020 Christophe Battarel <christophe@altairis.fr>
/* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2021 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2016 Florian Henry <florian.henry@atm-consulting.fr>
* Copyright (C) 2017-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2019-2020 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -202,7 +202,6 @@ if ($action == 'updatelines' && $usercancreate) {
}
}
}
//var_dump($key.' '.$newqty.' '.$idline.' '.$error);
if (!$error) {
$qtystart = 0;
@ -345,7 +344,7 @@ if ($action == 'updatelines' && $usercancreate) {
if ($error > 0) {
$db->rollback();
setEventMessages($error, $errors, 'errors');
setEventMessages($langs->trans("Error"), $errors, 'errors');
} else {
$db->commit();
setEventMessages($langs->trans("ReceptionUpdated"), null);

View file

@ -1,14 +1,14 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2014 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016-2023 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2014 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016-2023 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -456,8 +456,8 @@ class ProductFournisseur extends Product
$ttx = $tva_tx;
$multicurrency_buyprice /= (1 + ($ttx / 100));
}
$multicurrency_buyprice = price2num($multicurrency_buyprice, 'MU');
$multicurrency_unitBuyPrice = price2num((float) $multicurrency_buyprice / $qty, 'MU');
$multicurrency_buyprice = (float) price2num($multicurrency_buyprice, 'MU');
$multicurrency_unitBuyPrice = (float) price2num((float) $multicurrency_buyprice / $qty, 'MU');
$buyprice = (float) $multicurrency_buyprice / $multicurrency_tx;
$fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $multicurrency_code);

View file

@ -1,15 +1,15 @@
<?php
/* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2021 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2016 Florian Henry <florian.henry@atm-consulting.fr>
* Copyright (C) 2017-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2020 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2021 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2016 Florian Henry <florian.henry@atm-consulting.fr>
* Copyright (C) 2017-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2019-2020 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -507,7 +507,7 @@ if ($action == 'updateline' && $permissiontoreceive && empty($cancel)) {
}
if ($error > 0) {
$db->rollback();
setEventMessages($error, $errors, 'errors');
setEventMessages($langs->trans("Error"), $errors, 'errors');
} else {
$db->commit();
}

View file

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -32,8 +33,10 @@ global $noMoreLinkedObjectBlockAfter;
$langs = $GLOBALS['langs'];
'@phan-var-force Translate $langs';
/** @var Translate $langs */
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
'@phan-var-force CommonObject[] $linkedObjectBlock';
/** @var CommonObject[] $linkedObjectBlock */
$langs->load("orders");

View file

@ -825,7 +825,8 @@ if ($search_fk_fac_rec_source) {
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php';
$object = new FactureFournisseurRec($db);
$object->id = (int) $search_fk_fac_rec_source;
$object->fetch((int) $search_fk_fac_rec_source);
$head = supplier_invoice_rec_prepare_head($object);
print dol_get_fiche_head($head, 'generated', $langs->trans('InvoicesGeneratedFromRec'), -1, 'bill'); // Add a div
}
@ -994,10 +995,12 @@ if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predel
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$url = DOL_URL_ROOT.'/fourn/facture/card.php?action=create';
if (!empty($socid)) {
$url .= '&socid='.urlencode((string) ($socid));
if (!empty($object->socid)) {
$url .= '&socid='.urlencode((string) ($object->socid));
}
if (!empty($object->id)) {
$url .= '&fac_rec='.urlencode((string) $object->id);
}
$i = 0;
print '<form method="POST" id="searchFormList" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') {

View file

@ -108,7 +108,7 @@ class Evaluation extends CommonObject
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '0', 'visible' => 5, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '6' => 'Closed'),),
'date_eval' => array('type' => 'date', 'label' => 'DateEval', 'enabled' => 1, 'position' => 502, 'notnull' => 1, 'visible' => 1,),
'fk_user' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'Employee', 'enabled' => 1, 'position' => 504, 'notnull' => 1, 'visible' => 1, 'picto' => 'user', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'),
'fk_user' => array('type' => 'integer:User:user/class/user.class.php:0:(t.statut:!=:0)', 'label' => 'Employee', 'enabled' => 1, 'position' => 504, 'notnull' => 1, 'visible' => 1, 'picto' => 'user', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'),
'fk_job' => array('type' => 'integer:Job:/hrm/class/job.class.php', 'label' => 'JobProfile', 'enabled' => 1, 'position' => 505, 'notnull' => 1, 'visible' => 1, 'picto' => 'jobprofile', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'),
);
/**

View file

@ -282,3 +282,5 @@ CREATE TABLE llx_product_customer_price_extrafields (
) ENGINE=innodb;
ALTER TABLE llx_product_customer_price_extrafields ADD UNIQUE INDEX uk_product_customer_price_extrafields (fk_object);
ALTER TABLE llx_facture ADD COLUMN payment_reference varchar(25) AFTER date_lim_reglement;
ALTER TABLE llx_societe ADD COLUMN tp_payment_reference varchar(25) AFTER code_fournisseur;

View file

@ -79,7 +79,7 @@ create table llx_facture
fk_cond_reglement integer DEFAULT 1 NOT NULL, -- payment term (30 days, end of month...)
fk_mode_reglement integer, -- payment mode (Virement, Prelevement)
date_lim_reglement date, -- due date
payment_reference varchar(25), -- SEPA and any other national or custom payment id
note_private text,
note_public text,
model_pdf varchar(255),

View file

@ -38,7 +38,7 @@ create table llx_societe
code_client varchar(24), -- code client
code_fournisseur varchar(24), -- code fournisseur
tp_payment_reference varchar(25), -- SEPA and any other national or custom payment id
accountancy_code_customer_general varchar(32) DEFAULT NULL, -- customer accountancy general account
code_compta varchar(32), -- customer accountancy auxiliary account
accountancy_code_supplier_general varchar(32) DEFAULT NULL, -- supplier accountancy general account

View file

@ -7,7 +7,7 @@
* Copyright (C) 2014 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2016 Florian Henry <florian.henry@atm-consulting.fr>
* Copyright (C) 2017-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2019-2020 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
@ -280,7 +280,7 @@ if ($action == 'updatelines' && $permissiontoreceive) {
}
if ($error > 0) {
$db->rollback();
setEventMessages($error, $errors, 'errors');
setEventMessages($langs->trans("Error"), $errors, 'errors');
} else {
$db->commit();
setEventMessages($langs->trans("ReceptionUpdated"), null);

View file

@ -4807,6 +4807,7 @@ input.liste_titre {
line-height: 24px;
}
.noborder tr.liste_total td, tr.liste_total td, form.liste_total div, .noborder tr.liste_total_wrap td, tr.liste_total_wrap td, form.liste_total_wrap div {
background: var(--colorbacktitle1);
color: var(--listetotal);
font-weight: normal;
}
@ -4883,9 +4884,9 @@ div.tabBar .noborder {
/* Prepare to remove class pair - impair */
.noborder:not(.editmode) > tbody > tr:nth-child(even):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-child(even):not(.liste_titre):not(.nooddeven),
div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(even):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-of-type(even):not(.liste_titre):not(.nooddeven),
div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(even):not(.liste_titre):not(.nooddeven)
.noborder:not(.editmode) > tbody > tr:nth-child(even):not(.liste_titre):not(.nooddeven):not(.liste_total), .liste > tbody > tr:nth-child(even):not(.liste_titre):not(.nooddeven):not(.liste_total),
div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(even):not(.liste_titre):not(.nooddeven):not(.liste_total), .liste > tbody > tr:nth-of-type(even):not(.liste_titre):not(.nooddeven):not(.liste_total),
div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(even):not(.liste_titre):not(.nooddeven):not(.liste_total)
{
background: linear-gradient(bottom, var(----colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%);
background: -o-linear-gradient(bottom, var(--colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%);
@ -4898,9 +4899,9 @@ div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nt
border-bottom: 1px solid #f0f0f0;
}
.noborder:not(.editmode) > tbody > tr:nth-child(odd):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-child(odd):not(.liste_titre):not(.nooddeven),
div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre):not(.nooddeven),
div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre):not(.nooddeven)
.noborder:not(.editmode) > tbody > tr:nth-child(odd):not(.liste_titre):not(.nooddeven):not(.liste_total), .liste > tbody > tr:nth-child(odd):not(.liste_titre):not(.nooddeven):not(.liste_total),
div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre):not(.nooddeven):not(.liste_total), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre):not(.nooddeven):not(.liste_total),
div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre):not(.nooddeven):not(.liste_total)
{
background: linear-gradient(bottom, var(--colorbacklinepair2) 0%, var(--colorbacklinepair2) 100%);
background: -o-linear-gradient(bottom, var(--colorbacklinepair2) 0%, var(--colorbacklinepair2) 100%);

View file

@ -1,14 +1,14 @@
<?php
/* Copyright (c) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (c) 2005-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (c) 2005-2018 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Alexis Algoud <alexis@atm-consulting.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
/* Copyright (c) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (c) 2005-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (c) 2005-2018 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Alexis Algoud <alexis@atm-consulting.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019 Abbes Bahfir <dolipar@dolipar.org>
* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -93,15 +93,28 @@ class UserGroup extends CommonObject
public $note;
/**
* @var User[]
* @var User[] Array of users
*/
public $members = array(); // Array of users
public $members = array();
public $nb_rights; // Number of rights granted to the user
public $nb_users; // Number of users in the group
/**
* @var int Number of rights granted to the user
*/
public $nb_rights;
public $rights; // Permissions of the group
/**
* @var int Number of users in the group
*/
public $nb_users;
/**
* @var stdClass Permissions of the group
*/
public $rights;
/**
* @var array<string,int> Cache array of already loaded permissions
*/
private $_tab_loaded = array(); // Array of cache of already loaded permissions
/**

View file

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2006-2016 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2006-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
@ -324,7 +324,7 @@ $server->register(
/**
* Get produt or service
*
* @param array $authentication Array of authentication information
* @param array{login:string,password:string,entity:?int,dolibarrkey:string} $authentication Array of authentication information
* @param int $id Id of object
* @param string $ref Ref of object
* @param string $ref_ext Ref external of object
@ -417,7 +417,7 @@ function getUser($authentication, $id, $ref = '', $ref_ext = '')
/**
* getListOfGroups
*
* @param array $authentication Array of authentication information
* @param array{login:string,password:string,entity:?int,dolibarrkey:string} $authentication Array of authentication information
* @return array Array result
*/
function getListOfGroups($authentication)
@ -485,7 +485,7 @@ function getListOfGroups($authentication)
/**
* Create an external user with thirdparty and contact
*
* @param array $authentication Array of authentication information
* @param array{login:string,password:string,entity:?int,dolibarrkey:string} $authentication Array of authentication information
* @param array $thirdpartywithuser Datas
* @return mixed
*/
@ -684,7 +684,7 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser)
/**
* Set password of an user
*
* @param array $authentication Array of authentication information
* @param array{login:string,password:string,entity:?int,dolibarrkey:string} $authentication Array of authentication information
* @param array $shortuser Array of login/password info
* @return mixed
*/

View file

@ -87,10 +87,9 @@ parameters:
- '#(?:Comm(?:(?:ande::updateline|on(?:Invoice::getLibStatut|StickerGenerator::Set_Char_Size))\(\))|Facture(?:(?:::update|FournisseurRec::add)line\(\))|(?:Holiday::addLogCP|Loan::getLibStatut|SupplierProposal::updateline)\(\)|calcul_price_total) expects int, float given\.#'
- '#(?:dol_(?:mktime|remove_file_process)|print_actions_filter) expects int, array\|string given\.#'
- '# (CSMSFile) constructor expects int, array\|string given.#'
- '#(?:ProductFournisseur::logPrice\(\)) expects float\|null#'
- '#(?:(?:Asset::addDepreciationL|Facture(?:(?:(?:Fournisseur)?::add|Fournisseur::update)l))ine\(\)|calcul_price_total|dol_convertToWord|(?:loanCalcMonthlyPaymen|print_paypal_redirec)t) expects float, string given.#'
- '#(?:(?:Asset::addDepreciationL|Facture(?:(?:(?:Fournisseur)?::add|Fournisseur::update)l))ine\(\)|calcul_price_total|(?:loanCalcMonthlyPaymen|print_paypal_redirec)t) expects float, string given.#'
- '#EvalMath::trigger\(\) expects string\|null,#'
- '#(?:F(?:acture(?:(?:Fournisseur)?Rec::addline\(\))|ichinterRec::addLineRec\(\))|dolMd2Html|setEventMessages) expects string\|null,#'
- '#(?:F(?:acture(?:(?:Fournisseur)?Rec::addline\(\))|ichinterRec::addLineRec\(\))|dolMd2Html) expects string\|null,#'
- '#::printStdColumnContent\(\) expects string, float(\|(int|array)(\<.*\>)?)* given.#'
- '#::HTML2OpenIDServer\(\) expects string, array given.#'
- '# dol_stringtotime expects string, DateTime given.#'
@ -108,7 +107,6 @@ parameters:
- '#(?:ftp_(?:c(?:dup|hdir|lose)|delete|get|mkdir|put|rmdir)) expects FTP\\Connection#'
- '#(?:ldap_(?:(?:ad|bin)d|delete|err(?:no|or)|first_entry|get_(?:(?:attribut|entri)es|(?:optio|values_le)n)|mod_(?:add|del|replace)|rename|set_option|unbind)) expects LDAP\\Connection#'
- '#(?:MultiCurrencies::_cleanObjectDatasRate\(\)) expects MultiCurrency#'
- '# (?:pdf_(?:(?:eagle_proforma::drawTotalTable|muscadet::_tableau_tot)\(\))) expects Facture#'
- '# (?:pg_(?:affected_rows|f(?:etch_(?:array|object|row)|ree_result)|num_rows)) expects PgSql\\Result#'
- '# (?:Holiday::getNextNumRef\(\)|get_localtax|pdf_pagefoot|societe_prepare_head) expects Societe#'
- '# (?:Common(?:DocGenerator::get(?:(?:ExtrafieldsInHtml|_substitutionarray_lines)\(\))|Object::printO(?:(?:bject|rigin)Line\(\)))) expects CommonObjectLine#'
@ -116,7 +114,9 @@ parameters:
- '#Call to function array_key_exists.. with .error. .* will always evaluate to false.#'
- '#function dolGetButtonAction expects array\{confirm\?: array.*confirm: true} given.#'
- '#(?:make_substitutions expects array<string, string>,) string given\.#'
- '# (DolibarrApiAccess|Documents|Login|Setup|Status|Boms|Categories|AgendaEvents|Proposals|Orders|BankAccounts|Invoices|Contracts|Donations|Shipments|KnowledgeManagement|Mos|MultiCurrencies|Partnerships|Products|Tasks|Warehouses|Tickets|Workstation|WorkstationResource|WorkstationUserGroup|Zapier)::.* no value type specified in iterable type array\.#'
- '# (DolibarrApiAccess|Documents|Login|Setup|Status|Boms|Categories|ExpenseReports|Interventions|AgendaEvents|Proposals|Orders|BankAccounts|Invoices|Contracts|Donations|Shipments|SupplierInvoices|SupplierOrders|KnowledgeManagement|Mos|MultiCurrencies|Partnerships|Products|Tasks|Warehouses|Tickets|Workstation|WorkstationResource|WorkstationUserGroup|Zapier)::.* no value type specified in iterable type array\.#'
- '#Property RemiseCheque::\$account_id \(int\) does not accept string\.#'
- '#Property Contact::\$roles \(array<int, array\{id: int, socid: int, element: string, source: string, code: string, label: string\}>\) does not accept non-empty-array<int, string>\.#'
internalErrorsCountLimit: 50
cache:

View file

@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
# `codespell` can be run as a standalone program from the CLI
# with the appropriate default options.
skip = "*/.*/*,*/langs/*,*/build/exe/*,**.log,*.pdf,*.PDF,*dev/resources/*,*.phar,*.z,*.gz,*.sql,*.svg,*htdocs/includes/*,*/textiso.txt,*.js,*README-*,*build/rpm/*spec,*build/pad/*ml,*htdocs/includes/phpoffice/*,*htdocs/includes/tecnickcom/*,*dev/initdemo/removeconfdemo.sh,*dev/tools/codespell/*,*dev/trans*/ignore_translation_keys.lst,*pyproject.toml,*build/exe/*,*fontawe*,*htdocs/theme/*/flags-sprite.inc.php,*dev/setup/codetemplates/codetemplates.xml,*/php.ini,*/html_cerfafr.*,*/lessc.class.php,*.asciidoc,*.xml,*opensurvey/css/style.css,*dev/tools/phan/stubs/*,*/documents"
skip = "*/.*/*,*/langs/*,*/build/exe/*,**.log,*.pdf,*.PDF,*dev/resources/*,*.phar,*.z,*.gz,*.sql,*.svg,*htdocs/includes/*,*/textiso.txt,*.js,*README-*,*build/rpm/*spec,*build/pad/*ml,*htdocs/includes/phpoffice/*,*htdocs/includes/tecnickcom/*,*dev/initdemo/removeconfdemo.sh,*dev/tools/codespell/*,*dev/trans*/ignore_translation_keys.lst,*pyproject.toml,*build/exe/*,*fontawe*,*htdocs/theme/*/flags-sprite.inc.php,*dev/setup/codetemplates/codetemplates.xml,*/php.ini,*/html_cerfafr.*,*/lessc.class.php,*.asciidoc,*.xml,*opensurvey/css/style.css,*dev/tools/phan/stubs/*,*/documents,phpstan.*"
check-hidden = true
quiet-level=2