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

This commit is contained in:
Laurent Destailleur 2024-10-14 13:37:05 +02:00
commit be4b8efebd
193 changed files with 2058 additions and 914 deletions

View file

@ -474,7 +474,7 @@ if ($nboftargetok) {
print "Clean $BUILDROOT\n";
$ret=`rm -f $BUILDROOT/$PROJECT/.buildpath`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.codeclimate`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.codeclimate.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.externalToolBuilders`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.git*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
@ -484,8 +484,11 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/.stickler.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.travis.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.tx`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.pre-commit-config.yaml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.phan`;
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
$ret=`rm -f $BUILDROOT/$PROJECT/phpstan.neon`;
$ret=`rm -fr $BUILDROOT/$PROJECT/phpstan.neon.dist`;
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
$ret=`rm -f $BUILDROOT/$PROJECT/README-*.md`;

View file

@ -9,36 +9,36 @@
*/
return [
// # Issue statistics:
// PhanPluginUnknownPropertyType : 1000+ occurrences
// PhanUndeclaredProperty : 840+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 630+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 470+ occurrences
// PhanUndeclaredGlobalVariable : 410+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 380+ occurrences
// PhanPluginUnknownArrayMethodParamType : 290+ occurrences
// PhanUndeclaredProperty : 800+ occurrences
// PhanPluginUnknownPropertyType : 740+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 600+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 430+ occurrences
// PhanUndeclaredGlobalVariable : 380+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 320+ occurrences
// PhanPluginUnknownArrayMethodParamType : 270+ occurrences
// PhanPossiblyUndeclaredVariable : 260+ occurrences
// PhanTypeMismatchProperty : 180+ occurrences
// PhanPluginUnknownArrayFunctionReturnType : 140+ occurrences
// PhanPluginUnknownArrayFunctionParamType : 120+ occurrences
// PhanTypeMismatchProperty : 170+ occurrences
// PhanPluginUnknownArrayFunctionParamType : 110+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 70+ occurrences
// PhanPluginUndeclaredVariableIsset : 65+ occurrences
// PhanPluginUnknownArrayPropertyType : 65+ occurrences
// PhanPluginEmptyStatementIf : 50+ occurrences
// PhanPluginUnknownArrayPropertyType : 60+ occurrences
// PhanPluginUnknownArrayFunctionReturnType : 55+ occurrences
// PhanRedefineFunction : 50+ occurrences
// PhanTypeSuspiciousNonTraversableForeach : 50+ occurrences
// PhanTypeInvalidDimOffset : 35+ occurrences
// PhanTypeMismatchDimFetch : 30+ occurrences
// PhanPluginUnknownObjectMethodCall : 25+ occurrences
// PhanPluginEmptyStatementIf : 45+ occurrences
// PhanTypeMismatchDimFetch : 40+ occurrences
// PhanTypeSuspiciousNonTraversableForeach : 30+ occurrences
// PhanTypeExpectedObjectPropAccess : 25+ occurrences
// PhanTypeInvalidDimOffset : 25+ occurrences
// PhanPluginUnknownObjectMethodCall : 15+ occurrences
// PhanTypeComparisonFromArray : 15+ occurrences
// PhanUndeclaredConstant : 15+ occurrences
// PhanUndeclaredMethod : 15+ occurrences
// PhanEmptyForeach : 10+ occurrences
// PhanPluginConstantVariableNull : 10+ occurrences
// PhanPluginSuspiciousParamPosition : 10+ occurrences
// PhanPossiblyNullTypeMismatchProperty : 10+ occurrences
// PhanTypeMismatchDimFetchNullable : 10+ occurrences
// PhanUndeclaredMethod : 10+ occurrences
// PhanPluginBothLiteralsBinaryOp : 8 occurrences
// PhanPluginSuspiciousParamPosition : 8 occurrences
// PhanPluginDuplicateExpressionBinaryOp : 7 occurrences
// PhanParamTooMany : 5 occurrences
// PhanPluginDuplicateArrayKey : 4 occurrences
@ -51,11 +51,8 @@ return [
'file_suppressions' => [
'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanUndeclaredProperty'],
'htdocs/accountancy/class/accountingjournal.class.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/accountancy/journal/purchasesjournal.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/adherents/canvas/actions_adherentcard_common.class.php' => ['PhanTypeSuspiciousNonTraversableForeach'],
'htdocs/adherents/list.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/adherents/stats/index.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/admin/fckeditor.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/api/class/api_access.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'],
'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'],
@ -82,21 +79,16 @@ return [
'htdocs/bom/bom_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/bom/class/api_boms.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/bom/class/bom.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/bom/lib/bom.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/bom/tpl/objectline_edit.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/bom/tpl/objectline_view.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/bookcal/availabilities_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/bookcal/availabilities_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/bookcal/booking_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/bookcal/calendar_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/bookcal/calendar_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/bookcal/class/availabilities.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/bookcal/class/calendar.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/bookcal/lib/bookcal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/bookcal/lib/bookcal_availabilities.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/bookcal/lib/bookcal_calendar.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/categories/class/categorie.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanTypeMismatchProperty'],
'htdocs/categories/class/categorie.class.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'],
'htdocs/categories/edit.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/categories/index.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/categories/info.php' => ['PhanTypeMismatchDimFetch'],
@ -114,7 +106,7 @@ return [
'htdocs/comm/action/list.php' => ['PhanTypeMismatchProperty'],
'htdocs/comm/action/pertype.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchDimFetch'],
'htdocs/comm/action/peruser.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanTypeComparisonFromArray'],
'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition', 'PhanTypeMismatchArgumentProbablyReal'],
'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'],
@ -123,16 +115,13 @@ return [
'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/class/propalestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/comm/propal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/commande/class/commande.class.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/class/commandestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/commande/customer.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/commande/list.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/list_det.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/commande/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/commande/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/accounting-files.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'],
@ -156,21 +145,20 @@ return [
'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullableInternal'],
'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/deplacement/class/deplacement.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/compta/deplacement/class/deplacementstats.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' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'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'],
'htdocs/compta/facture/note.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/prelevement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/tpl/linkedobjectblock.tpl.php' => ['PhanEmptyFQSENInClasslike', 'PhanInvalidFQSENInClasslike', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'],
'htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/journal/purchasesjournal.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
@ -246,7 +234,6 @@ return [
'htdocs/core/ajax/ajaxdirtree.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/ajax/fileupload.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/ajax/onlineSign.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/ajax/saveinplace.php' => ['PhanUndeclaredProperty'],
'htdocs/core/ajax/selectobject.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/ajax/selectsearchbox.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/core/boxes/box_actions.php' => ['PhanPossiblyUndeclaredVariable'],
@ -304,7 +291,7 @@ return [
'htdocs/core/class/html.formcompany.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/html.formfile.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayMethodParamType', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/class/html.formldap.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/core/class/html.formmail.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/class/html.formmail.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/html.formmargin.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
'htdocs/core/class/html.formprojet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/class/html.formsetup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'],
@ -318,7 +305,7 @@ return [
'htdocs/core/class/socialnetworkmanager.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/core/class/stats.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchDimFetch'],
'htdocs/core/class/timespent.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/class/translate.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/core/class/translate.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/core/class/utils.class.php' => ['PhanPluginConstantVariableNull', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/customreports.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetchNullable'],
'htdocs/core/datepicker.php' => ['PhanTypeInvalidDimOffset'],
@ -330,58 +317,32 @@ return [
'htdocs/core/filemanagerdol/connectors/php/connector.lib.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayFunctionParamType', 'PhanTypeInvalidDimOffset'],
'htdocs/core/lib/accounting.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/admin.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'],
'htdocs/core/lib/agenda.lib.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/lib/agenda.lib.php' => ['PhanPluginConstantVariableNull', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/lib/ajax.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/lib/asset.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/bank.lib.php' => ['PhanPluginEmptyStatementIf', 'PhanUndeclaredProperty'],
'htdocs/core/lib/company.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'],
'htdocs/core/lib/contract.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/cron.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/customreports.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchDimFetch'],
'htdocs/core/lib/date.lib.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/core/lib/doc.lib.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/ecm.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/eventorganization.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/expedition.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/expensereport.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/files.lib.php' => ['PhanUndeclaredProperty'],
'htdocs/core/lib/fourn.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/ftp.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/core/lib/functions2.lib.php' => ['PhanUndeclaredProperty'],
'htdocs/core/lib/functionsnumtoword.lib.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/geturl.lib.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/core/lib/holiday.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/hrm.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/images.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/core/lib/import.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/invoice.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/invoice2.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/ldap.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/loan.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/mailmanspip.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/memory.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/multicurrency.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/lib/oauth.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/order.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/payments.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/pdf.lib.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'],
'htdocs/core/lib/prelevement.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/price.lib.php' => ['PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/product.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/project.lib.php' => ['PhanUndeclaredProperty'],
'htdocs/core/lib/receiptprinter.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/report.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/lib/resource.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/salaries.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/security.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/lib/signature.lib.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/socialnetwork.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/stock.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/takepos.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/tax.lib.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/lib/ticket.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/treeview.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/lib/website.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/core/lib/xcal.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
'htdocs/core/menus/standard/auguria.lib.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/core/menus/standard/eldy_menu.php' => ['PhanTypeInvalidDimOffset'],
@ -457,8 +418,8 @@ return [
'htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/supplier_order/modules_commandefournisseur.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'],
'htdocs/core/modules/syslog/mod_syslog_syslog.php' => ['PhanPluginConstantVariableNull', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeSuspiciousNonTraversableForeach'],
@ -518,7 +479,6 @@ return [
'htdocs/don/card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/don/class/api_donations.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/don/class/don.class.php' => ['PhanParamTooMany', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType'],
'htdocs/don/class/donstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/don/class/paymentdonation.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/don/document.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/don/index.php' => ['PhanPluginUndeclaredVariableIsset'],
@ -528,7 +488,6 @@ return [
'htdocs/don/paiement/list.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/don/payment/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/don/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/don/stats/index.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/don/tpl/linkedobjectblock.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/ecm/class/ecmdirectory.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/ecm/class/ecmfiles.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
@ -540,8 +499,6 @@ return [
'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
'htdocs/emailcollector/class/emailcollectoraction.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/emailcollector/class/emailcollectorfilter.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/emailcollector/lib/emailcollector.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/eventorganization/class/conferenceorbooth.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/eventorganization/conferenceorbooth_card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/eventorganization/conferenceorbooth_contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
@ -549,12 +506,10 @@ return [
'htdocs/eventorganization/conferenceorboothattendee_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/eventorganization/conferenceorboothattendee_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/eventorganization/core/actions_massactions_mail.inc.php' => ['PhanUndeclaredProperty'],
'htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/expedition/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/expedition/class/api_shipments.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/expedition/class/expedition.class.php' => ['PhanUndeclaredProperty'],
'htdocs/expedition/class/expeditionlinebatch.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/expedition/class/expeditionstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/expedition/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/expedition/dispatch.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/expedition/document.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
@ -564,7 +519,6 @@ return [
'htdocs/expedition/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/expensereport/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/expensereport/class/api_expensereports.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/expensereport/class/expensereportstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/expensereport/payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/expensereport/payment/info.php' => ['PhanUndeclaredGlobalVariable'],
@ -577,7 +531,7 @@ return [
'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/fichinter/class/api_interventions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'],
'htdocs/fichinter/class/fichinterstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/fichinter/class/fichinterstats.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/fichinter/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/fichinter/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/filefunc.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
@ -626,19 +580,12 @@ return [
'htdocs/hrm/job_agenda.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/hrm/job_card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/hrm/job_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/hrm/lib/hrm.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/hrm/lib/hrm_job.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/hrm/lib/hrm_position.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/hrm/lib/hrm_skill.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/hrm/lib/hrm_skilldet.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/hrm/lib/hrm_skillrank.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/hrm/position_list.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/hrm/skill_card.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/hrm/skill_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/imports/class/import.class.php' => ['PhanPluginEmptyStatementIf'],
'htdocs/imports/emptyexample.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/imports/import.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/install/check.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/install/fileconf.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/install/inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanRedefineFunction'],
@ -649,7 +596,6 @@ return [
'htdocs/install/upgrade.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/intracommreport/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/intracommreport/class/intracommreport.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/intracommreport/lib/intracommreport.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanUndeclaredProperty'],
'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'],
@ -670,8 +616,6 @@ return [
'htdocs/master.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/mrp/class/api_mos.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/mrp/class/mo.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/mrp/lib/mrp.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/mrp/lib/mrp_mo.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/mrp/mo_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/mrp/mo_movements.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'],
'htdocs/mrp/mo_production.php' => ['PhanTypeMismatchArgumentProbablyReal'],
@ -682,7 +626,7 @@ return [
'htdocs/opcachepreload.php' => ['PhanEmptyForeach'],
'htdocs/opensurvey/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/opensurvey/class/opensurveysondage.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty'],
'htdocs/opensurvey/lib/opensurvey.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/opensurvey/lib/opensurvey.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/opensurvey/list.php' => ['PhanEmptyForeach', 'PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/opensurvey/results.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'],
'htdocs/opensurvey/wizard/choix_date.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
@ -691,12 +635,10 @@ return [
'htdocs/partnership/class/partnership.class.php' => ['PhanUndeclaredProperty'],
'htdocs/partnership/class/partnershiputils.class.php' => ['PhanPluginUnknownObjectMethodCall'],
'htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/partnership/lib/partnership.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/partnership/partnership_card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/partnership/partnership_list.php' => ['PhanUndeclaredProperty'],
'htdocs/paypal/lib/paypal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/printing/index.php' => ['PhanUndeclaredProperty'],
'htdocs/printing/lib/printing.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/product/admin/product.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/product/ajax/products.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/product/canvas/product/actions_card_product.class.php' => ['PhanTypeSuspiciousNonTraversableForeach'],
@ -717,7 +659,6 @@ return [
'htdocs/product/inventory/card.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/product/inventory/class/inventory.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/product/inventory/inventory.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/product/inventory/lib/inventory.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/product/inventory/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/product/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/product/price.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
@ -744,7 +685,6 @@ return [
'htdocs/product/stock/stats/reception.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/stockatdate.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/product/stock/stocktransfer/class/stocktransferline.class.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/product/stock/stocktransfer/stocktransfer_card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/product/stock/stocktransfer/stocktransfer_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/product/stock/tpl/stockcorrection.tpl.php' => ['PhanUndeclaredProperty'],
@ -756,7 +696,7 @@ return [
'htdocs/projet/ajax/projects.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/projet/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/projet/class/api_tasks.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/projet/class/projectstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/projet/class/projectstats.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/projet/class/task.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/projet/class/taskstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/projet/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'],
@ -808,7 +748,7 @@ return [
'htdocs/public/ticket/view.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/public/webportal/webportal.main.inc.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction'],
'htdocs/public/website/index.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/public/website/index.php' => ['PhanRedefineFunction'],
'htdocs/public/website/javascript.js.php' => ['PhanRedefineFunction'],
'htdocs/public/website/styles.css.php' => ['PhanRedefineFunction'],
'htdocs/reception/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
@ -837,13 +777,12 @@ return [
'htdocs/recruitment/recruitmentjobposition_note.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/resource/class/dolresource.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/resource/class/html.formresource.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeExpectedObjectPropAccess'],
'htdocs/resource/element_resource.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/resource/element_resource.php' => ['PhanUndeclaredProperty'],
'htdocs/salaries/admin/salaries.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/salaries/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/salaries/class/api_salaries.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/salaries/class/paymentsalary.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/salaries/class/salariesstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/salaries/class/salary.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'],
'htdocs/salaries/class/salariesstats.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/salaries/document.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/salaries/info.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
@ -853,7 +792,6 @@ return [
'htdocs/societe/ajax/ajaxcompanies.php' => ['PhanUndeclaredProperty'],
'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/societe/canvas/actions_card_common.class.php' => ['PhanTypeSuspiciousNonTraversableForeach'],
'htdocs/societe/card.php' => ['PhanTypeMismatchProperty'],
'htdocs/societe/checkvat/checkVatPopup.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/societe/class/api_contacts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'],
@ -870,15 +808,13 @@ return [
'htdocs/stripe/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'],
'htdocs/stripe/class/stripe.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/stripe/lib/stripe.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'],
'htdocs/supplier_proposal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/support/inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanRedefineFunction'],
'htdocs/takepos/admin/orderprinters.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/takepos/admin/terminal.php' => ['PhanPluginUnknownObjectMethodCall'],
'htdocs/takepos/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/takepos/floors.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/takepos/freezone.php' => ['PhanTypeMismatchArgumentProbablyReal'],
@ -905,7 +841,7 @@ return [
'htdocs/ticket/class/api_tickets.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/ticket/class/cticketcategory.class.php' => ['PhanUndeclaredProperty'],
'htdocs/ticket/class/ticket.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/ticket/class/ticketstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/ticket/class/ticketstats.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/ticket/contact.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/ticket/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/ticket/list.php' => ['PhanTypeComparisonFromArray'],
@ -922,24 +858,20 @@ return [
'htdocs/variants/combinations.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'],
'htdocs/variants/tpl/productattributevalueline_edit.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/variants/tpl/productattributevalueline_view.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/viewimage.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanRedefineFunction'],
'htdocs/viewimage.php' => ['PhanRedefineFunction', 'PhanUndeclaredMethod'],
'htdocs/webhook/class/api_webhook.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/webhook/class/target.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty'],
'htdocs/webhook/lib/webhook.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/webhook/lib/webhook_target.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/webhook/class/target.class.php' => ['PhanUndeclaredMethod'],
'htdocs/webhook/target_card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/webhook/target_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/webportal/class/context.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/webportal/class/controller.class.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/webportal/class/html.formcardwebportal.class.php' => ['PhanUndeclaredProperty'],
'htdocs/webportal/class/html.formlistwebportal.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/webportal/class/html.formwebportal.class.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/webportal/class/webportalinvoice.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/webportal/class/webportalmember.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/webportal/class/webportalpropal.class.php' => ['PhanUndeclaredProperty'],
'htdocs/webportal/lib/webportal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/webservices/server_actioncomm.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'],
'htdocs/webservices/server_category.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'],
'htdocs/webservices/server_category.php' => ['PhanUndeclaredProperty'],
'htdocs/webservices/server_contact.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/webservices/server_invoice.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/webservices/server_order.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredProperty'],
@ -950,21 +882,17 @@ return [
'htdocs/webservices/server_thirdparty.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/webservices/server_user.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'],
'htdocs/website/class/website.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/website/index.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/website/lib/websiteaccount.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/website/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/website/samples/wrapper.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/website/websiteaccount_card.php' => ['PhanUndeclaredProperty'],
'htdocs/workstation/class/api_workstations.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/workstation/class/workstation.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'],
'htdocs/workstation/class/workstation.class.php' => ['PhanUndeclaredProperty'],
'htdocs/workstation/class/workstationresource.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/workstation/class/workstationusergroup.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/workstation/lib/workstation.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/workstation/lib/workstation_workstation.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/workstation/workstation_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/workstation/workstation_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/zapier/class/api_zapier.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/zapier/class/hook.class.php' => ['PhanUndeclaredProperty'],
'htdocs/zapier/lib/zapier.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'internal' => ['PhanUndeclaredConstant'],
],
// 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed.

View file

@ -462,7 +462,7 @@ class AccountingJournal extends CommonObject
$element = array(
'ref' => dol_trunc($element_static->ref, 16, 'right', 'UTF-8', 1),
'error' => $pre_data_info['error'],
'error' => array_key_exists('error', $pre_data_info) ? $pre_data_info['error'] : '',
'blocks' => array(),
);

View file

@ -142,10 +142,12 @@ $sql .= " soc.rowid as socid, soc.nom as name, soc.email as email, bu1.type as t
if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
$sql .= " spe.accountancy_code_customer_general,";
$sql .= " spe.accountancy_code_customer as code_compta_client,";
$sql .= " spe.accountancy_code_supplier_general,";
$sql .= " spe.accountancy_code_supplier as code_compta_fournisseur,";
} else {
$sql .= " soc.accountancy_code_customer_general,";
$sql .= " soc.code_compta as code_compta_client,";
$sql .= " soc.accountancy_code_supplier_general,";
$sql .= " soc.code_compta_fournisseur,";
}
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, u.email as useremail, u.statut as userstatus,";
@ -228,6 +230,7 @@ $tabmoreinfo = array();
';
$account_customer = 'NotDefined';
$account_supplier = 'NotDefined';
//print $sql;
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
@ -285,6 +288,7 @@ if ($result) {
$compta_soc = 'NotDefined';
$accountancy_code_general = 'NotDefined';
if ($lineisapurchase > 0) {
$accountancy_code_general = (!empty($obj->accountancy_code_supplier_general)) ? $obj->accountancy_code_supplier_general : $account_supplier;
$compta_soc = (($obj->code_compta_fournisseur != "") ? $obj->code_compta_fournisseur : $account_supplier);
}
if ($lineisasale > 0) {
@ -1034,7 +1038,8 @@ if ($action == 'exportcsv' && $user->hasRight('accounting', 'bind', 'write')) {
print '"'.$val["type_payment"].'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
if ($tabtype[$key] == 'payment_supplier') {
print '"'.getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER').'"'.$sep;
$account_ledger = (!empty($obj->accountancy_code_supplier_general)) ? $obj->accountancy_code_supplier_general : $account_supplier;
print '"'.$account_ledger.'"'.$sep;
} elseif ($tabtype[$key] == 'payment') {
$account_ledger = (!empty($obj->accountancy_code_customer_general)) ? $obj->accountancy_code_customer_general : $account_customer;
print '"'.$account_ledger.'"'.$sep;

View file

@ -86,6 +86,8 @@ $tabrclocaltax1 = array();
$tabrclocaltax2 = array();
$tabpay = array();
$cptcli = 'NotDefined';
$cptfour = 'NotDefined';
/*
* Actions
@ -133,10 +135,14 @@ $sql .= " p.default_vat_code AS product_buy_default_vat_code, p.tva_tx as produc
$sql .= " co.code as country_code, co.label as country_label,";
$sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.fk_pays,";
if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
$sql .= " spe.accountancy_code_customer_general,";
$sql .= " spe.accountancy_code_customer as code_compta,";
$sql .= " spe.accountancy_code_supplier_general,";
$sql .= " spe.accountancy_code_supplier as code_compta_fournisseur,";
} else {
$sql .= " s.accountancy_code_customer_general,";
$sql .= " s.code_compta as code_compta,";
$sql .= " s.accountancy_code_supplier_general,";
$sql .= " s.code_compta_fournisseur,";
}
if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
@ -221,6 +227,7 @@ if ($result) {
$obj = $db->fetch_object($result);
// Controls
$accountancy_code_supplier_general = (!empty($obj->accountancy_code_supplier_general)) ? $obj->accountancy_code_supplier_general : $cptfour;
$compta_soc = ($obj->code_compta_fournisseur != "") ? $obj->code_compta_fournisseur : $cptfour;
$compta_prod = $obj->compte;
@ -339,6 +346,7 @@ if ($result) {
'id' => $obj->socid,
'name' => $obj->name,
'code_fournisseur' => $obj->code_fournisseur,
'accountancy_code_supplier_general' => $accountancy_code_supplier_general,
'code_compta_fournisseur' => $compta_soc
);
@ -427,6 +435,7 @@ if ($action == 'writebookkeeping' && !$error && $user->hasRight('accounting', 'b
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
$companystatic->accountancy_code_supplier_general = $tabcompany[$key]['accountancy_code_supplier_general'];
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
$companystatic->fournisseur = 1;
@ -479,7 +488,7 @@ if ($action == 'writebookkeeping' && !$error && $user->hasRight('accounting', 'b
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur'];
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
$bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER');
$bookkeeping->numero_compte = $tabcompany[$key]['accountancy_code_supplier_general'];
$bookkeeping->label_compte = $accountingaccountsupplier->label;
$bookkeeping->label_operation = $bookkeepingstatic->accountingLabelForOperation($companystatic->name, $invoicestatic->ref_supplier, $langs->trans("SubledgerAccount"));
@ -546,7 +555,7 @@ if ($action == 'writebookkeeping' && !$error && $user->hasRight('accounting', 'b
if (getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT')) {
if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT')) {
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur'];
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
} else {
$bookkeeping->subledger_account = '';
@ -803,6 +812,7 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
foreach ($tabfac as $key => $val) {
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
$companystatic->accountancy_code_supplier_general = !empty($tabcompany[$key]['accountancy_code_supplier_general']) ? $tabcompany[$key]['accountancy_code_supplier_general'] : $cptfour;
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
$companystatic->fournisseur = 1;
@ -839,7 +849,7 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
print '"'.$val["refsologest"].'"'.$sep;
print '"'.csvClean(dol_trunc($companystatic->name, 32)).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER')).'"'.$sep;
print '"'.length_accountg($companystatic->accountancy_code_supplier_general).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.$langs->trans("Thirdparty").'"'.$sep;
print '"'.csvClean($bookkeepingstatic->accountingLabelForOperation($companystatic->name, $val["refsuppliersologest"], $langs->trans("Thirdparty"))).'"'.$sep;
@ -1057,6 +1067,7 @@ if (empty($action) || $action == 'view') {
foreach ($tabfac as $key => $val) {
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
$companystatic->accountancy_code_supplier_general = !empty($tabcompany[$key]['accountancy_code_supplier_general']) ? $tabcompany[$key]['accountancy_code_supplier_general'] : $cptfour;
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
$companystatic->fournisseur = 1;
@ -1131,7 +1142,7 @@ if (empty($action) || $action == 'view') {
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
// Account
print "<td>";
$accountoshow = length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'));
$accountoshow = length_accountg(!empty($tabcompany[$key]['accountancy_code_supplier_general']) ? $tabcompany[$key]['accountancy_code_supplier_general'] : $cptfour);
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
print '<span class="error">'.$langs->trans("MainAccountForSuppliersNotDefined").'</span>';
} else {
@ -1182,7 +1193,7 @@ if (empty($action) || $action == 'view') {
print "<td>";
if (getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT')) {
if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT')) {
print length_accounta($tabcompany[$key]['code_compta']);
print length_accounta($tabcompany[$key]['code_compta_fournisseur']);
}
} elseif (($accountoshow == "") || $accountoshow == 'NotDefined') {
print '<span class="error">' . $langs->trans("ThirdpartyAccountNotDefined") . '</span>';

View file

@ -136,10 +136,12 @@ $sql .= " s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur,";
if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
$sql .= " spe.accountancy_code_customer_general,";
$sql .= " spe.accountancy_code_customer as code_compta_client,";
$sql .= " spe.accountancy_code_supplier_general,";
$sql .= " spe.accountancy_code_supplier as code_compta_fournisseur,";
} else {
$sql .= " s.accountancy_code_customer_general,";
$sql .= " s.code_compta as code_compta_client,";
$sql .= " s.accountancy_code_supplier_general,";
$sql .= " s.code_compta_fournisseur,";
}
$sql .= " p.rowid as pid, p.ref as pref, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte,";

View file

@ -172,7 +172,7 @@ class AdherentStats extends Stats
/**
* Return nb, total and average
*
* @return array<array{year:string,nb:string,nb_diff:float,total_diff:float,avg_diff:float,avg_weighted:float}> Array with nb, total amount, average for each year
* @return array<array{year:string,nb:string,nb_diff:float,total?:float,avg?:float,weighted?:float,total_diff?:float,avg_diff?:float,avg_weighted?:float}> Array with nb, total amount, average for each year
*/
public function getAllByYear()
{

View file

@ -9,6 +9,7 @@
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.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
@ -758,6 +759,17 @@ print "</select>";
print ajax_combobox("chq", array(), 0, 0, 'resolve', '-2');
print "</td></tr>";
// Structured communication
// Specific to Belgium - See core/lib/functions_be.lib.php
if ($mysoc->country_code == 'BE') {
print '<tr class="oddeven"><td>' . $langs->trans("InvoicePaymentManageStructuredCommunication") . '&nbsp;';
print $form->textwithpicto('', $langs->trans("InvoicePaymentManageStructuredCommunicationHelp"), 1, 'help') . '</td>';
print '<td class="left" colspan="2">';
print ajax_constantonoff('INVOICE_PAYMENT_ENABLE_STRUCTURED_COMMUNICATION');
print '</td></tr>';
}
print "</table>";
print '</div>';

View file

@ -1123,7 +1123,7 @@ if ($num) {
print "</tr>\n";
print '<tr class="oddeven nohover" id="tr-aaa-'.$rowid.'">';
print '<td colspan="10">';
print '<td colspan="10" class="paddingleft" style="padding-left: 20px">';
$fieldsforcontent = array('topic', 'email_from','joinfiles', 'content');
if (getDolGlobalString('MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES')) {
@ -1155,7 +1155,7 @@ if ($num) {
}
if ($tmpfieldlist == 'content') {
print $form->textwithpicto($langs->trans("Content"), $tabhelp[25][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'<br>';
print $form->textwithpicto($langs->trans("Content"), $tabhelp[25][$tmpfieldlist], 1, 'help', 'margintoponly', 0, 2, $tmpfieldlist).'<br>';
$okforextended = true;
if (!getDolGlobalString('FCKEDITOR_ENABLE_MAIL')) {
$okforextended = false;
@ -1165,7 +1165,7 @@ if ($num) {
}
if ($tmpfieldlist == 'content_lines') {
print '<br>'."\n";
print $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[25][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'<br>';
print $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[25][$tmpfieldlist], 1, 'help', 'margintoponly', 0, 2, $tmpfieldlist).'<br>';
$okforextended = true;
if (!getDolGlobalString('FCKEDITOR_ENABLE_MAIL')) {
$okforextended = false;

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2019 Maxime Kohlhaas <maxime@atm-consulting.fr>
* Copyright (C) 2019-2023 Frédéric France <frederic.france@netlogic.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
@ -25,7 +26,7 @@
/**
* Prepare admin pages header
*
* @return array
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function bomAdminPrepareHead()
{
@ -73,7 +74,7 @@ function bomAdminPrepareHead()
* Prepare array of tabs for BillOfMaterials
*
* @param BOM $object BillOfMaterials
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function bomPrepareHead($object)
{

View file

@ -95,7 +95,7 @@ if (!$permissiontoread) {
* Actions
*/
$parameters = '';
$parameters = array();
$helpurl = '';
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
* 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
@ -25,7 +26,7 @@
/**
* Prepare admin pages header
*
* @return array
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function bookcalAdminPrepareHead()
{

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
* 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
@ -26,7 +27,7 @@
* Prepare array of tabs for Availabilities
*
* @param Availabilities $object Availabilities
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function availabilitiesPrepareHead($object)
{

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2023 Alice Adminson <aadminson@example.com>
* 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
@ -26,7 +27,7 @@
* Prepare array of tabs for Calendar
*
* @param Calendar $object Calendar
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function calendarPrepareHead($object)
{

View file

@ -263,12 +263,12 @@ class Categorie extends CommonObject
public $cats = array();
/**
* @var array Mother of table
* @var array<int,int> Mother of table
*/
public $motherof = array();
/**
* @var array children
* @var Categorie[] children
*/
public $childs = array();
@ -338,7 +338,7 @@ class Categorie extends CommonObject
/**
* Get map list
*
* @return array
* @return array<array{id:int,code:string,cat_fk:string,cat_table:string,obj_class:string,obj_table:string}>
*/
public function getMapList()
{
@ -361,7 +361,7 @@ class Categorie extends CommonObject
/**
* Get MAP_ID
*
* @return array
* @return array<string,int>
*/
public function getMapId()
{
@ -1105,7 +1105,7 @@ class Categorie extends CommonObject
/**
* Return direct children ids of a category into an array
*
* @return array|int Return integer <0 KO, array ok
* @return Categorie[]|int Return integer <0 KO, array ok
*/
public function get_filles()
{
@ -1337,14 +1337,14 @@ class Categorie extends CommonObject
/**
* Returns all categories
*
* @param int $type Type of category (0, 1, ...)
* @param ?int $type Type of category (0, 1, ...)
* @param boolean $parent Just parent categories if true
* @return array|int Table of Object Category, -1 on error
* @return array<int,Categorie>|int<-1,-1> Table of Object Category, -1 on error
*/
public function get_all_categories($type = null, $parent = false)
{
// phpcs:enable
if (!is_numeric($type)) {
if (!is_numeric($type) && !is_null($type)) {
$type = $this->MAP_ID[$type];
}
@ -1376,8 +1376,8 @@ class Categorie extends CommonObject
/**
* Returns the top level categories (which are not child)
*
* @param int $type Type of category (0, 1, ...)
* @return array
* @param ?int $type Type of category (0, 1, ...)
* @return array<int,Categorie>|int<-1,-1> Table of Object Category, -1 on error
*/
public function get_main_categories($type = null)
{
@ -1443,7 +1443,7 @@ class Categorie extends CommonObject
* @param string $url Url ('', 'none' or 'urltouse')
* @param int $nocolor 0
* @param int $addpicto Add picto into link
* @return array
* @return string[]
*/
public function print_all_ways($sep = '&gt;&gt;', $url = '', $nocolor = 0, $addpicto = 0)
{
@ -1850,9 +1850,9 @@ class Categorie extends CommonObject
/**
* Add the image uploaded as $file to the directory $sdir/<category>-<id>/photos/
*
* @param string $sdir Root destination directory
* @param array $file Uploaded file name
* @return void
* @param string $sdir Root destination directory
* @param array{name:string,tmp_name:string} $file Uploaded file name
* @return void
*/
public function add_photo($sdir, $file)
{
@ -1898,9 +1898,9 @@ class Categorie extends CommonObject
/**
* Return an array with all photos inside the directory
*
* @param string $dir Dir to scan
* @param int $nbmax Nombre maximum de photos (0=pas de max)
* @return array Tableau de photos
* @param string $dir Dir to scan
* @param int $nbmax Nombre maximum de photos (0=pas de max)
* @return array<int,array{photo:string,photo_vignette:string}> Table with images
*/
public function liste_photos($dir, $nbmax = 0)
{
@ -1997,7 +1997,7 @@ class Categorie extends CommonObject
}
/**
* Update ou cree les traductions des infos produits
* Create or Update translations of categories labels
*
* @param User $user Object user
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
@ -2021,7 +2021,7 @@ class Categorie extends CommonObject
if ($key == $current_lang) {
$sql2 = '';
if ($this->db->num_rows($result)) { // si aucune ligne dans la base
if ($this->db->num_rows($result)) { // if no line in database
$sql2 = "UPDATE ".MAIN_DB_PREFIX."categorie_lang";
$sql2 .= " SET label = '".$this->db->escape($this->label)."',";
$sql2 .= " description = '".$this->db->escape($this->description)."'";
@ -2037,7 +2037,7 @@ class Categorie extends CommonObject
return -1;
}
} elseif (isset($this->multilangs[$key])) {
if ($this->db->num_rows($result)) { // si aucune ligne dans la base
if ($this->db->num_rows($result)) { // if no line in database
$sql2 = "UPDATE ".MAIN_DB_PREFIX."categorie_lang";
$sql2 .= " SET label='".$this->db->escape($this->multilangs[$key]["label"])."',";
$sql2 .= " description='".$this->db->escape($this->multilangs[$key]["description"])."'";
@ -2179,7 +2179,7 @@ class Categorie extends CommonObject
*
* @param string $type The category type (e.g Categorie::TYPE_WAREHOUSE)
* @param string $rowIdName The name of the row id inside the whole sql query (e.g. "e.rowid")
* @param Array $searchList A list with the selected categories
* @param string[] $searchList A list with the selected categories
* @return string A additional SQL SELECT query
* @deprecated search on some categories must be done using a WHERE EXISTS or NOT EXISTS and not a LEFT JOIN
*/

View file

@ -66,6 +66,10 @@ if (isModEnabled('member')) {
if (isModEnabled('intervention')) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
}
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
}
// Load translation files required by the page
$langs->loadLangs(array('companies', 'banks'));
@ -373,12 +377,20 @@ if ($object->id > 0) {
print '</td></tr>';
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
$formaccounting = new FormAccounting($db);
print '<tr>';
print '<td>';
print $form->editfieldkey("CustomerAccountancyCodeGeneral", 'customeraccountancycodegeneral', length_accountg($object->accountancy_code_customer_general), $object, $user->hasRight('societe', 'creer'));
print '</td><td>';
print $form->editfieldval("CustomerAccountancyCodeGeneral", 'customeraccountancycodegeneral', length_accountg($object->accountancy_code_customer_general), $object, $user->hasRight('societe', 'creer'));
if ($action == 'editcustomeraccountancycodegeneral' && $user->hasRight('societe', 'creer')) {
print $formaccounting->formAccountingAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->accountancy_code_customer_general, 'customeraccountancycodegeneral', 0, 1, '', 1);
} else {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(0, $object->accountancy_code_customer_general, 1);
print $accountingaccount->getNomUrl(0, 1, 1, '', 1);
}
$accountingAccountByDefault = " (" . $langs->trans("AccountingAccountByDefaultShort") . ": " . length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER')) . ")";
print (getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') ? $accountingAccountByDefault : '');
print '</td>';

View file

@ -1454,6 +1454,11 @@ if (empty($reshook)) {
if ($result > 0) {
$db->commit();
$ret = $object->fetch($id); // Reload to get new records
if ($ret > 0) {
$object->fetch_thirdparty();
}
if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) {
// Define output language
$outputlangs = $langs;
@ -1462,10 +1467,6 @@ if (empty($reshook)) {
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang);
}
$ret = $object->fetch($id); // Reload to get new records
if ($ret > 0) {
$object->fetch_thirdparty();
}
$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}

View file

@ -137,7 +137,7 @@ class PropaleStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
* @return array Array with number by month
* @return array<int<0,11>,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@ -161,7 +161,7 @@ class PropaleStats extends Stats
/**
* Return propals number per year
*
* @return array Array with number by year
* @return array<array{0:int,1:int}> Array of nb each year
*
*/
public function getNbByYear()
@ -186,7 +186,7 @@ class PropaleStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
* @return array Array with amount by month
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array with amount by month
*/
public function getAmountByMonth($year, $format = 0)
{
@ -211,7 +211,7 @@ class PropaleStats extends Stats
* Return the propals amount average by month for a year
*
* @param int $year year for stats
* @return array array with number by month
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array with number by month
*/
public function getAverageByMonth($year)
{
@ -234,7 +234,7 @@ class PropaleStats extends Stats
/**
* Return nb, total and average
*
* @return array Array of values
* @return array<array{year:string,nb:string,nb_diff:float,total?:float,avg?:float,weighted?:float,total_diff?:float,avg_diff?:float,avg_weighted?:float}> Array with nb, total amount, average for each year
*/
public function getAllByYear()
{

View file

@ -334,7 +334,7 @@ print '</tr>';
$oldyear = 0;
foreach ($data as $val) {
$year = $val['year'];
while (!empty($year) && $oldyear > $year + 1) { // If we have empty year
while (!empty($year) && $oldyear > (int) $year + 1) { // If we have empty year
$oldyear--;
print '<tr class="oddeven" height="24">';

View file

@ -5,6 +5,7 @@
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.com>
* 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
@ -150,7 +151,7 @@ class CommandeStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
* @return array Array with number by month
* @return array<int<0,11>,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@ -174,7 +175,7 @@ class CommandeStats extends Stats
/**
* Return orders number per year
*
* @return array Array with number by year
* @return array<array{0:int,1:int}> Array of nb each year
*
*/
public function getNbByYear()
@ -199,7 +200,7 @@ class CommandeStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
* @return array Array with amount by month
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array with amount by month
*/
public function getAmountByMonth($year, $format = 0)
{
@ -224,7 +225,7 @@ class CommandeStats extends Stats
* Return the orders amount average by month for a year
*
* @param int $year year for stats
* @return array array with number by month
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array with number by month
*/
public function getAverageByMonth($year)
{
@ -247,7 +248,7 @@ class CommandeStats extends Stats
/**
* Return nb, total and average
*
* @return array Array of values
* @return array<array{year:string,nb:string,nb_diff:float,total?:float,avg?:float,weighted?:float,total_diff?:float,avg_diff?:float,avg_weighted?:float}> Array of values
*/
public function getAllByYear()
{
@ -271,7 +272,7 @@ class CommandeStats extends Stats
*
* @param int $year Year to scan
* @param int $limit Limit
* @return array Array of values
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array of values
*/
public function getAllByProduct($year, $limit = 10)
{

View file

@ -136,6 +136,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
// $data = array(array('Lib',val1,val2,val3),...)
$fileurlnb = '';
if (!$user->hasRight('societe', 'client', 'voir')) {
$filenamenb = $dir.'/ordersnbinyear-'.$user->id.'-'.$year.'.png';
if ($mode == 'customer') {
@ -183,6 +184,7 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear);
//var_dump($data);
// $data = array(array('Lib',val1,val2,val3),...)
$fileurlamount = '';
if (!$user->hasRight('societe', 'client', 'voir')) {
$filenameamount = $dir.'/ordersamountinyear-'.$user->id.'-'.$year.'.png';
if ($mode == 'customer') {
@ -228,6 +230,8 @@ if (!$mesg) {
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
$fileurl_avg = '';
if (!$user->hasRight('societe', 'client', 'voir')) {
$filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png';
if ($mode == 'customer') {
@ -334,6 +338,8 @@ if ($user->admin) {
}
print '</td></tr>';
// Category
$cat_type = 0;
$cat_label = '';
if ($mode == 'customer') {
$cat_type = Categorie::TYPE_CUSTOMER;
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
@ -398,7 +404,7 @@ print '</tr>';
$oldyear = 0;
foreach ($data as $val) {
$year = $val['year'];
while (!empty($year) && $oldyear > $year + 1) { // If we have empty year
while (!empty($year) && $oldyear > (int) $year + 1) { // If we have empty year
$oldyear--;
print '<tr class="oddeven" height="24">';

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (c) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.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
@ -35,11 +36,26 @@ class DeplacementStats extends Stats
*/
public $table_element;
/**
* @var int
*/
public $socid;
/**
* @var int
*/
public $userid;
/**
* @var string
*/
public $from;
/**
* @var string
*/
public $field;
/**
* @var string
*/
public $where;
/**
@ -47,7 +63,7 @@ class DeplacementStats extends Stats
*
* @param DoliDB $db Database handler
* @param int $socid Id third party
* @param mixed $userid Id user for filter or array of user ids
* @param int|int[] $userid Id user for filter or array of user ids
* @return void
*/
public function __construct($db, $socid = 0, $userid = 0)
@ -78,7 +94,7 @@ class DeplacementStats extends Stats
/**
* Renvoie le nombre de facture par annee
*
* @return array Array of values
* @return array<array{0:int,1:int}> Array of nb each year
*/
public function getNbByYear()
{
@ -96,7 +112,7 @@ class DeplacementStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
* @return array Array of values
* @return array<int<0,11>,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@ -118,7 +134,7 @@ class DeplacementStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
* @return array Array of values
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array of values
*/
public function getAmountByMonth($year, $format = 0)
{
@ -138,7 +154,7 @@ class DeplacementStats extends Stats
* Return average amount
*
* @param int $year Year to scan
* @return array Array of values
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array with number by month
*/
public function getAverageByMonth($year)
{
@ -155,7 +171,7 @@ class DeplacementStats extends Stats
/**
* Return nb, total and average
*
* @return array Array of values
* @return array<array{year:string,nb:string,nb_diff:float,total?:float,avg?:float,weighted?:float,total_diff?:float,avg_diff?:float,avg_weighted?:float}> Array of values
*/
public function getAllByYear()
{

View file

@ -167,6 +167,7 @@ if (!$mesg) {
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
$filename_avg = '';
if (!$user->hasRight('societe', 'client', 'voir')) {
$filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png';
if ($mode == 'customer') {
@ -282,7 +283,7 @@ print '</tr>';
$oldyear = 0;
foreach ($data as $val) {
$year = $val['year'];
while ($year && $oldyear > $year + 1) { // If we have empty year
while ($year && $oldyear > (int) $year + 1) { // If we have empty year
$oldyear--;
print '<tr>';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&amp;mode='.$mode.'">'.$oldyear.'</a></td>';

View file

@ -154,7 +154,7 @@ class FactureStats extends Stats
/**
* Return invoices number per year
*
* @return array Array with number by year
* @return array<array{0:int,1:int}> Array of nb each year
*/
public function getNbByYear()
{
@ -228,7 +228,7 @@ class FactureStats extends Stats
/**
* Return nb, total and average
*
* @return array<array{year:string,nb:string,nb_diff:float,total_diff:float,avg_diff:float,avg_weighted:float}> Array of values
* @return array<array{year:string,nb:string,nb_diff:float,total?:float,avg?:float,weighted?:float,total_diff?:float,avg_diff?:float,avg_weighted?:float}> Array of values
*/
public function getAllByYear()
{

View file

@ -2267,7 +2267,7 @@ class BonPrelevement extends CommonObject
public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum, $row_rum, $type = 'direct-debit', $row_comment = '')
{
// phpcs:enable
global $conf;
global $conf, $mysoc;
if (getDolGlobalString('SEPA_FORCE_TWO_DECIMAL')) {
$row_somme = number_format((float) price2num($row_somme, 'MT'), 2, ".", "");
@ -2330,8 +2330,20 @@ class BonPrelevement extends CommonObject
$XML_DEBITOR .= ' </Id>' . $CrLf;
$XML_DEBITOR .= ' </DbtrAcct>' . $CrLf;
$XML_DEBITOR .= ' <RmtInf>' . $CrLf;
// A string with some information on payment - 140 max
$XML_DEBITOR .= ' <Ustrd>' . getDolGlobalString('PRELEVEMENT_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref . ($row_comment ? ' - ' . $row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))) . '</Ustrd>' . $CrLf; // Free unstuctured data - 140 max
// Structured data for Belgium
if (getDolGlobalString('INVOICE_PAYMENT_ENABLE_STRUCTURED_COMMUNICATION') && $mysoc->country_code == 'BE') {
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php';
$invoicestatic = new Facture($this->db);
$invoicestatic->fetch($row_idfac);
$invoicePaymentKey = dolBECalculateStructuredCommunication($invoicestatic->ref, $invoicestatic->type);
$XML_DEBITOR .= ' <strd>' . $invoicePaymentKey . '</strd>' . $CrLf;
} else {
// A string with some information on payment - 140 max
$XML_DEBITOR .= ' <Ustrd>' . getDolGlobalString('PRELEVEMENT_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref . ($row_comment ? ' - ' . $row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))) . '</Ustrd>' . $CrLf; // Free unstuctured data - 140 max
}
$XML_DEBITOR .= ' </RmtInf>' . $CrLf;
$XML_DEBITOR .= ' </DrctDbtTxInf>' . $CrLf;
return $XML_DEBITOR;

View file

@ -55,6 +55,9 @@ class box_actions extends ModeleBoxes
$this->enabled = isModEnabled('agenda');
$this->hidden = !($user->hasRight('agenda', 'myactions', 'read'));
$this->urltoaddentry = DOL_URL_ROOT.'/comm/action/card.php?action=create';
$this->msgNoRecords = 'NoActionsToDo';
}
/**
@ -173,12 +176,12 @@ class box_actions extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoActionsToDo").'</span>'
);
}
// if ($num == 0) {
// $this->info_box_contents[$line][0] = array(
// 'td' => 'class="center"',
// 'text' => '<span class="opacitymedium">'.$langs->trans("NoActionsToDo").'</span>'
// );
// }
$this->db->free($result);
} else {

View file

@ -51,6 +51,8 @@ class box_boms extends ModeleBoxes
$this->db = $db;
$this->hidden = !$user->hasRight('bom', 'read');
$this->urltoaddentry = DOL_URL_ROOT.'/bom/bom_card.php?action=create';
$this->msgNoRecords = 'NoRecordedOrders';
}
/**
@ -149,12 +151,12 @@ class box_boms extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedOrders").'</span>'
);
}
// if ($num == 0) {
// $this->info_box_contents[$line][0] = array(
// 'td' => 'class="center"',
// 'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedOrders").'</span>'
// );
// }
$this->db->free($result);
} else {

View file

@ -47,6 +47,8 @@ class box_bookmarks extends ModeleBoxes
$this->db = $db;
$this->hidden = !$user->hasRight('bookmark', 'lire');
$this->urltoaddentry = DOL_URL_ROOT.'/bookmarks/card.php?action=create';
$this->msgNoRecords = 'NoRecordedBookmarks';
}
/**
@ -109,17 +111,17 @@ class box_bookmarks extends ModeleBoxes
$line++;
}
if ($num == 0) {
$mytxt = $langs->trans("NoRecordedBookmarks");
if ($user->hasRight("bookmark", "creer")) {
$mytxt .= ' '.$langs->trans("ClickToAdd");
}
$this->info_box_contents[$line][0] = array(
'td' => 'class="center" colspan="2"',
'tooltip' => $mytxt,
'url' => DOL_URL_ROOT.'/bookmarks/list.php', 'text' => $mytxt,
);
}
// if ($num == 0) {
// $mytxt = $langs->trans("NoRecordedBookmarks");
// if ($user->hasRight("bookmark", "creer")) {
// $mytxt .= ' '.$langs->trans("ClickToAdd");
// }
// $this->info_box_contents[$line][0] = array(
// 'td' => 'class="center" colspan="2"',
// 'tooltip' => $mytxt,
// 'url' => DOL_URL_ROOT.'/bookmarks/list.php', 'text' => $mytxt,
// );
// }
$this->db->free($result);
} else {

View file

@ -58,6 +58,9 @@ class box_clients extends ModeleBoxes
}
$this->hidden = !($user->hasRight('societe', 'read') && empty($user->socid));
$this->urltoaddentry = DOL_URL_ROOT.'/societe/card.php?action=create&type=c';
$this->msgNoRecords = 'NoRecordedCustomers';
}
/**
@ -147,12 +150,6 @@ class box_clients extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedCustomers").'</span>'
);
}
$this->db->free($result);
} else {

View file

@ -51,6 +51,10 @@ class box_commandes extends ModeleBoxes
$this->db = $db;
$this->hidden = !$user->hasRight('commande', 'lire');
$this->urltoaddentry = DOL_URL_ROOT.'/commande/card.php?action=create';
$this->msgNoRecords = 'NoRecordedOrders';
}
/**
@ -186,12 +190,6 @@ class box_commandes extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedOrders").'</span>'
);
}
$this->db->free($result);
} else {

View file

@ -60,6 +60,8 @@ class box_comptes extends ModeleBoxes
}
$this->hidden = !$user->hasRight('banque', 'lire');
$this->urltoaddentry = DOL_URL_ROOT.'/compta/bank/card.php?action=create';
$this->msgNoRecords = 'NoRecordedBankAccounts';
}
/**
@ -164,12 +166,6 @@ class box_comptes extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedBankAccounts").'</span>'
);
}
$this->db->free($result);
} else {

View file

@ -54,6 +54,9 @@ class box_contacts extends ModeleBoxes
$this->db = $db;
$this->hidden = !($user->hasRight('societe', 'lire') && $user->hasRight('societe', 'contact', 'lire'));
$this->urltoaddentry = DOL_URL_ROOT.'/contact/card.php?action=create';
$this->msgNoRecords = 'NoRecordedContacts';
}
/**
@ -183,13 +186,13 @@ class box_contacts extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedContacts").'</span>',
'asis' => 1
);
}
// if ($num == 0) {
// $this->info_box_contents[$line][0] = array(
// 'td' => 'class="center"',
// 'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedContacts").'</span>',
// 'asis' => 1
// );
// }
$this->db->free($result);
} else {

View file

@ -50,6 +50,8 @@ class box_contracts extends ModeleBoxes
$this->db = $db;
$this->hidden = !($user->hasRight('contrat', 'lire'));
$this->urltoaddentry = DOL_URL_ROOT.'/contrat/card.php?action=create';
$this->msgNoRecords = 'NoRecordedContracts';
}
/**
@ -162,12 +164,12 @@ class box_contracts extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedContracts").'</span>'
);
}
// if ($num == 0) {
// $this->info_box_contents[$line][0] = array(
// 'td' => 'class="center"',
// 'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedContracts").'</span>'
// );
// }
$this->db->free($resql);
} else {

View file

@ -52,6 +52,7 @@ class box_external_rss extends ModeleBoxes
{
$this->db = $db;
$this->paramdef = $param;
$this->urltoaddentry = DOL_URL_ROOT.'/admin/external_rss.php';
}
/**

View file

@ -49,6 +49,8 @@ class box_factures extends ModeleBoxes
$this->db = $db;
$this->hidden = !$user->hasRight('facture', 'lire');
$this->urltoaddentry = DOL_URL_ROOT.'/compta/facture/card.php?action=create';
$this->msgNoRecords = 'NoRecordedInvoices';
}
/**
@ -197,12 +199,12 @@ class box_factures extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedInvoices").'</span>',
);
}
// if ($num == 0) {
// $this->info_box_contents[$line][0] = array(
// 'td' => 'class="center"',
// 'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedInvoices").'</span>',
// );
// }
$this->db->free($result);
} else {

View file

@ -50,6 +50,8 @@ class box_factures_fourn extends ModeleBoxes
$this->db = $db;
$this->hidden = !($user->hasRight('fournisseur', 'facture', 'lire'));
$this->urltoaddentry = DOL_URL_ROOT.'/fourn/facture/card.php?action=create';
$this->msgNoRecords = 'NoModifiedSupplierBills';
}
/**
@ -193,12 +195,12 @@ class box_factures_fourn extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoModifiedSupplierBills").'</span>',
);
}
// if ($num == 0) {
// $this->info_box_contents[$line][0] = array(
// 'td' => 'class="center"',
// 'text' => '<span class="opacitymedium">'.$langs->trans("NoModifiedSupplierBills").'</span>',
// );
// }
$this->db->free($result);
} else {

View file

@ -53,6 +53,8 @@ class box_factures_imp extends ModeleBoxes
$this->db = $db;
$this->hidden = !($user->hasRight('facture', 'lire'));
$this->urltoaddentry = DOL_URL_ROOT.'/compta/facture/card.php?action=create';
$this->msgNoRecords = 'NoUnpaidCustomerBills';
}
/**
@ -220,10 +222,10 @@ class box_factures_imp extends ModeleBoxes
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center" colspan="3"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoUnpaidCustomerBills").'</span>'
);
// $this->info_box_contents[$line][0] = array(
// 'td' => 'class="center" colspan="3"',
// 'text' => '<span class="opacitymedium">'.$langs->trans("NoUnpaidCustomerBills").'</span>'
// );
} else {
$sql = "SELECT SUM(f.total_ht) as total_ht ".$sql2;

View file

@ -50,6 +50,8 @@ class box_fediverse extends ModeleBoxes
{
$this->db = $db;
$this->paramdef = $param;
$this->urltoaddentry = DOL_URL_ROOT.'/admin/fediverse.php';
$this->msgNoRecords = 'NoRecordFound';
}
/**
@ -150,12 +152,12 @@ class box_fediverse extends ModeleBoxes
}
if ($nbitems == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span>'
);
}
// if ($nbitems == 0) {
// $this->info_box_contents[$line][0] = array(
// 'td' => 'class="center"',
// 'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span>'
// );
// }
}

View file

@ -50,6 +50,8 @@ class box_ficheinter extends ModeleBoxes
$this->db = $db;
$this->hidden = !($user->hasRight('ficheinter', 'lire'));
$this->urltoaddentry = DOL_URL_ROOT.'/fichinter/card.php?action=create';
$this->msgNoRecords = 'NoRecordedInterventions';
}
/**
@ -151,12 +153,12 @@ class box_ficheinter extends ModeleBoxes
$i++;
}
if ($num == 0) {
$this->info_box_contents[$i][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedInterventions").'</span>'
);
}
// if ($num == 0) {
// $this->info_box_contents[$i][0] = array(
// 'td' => 'class="center"',
// 'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedInterventions").'</span>'
// );
// }
$this->db->free($resql);
} else {

View file

@ -51,6 +51,8 @@ class box_fournisseurs extends ModeleBoxes
$this->db = $db;
$this->hidden = !($user->hasRight('societe', 'read') && empty($user->socid));
$this->urltoaddentry = DOL_URL_ROOT.'/societe/card.php?action=create&type=f';
$this->msgNoRecords = 'NoRecordedSuppliers';
}
/**
@ -138,13 +140,13 @@ class box_fournisseurs extends ModeleBoxes
$line++;
}
if ($num == 0) {
$langs->load("suppliers");
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedSuppliers").'</span>'
);
}
// if ($num == 0) {
// $langs->load("suppliers");
// $this->info_box_contents[$line][0] = array(
// 'td' => 'class="center"',
// 'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedSuppliers").'</span>'
// );
// }
$this->db->free($result);
} else {

View file

@ -59,6 +59,9 @@ class box_members_last_subscriptions extends ModeleBoxes
}
$this->hidden = !(isModEnabled('member') && $user->hasRight('adherent', 'lire'));
$this->urltoaddentry = DOL_URL_ROOT.'/adherents/card.php?leftmenu=members&action=create';
$this->msgNoRecords = 'NoRecordedMembers';
}
/**
@ -156,12 +159,6 @@ class box_members_last_subscriptions extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedMembers").'</span>',
);
}
$this->db->free($result);
} else {

View file

@ -51,6 +51,9 @@ class box_mos extends ModeleBoxes
$this->db = $db;
$this->hidden = !$user->hasRight('bom', 'read');
$this->urltoaddentry = DOL_URL_ROOT.'/mrp/mo_card.php?action=create';
$this->msgNoRecords = 'NoRecordedOrders';
}
/**
@ -146,12 +149,6 @@ class box_mos extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedOrders").'</span>'
);
}
$this->db->free($result);
} else {

View file

@ -55,6 +55,8 @@ class box_produits extends ModeleBoxes
$tmpentry = array('enabled' => (isModEnabled("product") || isModEnabled("service")), 'perms' => ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')), 'module' => 'product|service');
$showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
$this->hidden = ($showmode != 1);
$this->urltoaddentry = DOL_URL_ROOT.'/product/card.php?action=create';
$this->msgNoRecords = 'NoRecordedProducts';
}
/**
@ -210,12 +212,12 @@ class box_produits extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => $langs->trans("NoRecordedProducts"),
);
}
// if ($num == 0) {
// $this->info_box_contents[$line][0] = array(
// 'td' => 'class="center"',
// 'text' => $langs->trans("NoRecordedProducts"),
// );
// }
$this->db->free($result);
} else {

View file

@ -57,6 +57,8 @@ class box_produits_alerte_stock extends ModeleBoxes
$tmpentry = array('enabled' => ((isModEnabled("product") || isModEnabled("service")) && isModEnabled('stock')), 'perms' => $user->hasRight('stock', 'lire'), 'module' => 'product|service|stock');
$showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
$this->hidden = ($showmode != 1);
$this->urltoaddentry = DOL_URL_ROOT.'/product/card.php?action=create';
$this->msgNoRecords = 'NoTooLowStockProducts';
}
/**
@ -202,12 +204,12 @@ class box_produits_alerte_stock extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => $langs->trans("NoTooLowStockProducts"),
);
}
// if ($num == 0) {
// $this->info_box_contents[$line][0] = array(
// 'td' => 'class="center"',
// 'text' => $langs->trans("NoTooLowStockProducts"),
// );
// }
$this->db->free($result);
} else {

View file

@ -54,6 +54,8 @@ class box_project extends ModeleBoxes
$this->boxlabel = "OpenedProjects";
$this->hidden = !$user->hasRight('projet', 'lire');
$this->urltoaddentry = DOL_URL_ROOT.'/projet/card.php?action=create';
$this->msgNoRecords = 'NoOpenedProjects';
}
/**
@ -175,33 +177,34 @@ class box_project extends ModeleBoxes
}
}
// Add the sum à the bottom of the boxes
$this->info_box_contents[$i][] = array(
'tr' => 'class="liste_total_wrap"',
'td' => 'class="liste_total"',
'text' => $langs->trans("Total")."&nbsp;".$textHead,
);
$this->info_box_contents[$i][] = array(
'td' => 'class="right liste_total" ',
'text' => round($num, 0)."&nbsp;".$langs->trans("Projects"),
);
$this->info_box_contents[$i][] = array(
'td' => 'class="right liste_total" ',
'text' => (($max < $num) ? '' : (round($totalnbTask, 0)."&nbsp;".$langs->trans("Tasks"))),
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
if ($num > 0) {
// Add the sum à the bottom of the boxes
$this->info_box_contents[$i][] = array(
'tr' => 'class="liste_total_wrap"',
'td' => 'class="liste_total"',
'text' => $langs->trans("Total")."&nbsp;".$textHead,
);
$this->info_box_contents[$i][] = array(
'td' => 'class="right liste_total" ',
'text' => round($num, 0)."&nbsp;".$langs->trans("Projects"),
);
$this->info_box_contents[$i][] = array(
'td' => 'class="right liste_total" ',
'text' => (($max < $num) ? '' : (round($totalnbTask, 0)."&nbsp;".$langs->trans("Tasks"))),
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
}
}

View file

@ -55,6 +55,8 @@ class box_project_opportunities extends ModeleBoxes
$this->enabled = getDolGlobalInt('PROJECT_USE_OPPORTUNITIES');
$this->hidden = !$user->hasRight('projet', 'lire');
$this->urltoaddentry = DOL_URL_ROOT.'/projet/card.php?action=create';
$this->msgNoRecords = 'NoOpenedProjectsOpportunities';
}
/**
@ -160,33 +162,34 @@ class box_project_opportunities extends ModeleBoxes
}
}
// Add the sum à the bottom of the boxes
$this->info_box_contents[$i][] = array(
'tr' => 'class="liste_total_wrap"',
'td' => 'class="liste_total"',
'text' => $langs->trans("Total")."&nbsp;".$textHead,
);
$this->info_box_contents[$i][] = array(
'td' => 'class="right liste_total" ',
'text' => round($num, 0)."&nbsp;".$langs->trans("Projects"),
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
if ($num > 0) {
// Add the sum à the bottom of the boxes
$this->info_box_contents[$i][] = array(
'tr' => 'class="liste_total_wrap"',
'td' => 'class="liste_total"',
'text' => $langs->trans("Total")."&nbsp;".$textHead,
);
$this->info_box_contents[$i][] = array(
'td' => 'class="right liste_total" ',
'text' => round($num, 0)."&nbsp;".$langs->trans("Projects"),
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
$this->info_box_contents[$i][] = array(
'td' => 'class="liste_total"',
'text' => "&nbsp;",
);
}
}

View file

@ -52,6 +52,9 @@ class box_propales extends ModeleBoxes
$this->db = $db;
$this->hidden = !($user->hasRight('propal', 'read'));
$this->urltoaddentry = DOL_URL_ROOT.'/comm/propal/card.php?action=create';
$this->msgNoRecords = 'NoRecordedProposals';
}
/**
@ -171,12 +174,6 @@ class box_propales extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => $langs->trans("NoRecordedProposals"),
);
}
$this->db->free($result);
} else {

View file

@ -60,6 +60,9 @@ class box_prospect extends ModeleBoxes
}
$this->hidden = !($user->hasRight('societe', 'read') && empty($user->socid));
$this->urltoaddentry = DOL_URL_ROOT.'/societe/card.php?action=create&type=p';
$this->msgNoRecords = 'NoRecordedProspects';
}
/**
@ -153,13 +156,6 @@ class box_prospect extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedProspects").'</span>'
);
}
$this->db->free($resql);
} else {
$this->info_box_contents[0][0] = array(

View file

@ -51,6 +51,9 @@ class box_scheduled_jobs extends ModeleBoxes
$this->db = $db;
$this->hidden = !($user->hasRight('cron', 'read'));
$this->urltoaddentry = DOL_URL_ROOT.'/cron/card.php?action=create';
$this->msgNoRecords = 'NoScheduledJobs';
}
/**
@ -159,26 +162,27 @@ class box_scheduled_jobs extends ModeleBoxes
);
$line++;
}
// Line nb job in error
$this->info_box_contents[$line][] = array(
'td' => 'class="tdoverflowmax300" colspan="3"',
'text' => $langs->trans("NumberScheduledJobError")
);
$textnoformat = '';
if ($nbjobsnotfinished) {
$textnoformat .= '<a class="inline-block paddingleft paddingright marginleftonly'.($nbjobsinerror ? ' marginrightonly' : '').' minwidth25 nounderlineimp" href="'.DOL_URL_ROOT.'/cron/list.php" title="'.$langs->trans("NumberScheduledJobNeverFinished").'"><div class="center badge badge-warning nounderlineimp"><i class="fa fa-exclamation-triangle"></i> '.$nbjobsnotfinished.'</div></a>';
if ($num > 0) {
// Line nb job in error
$this->info_box_contents[$line][] = array(
'td' => 'class="tdoverflowmax300" colspan="3"',
'text' => $langs->trans("NumberScheduledJobError")
);
$textnoformat = '';
if ($nbjobsnotfinished) {
$textnoformat .= '<a class="inline-block paddingleft paddingright marginleftonly'.($nbjobsinerror ? ' marginrightonly' : '').' minwidth25 nounderlineimp" href="'.DOL_URL_ROOT.'/cron/list.php" title="'.$langs->trans("NumberScheduledJobNeverFinished").'"><div class="center badge badge-warning nounderlineimp"><i class="fa fa-exclamation-triangle"></i> '.$nbjobsnotfinished.'</div></a>';
}
if ($nbjobsinerror) {
$textnoformat .= '<a class="inline-block paddingleft paddingright marginleftonly minwidth25 nounderlineimp" href="'.DOL_URL_ROOT.'/cron/list.php?search_lastresult='.urlencode('<>0').'" title="'.$langs->trans("NumberScheduledJobError").'"><div class="badge badge-danger nounderlineimp"><i class="fa fa-exclamation-triangle"></i> '.$nbjobsinerror.'</div></a>';
}
if (empty($nbjobsnotfinished) && empty($nbjobsinerror)) {
$textnoformat .= '<a class="inline-block paddingleft marginleftonly minwidth25 nounderlineimp" href="'.DOL_URL_ROOT.'/cron/list.php"><div class="center badge badge-status4 nounderline">0</div></a>';
}
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
'textnoformat' => $textnoformat
);
}
if ($nbjobsinerror) {
$textnoformat .= '<a class="inline-block paddingleft paddingright marginleftonly minwidth25 nounderlineimp" href="'.DOL_URL_ROOT.'/cron/list.php?search_lastresult='.urlencode('<>0').'" title="'.$langs->trans("NumberScheduledJobError").'"><div class="badge badge-danger nounderlineimp"><i class="fa fa-exclamation-triangle"></i> '.$nbjobsinerror.'</div></a>';
}
if (empty($nbjobsnotfinished) && empty($nbjobsinerror)) {
$textnoformat .= '<a class="inline-block paddingleft marginleftonly minwidth25 nounderlineimp" href="'.DOL_URL_ROOT.'/cron/list.php"><div class="center badge badge-status4 nounderline">0</div></a>';
}
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
'textnoformat' => $textnoformat
);
} else {
$this->info_box_contents[0][0] = array(
'td' => '',

View file

@ -51,6 +51,9 @@ class box_services_contracts extends ModeleBoxes
$this->db = $db;
$this->hidden = !($user->hasRight('service', 'lire') && $user->hasRight('contrat', 'lire'));
$this->urltoaddentry = DOL_URL_ROOT.'/contrat/card.php?action=create';
$this->msgNoRecords = 'NoContractedProducts';
}
/**
@ -200,12 +203,6 @@ class box_services_contracts extends ModeleBoxes
$i++;
}
if ($num == 0) {
$this->info_box_contents[$i][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoContractedProducts").'</span>'
);
}
$this->db->free($result);
} else {

View file

@ -48,6 +48,9 @@ class box_services_expired extends ModeleBoxes
$this->db = $db;
$this->hidden = !($user->hasRight('contrat', 'lire'));
$this->urltoaddentry = DOL_URL_ROOT.'/contrat/card.php?action=create';
$this->msgNoRecords = 'NoExpiredServices';
}
/**
@ -155,13 +158,6 @@ class box_services_expired extends ModeleBoxes
$i++;
}
if ($num == 0) {
$langs->load("contracts");
$this->info_box_contents[$i][] = array(
'td' => 'class="nohover center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoExpiredServices").'</span>'
);
}
$this->db->free($resql);
} else {

View file

@ -51,6 +51,9 @@ class box_shipments extends ModeleBoxes
$this->db = $db;
$this->hidden = !$user->hasRight('expedition', 'lire');
$this->urltoaddentry = DOL_URL_ROOT.'/expedition/card.php?action=create2';
$this->msgNoRecords = 'NoRecordedShipments';
}
/**
@ -163,12 +166,12 @@ class box_shipments extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedShipments").'</span>'
);
}
// if ($num == 0) {
// $this->info_box_contents[$line][0] = array(
// 'td' => 'class="center"',
// 'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedShipments").'</span>'
// );
// }
$this->db->free($result);
} else {

View file

@ -49,6 +49,9 @@ class box_supplier_orders extends ModeleBoxes
$this->db = $db;
$this->hidden = !($user->hasRight('fournisseur', 'commande', 'lire'));
$this->urltoaddentry = DOL_URL_ROOT.'/fourn/commande/card.php?action=create';
$this->msgNoRecords = 'NoSupplierOrder';
}
/**
@ -160,13 +163,6 @@ class box_supplier_orders extends ModeleBoxes
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][] = array(
'td' => 'class="center"',
'text' => '<span class="opacitymedium">'.$langs->trans("NoSupplierOrder").'</span>',
);
}
$this->db->free($result);
} else {
$this->info_box_contents[0][] = array(

View file

@ -158,6 +158,14 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
* @var string[] Example array("accounting")
*/
public $depends;
/**
* @var string urltoaddentry
*/
public $urltoaddentry;
/**
* @var string msg when no records exist
*/
public $msgNoRecords = 'NoRecordFound';
@ -429,6 +437,17 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
$out .= "</tr>\n";
}
}
} else {
if (!empty($head['text']) || !empty($head['sublink']) || !empty($head['subpicto']) || $nblines) {
$out .= '<tr><td colspan="2" class="center"><span class="opacitymedium">'.$langs->trans($this->msgNoRecords).' </span>';
// Check if $urltoaddentry is defined for the widget
if (!empty($this->urltoaddentry)) {
$out .= '<a href="'.$this->urltoaddentry.'">'.img_picto($langs->trans("New"), 'add', 'pictofixedwidth').'</a>';
}
$out .= '</td></tr>';
}
}
if (!empty($head['text']) || !empty($head['sublink']) || !empty($head['subpicto']) || $nblines) {

View file

@ -38,6 +38,16 @@ abstract class CommonHookActions
*/
public $results = array();
/**
* @var string
*/
public $error;
/**
* @var string[]
*/
public $errors = array();
/**
* Check context of hook
* @param array $parameters Hook parameters.

View file

@ -3349,10 +3349,11 @@ abstract class CommonObject
if ($resql) {
$i = 0;
$num = $this->db->num_rows($resql);
$grandchild = getDolGlobalInt('MAIN_CARE_GRANDCHILD');
while ($i < $num) {
$row = $this->db->fetch_row($resql);
$rows[] = $row[0]; // Add parent line into array rows
$children = $this->getChildrenOfLine($row[0]);
$children = $this->getChildrenOfLine($row[0], $grandchild);
if (!empty($children)) {
foreach ($children as $child) {
array_push($rows, $child);

View file

@ -9561,6 +9561,9 @@ class Form
}
$possiblelinks = array();
$dontIncludeCompletedItems = getDolGlobalString('DONT_INCLUDE_COMPLETED_ELEMENTS_LINKS');
if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
$listofidcompanytoscan = $object->thirdparty->id;
if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
@ -9581,27 +9584,27 @@ class Form
'enabled' => isModEnabled('propal'),
'perms' => 1,
'label' => 'LinkToProposal',
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'),
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : '')),
'shipping' => array(
'enabled' => isModEnabled('shipping'),
'perms' => 1,
'label' => 'LinkToExpedition',
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'),
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 2' : '')),
'order' => array(
'enabled' => isModEnabled('order'),
'perms' => 1,
'label' => 'LinkToOrder',
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'),
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'.($dontIncludeCompletedItems ? ' AND t.facture < 1' : '')),
'invoice' => array(
'enabled' => isModEnabled('invoice'),
'perms' => 1,
'label' => 'LinkToInvoice',
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'),
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : '')),
'invoice_template' => array(
'enabled' => isModEnabled('invoice'),
'perms' => 1,
'label' => 'LinkToTemplateInvoice',
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'),
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : '')),
'contrat' => array(
'enabled' => isModEnabled('contract'),
'perms' => 1,
@ -9618,33 +9621,33 @@ class Form
'enabled' => isModEnabled('supplier_proposal'),
'perms' => 1,
'label' => 'LinkToSupplierProposal',
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('supplier_proposal') . ')'),
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('supplier_proposal') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : '')),
'order_supplier' => array(
'enabled' => isModEnabled("supplier_order"),
'perms' => 1,
'label' => 'LinkToSupplierOrder',
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande_fournisseur') . ')'),
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande_fournisseur') . ')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : '')),
'invoice_supplier' => array(
'enabled' => isModEnabled("supplier_invoice"),
'perms' => 1, 'label' => 'LinkToSupplierInvoice',
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('facture_fourn') . ')'),
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('facture_fourn') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : '')),
'ticket' => array(
'enabled' => isModEnabled('ticket'),
'perms' => 1,
'label' => 'LinkToTicket',
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('ticket') . ')'),
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('ticket') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 8' : '')),
'mo' => array(
'enabled' => isModEnabled('mrp'),
'perms' => 1,
'label' => 'LinkToMo',
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM " . $this->db->prefix() . "societe as s INNER JOIN " . $this->db->prefix() . "mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('mo') . ')')
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM " . $this->db->prefix() . "societe as s INNER JOIN " . $this->db->prefix() . "mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('mo') . ')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : ''))
);
}
if ($object->table_element == 'commande_fournisseur') {
$possiblelinks['mo']['sql'] = "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".$this->db->prefix()."societe as s INNER JOIN ".$this->db->prefix().'mrp_mo as t ON t.fk_soc = s.rowid WHERE t.entity IN ('.getEntity('mo').')';
$possiblelinks['mo']['sql'] = "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".$this->db->prefix()."societe as s INNER JOIN ".$this->db->prefix().'mrp_mo as t ON t.fk_soc = s.rowid WHERE t.entity IN ('.getEntity('mo').')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : '');
} elseif ($object->table_element == 'mrp_mo') {
$possiblelinks['order_supplier']['sql'] = "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix().'commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.entity IN ('.getEntity('commande_fournisseur').')';
$possiblelinks['order_supplier']['sql'] = "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix().'commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.entity IN ('.getEntity('commande_fournisseur').')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : '');
}
$reshook = 0; // Ensure $reshook is defined for static analysis

View file

@ -117,33 +117,54 @@ class FormMail extends Form
*/
public $inreplyto;
/**
* @var int<0,1>
*/
public $withsubstit; // Show substitution array
/**
* @var int<0,1>
*/
public $withfrom;
/**
* @var int|string|array
* @var int<0,1>|string[]
*/
public $withto; // Show recipient emails
/**
* @var int<0,1>
*/
public $withreplyto;
/**
* @var int|string 0 = Do not Show free text for recipient emails
* @var int<0,1>|string 0 = Do not Show free text for recipient emails
* 1 = Show free text for recipient emails
* or a free email
*/
public $withtofree;
/**
* @var int<0,1>|string[]
*/
public $withtocc;
/**
* @var int<0,1>|string|string[] When 1|'1', enable BCC field, when not 0, use as default BCC email
*/
public $withtoccc;
/**
* @var int<0,1>|string
*/
public $withtopic;
/**
* @var int<0,1>
*/
public $witherrorsto;
/**
* @var int|string 0=No attaches files, 1=Show attached files, 2=Can add new attached files, 'text'=Show attached files and the text
* @var int<0,2>|string 0=No attaches files, 1=Show attached files, 2=Can add new attached files, 'text'=Show attached files and the text
*/
public $withfile;
/**
* @var int 1=Add a button "Fill with layout"
* @var int<0,1> 1=Add a button "Fill with layout"
*/
public $withlayout;
@ -153,23 +174,65 @@ class FormMail extends Form
public $withaiprompt;
/**
* @var int 1=Add a checkbox "Attach also main document" for mass actions (checked by default), -1=Add checkbox (not checked by default)
* @var int<-1,1> 1=Add a checkbox "Attach also main document" for mass actions (checked by default), -1=Add checkbox (not checked by default)
*/
public $withmaindocfile;
/**
* @var int<0,1>|string
*/
public $withbody;
/**
* @var int<0,1>
*/
public $withfromreadonly;
/**
* @var int<0,1>
*/
public $withreplytoreadonly;
/**
* @var int<0,1>
*/
public $withtoreadonly;
/**
* @var int<0,1>
*/
public $withtoccreadonly;
/**
* @var int<0,1>
*/
public $witherrorstoreadonly;
/**
* @var int<0,1>
*/
public $withtocccreadonly;
/**
* @var int<0,1>
*/
public $withtopicreadonly;
/**
* @var int<0,1>
*/
public $withbodyreadonly;
/**
* @var int<0,1>
*/
public $withfilereadonly;
/**
* @var int<0,1>
*/
public $withdeliveryreceipt;
/**
* @var int<0,1>
*/
public $withcancel;
/**
* @var int<0,1>
*/
public $withdeliveryreceiptreadonly;
/**
* @var int<-1,1>
*/
public $withfckeditor;
/**
@ -177,19 +240,36 @@ class FormMail extends Form
*/
public $ckeditortoolbar;
/**
* @var array<string,string>
*/
public $substit = array();
/**
* @var string[]
*/
public $substit_lines = array();
/**
* @var array{}|array{models:string,langsmodels?:string,fileinit?:string[],returnurl:string}
*/
public $param = array();
/**
* @var string[]
*/
public $withtouser = array();
/**
* @var string[]
*/
public $withtoccuser = array();
/**
* @var ModelMail[]
*/
public $lines_model;
// -1 suggest the checkbox 'one email per recipient' not checked, 0 = no suggestion, 1 = suggest and checked
/**
* @var int<-1,1> -1 suggests the checkbox 'one email per recipient' not checked, 0 = no suggestion, 1 = suggest and checked
*/
public $withoptiononeemailperrecipient;
@ -208,7 +288,7 @@ class FormMail extends Form
$this->withto = 1;
$this->withtofree = 1;
$this->withtocc = 1;
$this->withtoccc = 0;
$this->withtoccc = '0';
$this->witherrorsto = 0;
$this->withtopic = 1;
$this->withfile = 0; // 1=Add section "Attached files". 2=Can add files.
@ -732,7 +812,7 @@ class FormMail extends Form
if (empty($withtoselected) && count($tmparray) == 1 && GETPOST('action', 'aZ09') == 'presend') {
$withtoselected = array_keys($tmparray);
}
$out .= $form->multiselectarray("receiveruser", $tmparray, $withtoselected, null, null, 'inline-block minwidth500', null, "");
$out .= $form->multiselectarray("receiveruser", $tmparray, $withtoselected, 0, 0, 'inline-block minwidth500', 0, "");
$out .= "</td></tr>\n";
}
@ -781,7 +861,7 @@ class FormMail extends Form
if (empty($withtoselected) && count($tmparray) == 1 && GETPOST('action', 'aZ09') == 'presend') {
$withtoselected = array_keys($tmparray);
}
$out .= $form->multiselectarray("receiverccuser", $tmparray, $withtoselected, null, null, 'inline-block minwidth500', null, "");
$out .= $form->multiselectarray("receiverccuser", $tmparray, $withtoselected, 0, 0, 'inline-block minwidth500', 0, "");
$out .= "</td></tr>\n";
}
@ -879,9 +959,9 @@ class FormMail extends Form
}
$out .= '<br></div>';
}
} elseif (empty($this->withmaindocfile)) {
} /*elseif (empty($this->withmaindocfile)) {
//$out .= '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
}
}*/
if ($this->withfile == 2) {
$maxfilesizearray = getMaxFileSizeArray();
$maxmin = $maxfilesizearray['maxmin'];
@ -917,7 +997,7 @@ class FormMail extends Form
// Complete substitution array with the url to make online payment
$validpaymentmethod = array();
if (empty($this->substit['__REF__'])) {
if (empty($this->substit['__REF__'])) { // @phan-suppress-current-line PhanTypeMismatchProperty
$paymenturl = '';
} else {
// Set the online payment url link into __ONLINE_PAYMENT_URL__ key
@ -950,11 +1030,11 @@ class FormMail extends Form
$this->substit['__ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__'] = '';
// Add lines substitution key from each line
// Generate the string with the template for lines repeated and filled for each line
$lines = '';
$defaultlines = $arraydefaultmessage->content_lines;
if (isset($defaultlines)) {
foreach ($this->substit_lines as $substit_line) {
foreach ($this->substit_lines as $lineid => $substit_line) {
$lines .= make_substitutions($defaultlines, $substit_line)."\n";
}
}
@ -1168,7 +1248,7 @@ class FormMail extends Form
}
}
$out .= $form->multiselectarray("receiver", $tmparray, $withtoselected, null, null, 'inline-block minwidth500', 0, 0);
$out .= $form->multiselectarray("receiver", $tmparray, $withtoselected, 0, 0, 'inline-block minwidth500', 0, 0);
}
}
$out .= "</td></tr>\n";
@ -1216,7 +1296,7 @@ class FormMail extends Form
$withtoccselected = GETPOST("receivercc", 'array'); // Array of selected value
$out .= $form->multiselectarray("receivercc", $tmparray, $withtoccselected, null, null, 'inline-block minwidth500', 0, 0);
$out .= $form->multiselectarray("receivercc", $tmparray, $withtoccselected, 0, 0, 'inline-block minwidth500', 0, 0);
}
}
$out .= "</td></tr>\n";
@ -1265,7 +1345,7 @@ class FormMail extends Form
$withtocccselected = GETPOST("receiverccc", 'array'); // Array of selected value
$out .= $form->multiselectarray("receiverccc", $tmparray, $withtocccselected, null, null, 'inline-block minwidth500', 0, 0);
$out .= $form->multiselectarray("receiverccc", $tmparray, $withtocccselected, 0, 0, 'inline-block minwidth500', 0, 0);
}
}
@ -1971,7 +2051,8 @@ class FormMail extends Form
}
}
}
$this->substit_lines[] = $substit_line;
$this->substit_lines[$line->id] = $substit_line; // @phan-suppress-current-line PhanTypeMismatchProperty
}
}
}
@ -1981,8 +2062,8 @@ class FormMail extends Form
* This include the complete_substitutions_array.
*
* @param string $mode 'formemail', 'formemailwithlines', 'formemailforlines', 'emailing', ...
* @param Object $object Object if applicable
* @return array Array of substitution values for emails.
* @param ?Object $object Object if applicable
* @return array<string,string> Array of substitution values for emails.
*/
public static function getAvailableSubstitKey($mode = 'formemail', $object = null)
{
@ -2132,7 +2213,7 @@ class ModelMail extends CommonObject
"active" => array("type" => "integer", "label" => "Active", "enabled" => "1", 'position' => 65, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1",),
"topic" => array("type" => "text", "label" => "Topic", "enabled" => "1", 'position' => 70, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
"content" => array("type" => "mediumtext", "label" => "Content", "enabled" => "1", 'position' => 75, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
"content_lines" => array("type" => "text", "label" => "Contentlines", "enabled" => "1", 'position' => 80, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
"content_lines" => array("type" => "text", "label" => "Contentlines", "enabled" => "getDolGlobalString('MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES')", 'position' => 80, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
"enabled" => array("type" => "varchar(255)", "label" => "Enabled", "enabled" => "1", 'position' => 85, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
"joinfiles" => array("type" => "varchar(255)", "label" => "Joinfiles", "enabled" => "1", 'position' => 90, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
"email_from" => array("type" => "varchar(255)", "label" => "Emailfrom", "enabled" => "1", 'position' => 95, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
@ -2141,12 +2222,33 @@ class ModelMail extends CommonObject
"email_tobcc" => array("type" => "varchar(255)", "label" => "Emailtobcc", "enabled" => "1", 'position' => 110, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
"defaultfortype" => array("type" => "smallint(6)", "label" => "Defaultfortype", "enabled" => "1", 'position' => 115, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",),
);
/**
* @var int
*/
public $rowid;
/**
* @var string
*/
public $type_template;
/**
* @var int|string
*/
public $datec;
/**
* @var int
*/
public $tms;
/**
* @var int
*/
public $active;
/**
* @var string
*/
public $enabled;
/**
* @var int
*/
public $defaultfortype;
/**
@ -2175,16 +2277,38 @@ class ModelMail extends CommonObject
public $topic;
/**
* @var string Model mail content
* @var string Model mail content
*/
public $content;
/**
* @var string Model to use to generate the string with each lines
*/
public $content_lines;
/**
* @var string
*/
public $lang;
/**
* @var int<0,1>
*/
public $joinfiles;
/**
* @var string
*/
public $email_from;
/**
* @var string
*/
public $email_to;
/**
* @var string
*/
public $email_tocc;
/**
* @var string
*/
public $email_tobcc;
/**

View file

@ -424,7 +424,7 @@ abstract class Stats
* Return nb of elements, total amount and avg amount each year
*
* @param string $sql SQL request
* @return array<array{year:string,nb:string,nb_diff:float,total_diff:float,avg_diff:float,avg_weighted:float}> Array with nb, total amount, average for each year
* @return array<array{year:string,nb:string,nb_diff:float,total?:float,avg?:float,weighted?:float,total_diff?:float,avg_diff?:float,avg_weighted?:float}> Array with nb, total amount, average for each year
*/
protected function _getAllByYear($sql)
{

View file

@ -213,7 +213,7 @@ class Translate
/**
* Load translation files.
*
* @param array $domains Array of lang files to load
* @param string[] $domains Array of lang files to load
* @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK
*/
public function loadLangs($domains)
@ -243,12 +243,12 @@ class Translate
* If $domain is "file@module" instead of "file" then we look for module lang file
* in htdocs/custom/modules/mymodule/langs/code_CODE/file.lang
* then in htdocs/module/langs/code_CODE/file.lang instead of htdocs/langs/code_CODE/file.lang
* @param integer $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US)
* @param int $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US)
* @param int $stopafterdirection Stop when the DIRECTION tag is found (optimize speed)
* @param string $forcelangdir To force a different lang directory
* @param int $loadfromfileonly 1=Do not load overwritten translation from file or old conf.
* @param int $forceloadifalreadynotfound Force attempt to reload lang file if it was previously not found
* @param array $tabtranslatedomain Store translations to be stored in cache
* @param array<string,string> $tabtranslatedomain Store translations to be stored in cache
* @param string $langkey To create key for cachekey in recursivity
* @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK
* @see loadLangs()
@ -867,11 +867,11 @@ class Translate
/**
* Return list of all available languages
*
* @param string $langdir Directory to scan
* @param integer $maxlength Max length for each value in combo box (will be truncated)
* @param int $usecode 1=Show code instead of country name for language variant, 2=Show only code
* @param int $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...)
* @return array List of languages
* @param string $langdir Directory to scan
* @param int $maxlength Max length for each value in combo box (will be truncated)
* @param int<0,1> $usecode 1=Show code instead of country name for language variant, 2=Show only code
* @param int<0,1> $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...)
* @return array<string,string> List of languages
*/
public function get_available_languages($langdir = DOL_DOCUMENT_ROOT, $maxlength = 0, $usecode = 0, $mainlangonly = 0)
{
@ -1195,7 +1195,7 @@ class Translate
* Return an array with content of all loaded translation keys (found into this->tab_translate) so
* we get a substitution array we can use for substitutions (for mail or ODT generation for example)
*
* @return array Array of translation keys lang_key => string_translation_loaded
* @return array<string,string> Array of translation keys lang_key => string_translation_loaded
*/
public function get_translations_for_substitutions()
{

View file

@ -2076,7 +2076,7 @@ function phpinfo_array()
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function company_admin_prepare_head()
{
@ -2115,7 +2115,7 @@ function company_admin_prepare_head()
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function email_admin_prepare_head()
{

View file

@ -512,7 +512,7 @@ function actions_prepare_head($object)
* Define head array for tabs of agenda setup pages
*
* @param string $param Parameters to add to url
* @return array Array of head
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function calendars_prepare_head($param)
{

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2018-2022 OpenDSI <support@open-dsi.fr>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
/* Copyright (C) 2018-2022 OpenDSI <support@open-dsi.fr>
* Copyright (C) 2022-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
@ -25,7 +26,7 @@
/**
* Prepare admin pages header
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> head array with tabs
*/
function assetAdminPrepareHead()
{
@ -82,7 +83,7 @@ function assetAdminPrepareHead()
* Prepare array of tabs for Asset
*
* @param Asset $object Asset
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs
*/
function assetPrepareHead(Asset $object)
{
@ -178,7 +179,7 @@ function assetPrepareHead(Asset $object)
* Prepare array of tabs for AssetModel
*
* @param AssetModel $object AssetModel
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function assetModelPrepareHead($object)
{

View file

@ -38,7 +38,7 @@
* Return array of tabs to used on pages for third parties cards.
*
* @param Societe $object Object company shown
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function societe_prepare_head(Societe $object)
{
@ -477,7 +477,7 @@ function societe_prepare_head(Societe $object)
* Return array of tabs to used on page
*
* @param Object $object Object for tabs
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function societe_prepare_head2($object)
{
@ -503,7 +503,7 @@ function societe_prepare_head2($object)
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function societe_admin_prepare_head()
{

View file

@ -142,7 +142,7 @@ function contract_prepare_head(Contrat $object)
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function contract_admin_prepare_head()
{

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
* Copyright (C) 2013 Florian Henry <florian.henry@opn-concept.pro>
* 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
@ -26,7 +27,7 @@
/**
* Return array of tabs to used on pages to setup cron module.
*
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function cronadmin_prepare_head()
{
@ -56,7 +57,7 @@ function cronadmin_prepare_head()
* Return array of tabs to used on a cron job
*
* @param Cronjob $object Object cron
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function cron_prepare_head(Cronjob $object)
{

View file

@ -174,7 +174,7 @@ function ecm_prepare_head_fm($object)
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function ecm_admin_prepare_head()
{

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2021 Florian Henry <florian.henry@scopen.fr>
* Copyright (C) 2023 Frédéric France <frederic.france@netlogic.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
@ -25,7 +26,7 @@
/**
* Prepare admin pages header
*
* @return array
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function eventorganizationAdminPrepareHead()
{

View file

@ -69,7 +69,7 @@ function expedition_prepare_head(Expedition $object)
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function expedition_admin_prepare_head()
{

View file

@ -94,7 +94,7 @@ function expensereport_prepare_head($object)
* It loads tabs from modules looking for the entity payment
*
* @param PaymentExpenseReport $object Current payment object
* @return array Tabs for the payment section
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function payment_expensereport_prepare_head(PaymentExpenseReport $object)
{
@ -127,7 +127,7 @@ function payment_expensereport_prepare_head(PaymentExpenseReport $object)
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function expensereport_admin_prepare_head()
{

View file

@ -283,7 +283,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object)
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function supplierorder_admin_prepare_head()
{

View file

@ -9,7 +9,7 @@
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
@ -233,6 +233,21 @@ function getDolGlobalInt($key, $default = 0)
return (int) (isset($conf->global->$key) ? $conf->global->$key : $default);
}
/**
* Return a Dolibarr global constant float value.
* The constants $conf->global->xxx are loaded by the script master.inc.php included at begin of any PHP page.
*
* @param string $key Key to return value, return $default if not set
* @param float $default Value to return if not defined
* @return float Value returned
* @see getDolUserInt()
*/
function getDolGlobalFloat($key, $default = 0)
{
global $conf;
return (float) (isset($conf->global->$key) ? $conf->global->$key : $default);
}
/**
* Return a Dolibarr global constant boolean value.
* The constants $conf->global->xxx are loaded by the script master.inc.php included at begin of any PHP page.
@ -9303,6 +9318,12 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = ($paymenturl ? str_replace('\n', "\n", $outputlangs->trans("PredefinedMailContentLink", $paymenturl)) : '');
$substitutionarray['__ONLINE_PAYMENT_URL__'] = $paymenturl;
// Show structured communication
if (getDolGlobalString('INVOICE_PAYMENT_ENABLE_STRUCTURED_COMMUNICATION') && $object->element == 'facture') {
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php';
$substitutionarray['__PAYMENT_STRUCTURED_COMMUNICATION__'] = dolBECalculateStructuredCommunication($object->ref, $object->type);
}
if (getDolGlobalString('PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD') && is_object($object) && $object->element == 'propal') {
$substitutionarray['__DIRECTDOWNLOAD_URL_PROPOSAL__'] = $object->getLastMainDocLink($object->element);
} else {

View file

@ -0,0 +1,77 @@
<?php
/* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* or see https://www.gnu.org/
*/
/**
* \file htdocs/core/lib/functions_be.lib.php
* \brief A set of belgium functions for Dolibarr
* This file contains rare functions.
*/
/**
* Calculate Structured Communication / BE Bank payment reference number
*
* @param string $invoice_number Invoice number to generate payment reference
* @param int $invoice_type Invoice type
* @return string String structured communication for payment
*/
function dolBECalculateStructuredCommunication($invoice_number, $invoice_type)
{
$invoice_number = preg_replace('/[^0-9]/', '', $invoice_number); // Keep only numbers
// We complete with 0 and take the last 8 digits of the number are used to generate the reference base.
$invoice_number = substr('00000000'.$invoice_number, -8);
// Prefix with invoice type
switch ($invoice_type) {
case '0':
$invoice_type = '20'; // invoice type standard
break;
case '1':
$invoice_type = '30'; // invoice type replacement
break;
case '2':
$invoice_type = '40'; // invoice type credit note
break;
case '3':
$invoice_type = '21'; // invoice type deposit
break;
case '5':
$invoice_type = '20'; // invoice type situation, force to standard
break;
default:
$invoice_type = '00';
}
// Calculate module97
$invoice_number = $invoice_type.$invoice_number;
$mod97 = intval($invoice_number) % 97;
$controlKey = ($mod97 === 0) ? 97 : $mod97;
// Add the check digit at the end of the reference
$invoice_number .= $controlKey;
// Format reference as XXX/XXXX/XXXXX
$part1 = '+++'.substr($invoice_number, 0, 3);
$part2 = substr($invoice_number, 3, 4);
$part3 = substr($invoice_number, 7, 5).'+++'; // Includes last 3 digits + 2 check digits
$invoice_number = $part1 . '/' . $part2 . '/' . $part3;
return $invoice_number;
}

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.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
@ -26,7 +27,7 @@
* Return array head with list of tabs to view object information
*
* @param Object $object Holiday
* @return array head
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function holiday_prepare_head($object)
{
@ -76,7 +77,7 @@ function holiday_prepare_head($object)
/**
* Return array head with list of tabs to view object information
*
* @return array head
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function holiday_admin_prepare_head()
{

View file

@ -63,7 +63,7 @@ function establishment_prepare_head($object)
/**
* Return array head with list of tabs to view object information
*
* @return array head
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function hrm_admin_prepare_head()
{

View file

@ -4,6 +4,7 @@
* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.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
@ -31,7 +32,7 @@
*
* @param string $param Params to add on url links
* @param int $maxstep Limit steps to maxstep or no limit if 0
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function import_prepare_head($param, $maxstep = 0)
{

View file

@ -33,7 +33,7 @@
* Initialize the array of tabs for customer invoice
*
* @param Facture $object Invoice object
* @return array Array of head tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function facture_prepare_head($object)
{
@ -164,7 +164,7 @@ function facture_prepare_head($object)
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function invoice_admin_prepare_head()
{
@ -248,7 +248,7 @@ function invoice_admin_prepare_head()
* Return array head with list of tabs to view object information.
*
* @param FactureRec $object Invoice model object
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function invoice_rec_prepare_head($object)
{
@ -311,7 +311,7 @@ function invoice_rec_prepare_head($object)
* Return array head with list of tabs to view object information.
*
* @param Facture $object Invoice object
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function supplier_invoice_rec_prepare_head($object)
{
@ -366,7 +366,7 @@ function getNumberInvoicesPieChart($mode)
$amount_mode = (getDolGlobalInt('FACTURE_VALIDATED_IN_AMOUNT') == 1);
$sql = "SELECT";
$sql = "SELECT";
$sql .= " sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub30, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as late30";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub15, 'Y-m-d')."' AND f.date_lim_reglement >= '".date_format($datenowsub30, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as late15";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($now, 'Y-m-d')."' AND f.date_lim_reglement >= '".date_format($datenowsub15, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as latenow";

View file

@ -28,7 +28,7 @@
/**
* Initialize the array of tabs for customer invoice
*
* @return array Array of head tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function ldap_prepare_head()
{

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2006-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
@ -24,7 +25,7 @@
/**
* Return array head with list of tabs to view object information
*
* @return array Tabs of the module
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function mailmanspip_admin_prepare_head()
{

View file

@ -56,7 +56,7 @@ function multicurrencyAdminPrepareHead()
/**
* Prepare array with list of currency tabs
*
* @param array $aCurrencies Currencies array
* @param string[] $aCurrencies Currencies array
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function multicurrencyLimitPrepareHead($aCurrencies)

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
* Copyright (C) 2013 Florian Henry <florian.henry@opn-concept.pro>
* 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
@ -359,7 +360,7 @@ function getSupportedOauth2Array()
/**
* Return array of tabs to used on pages to setup cron module.
*
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function oauthadmin_prepare_head()
{

View file

@ -174,7 +174,7 @@ function commande_prepare_head(Commande $object)
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function order_admin_prepare_head()
{

View file

@ -4,6 +4,7 @@
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Abbes Bahfir <bafbes@gmail.com>
* Copyright (C) 2021 Waël Almoman <info@almoman.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
@ -25,7 +26,7 @@
* It loads tabs from modules looking for the entity payment
*
* @param Paiement $object Current payment object
* @return array Tabs for the payment section
* @return array<array{0:string,1:string,2:string}> Array of tabs for the payment section
*/
function payment_prepare_head(Paiement $object)
{
@ -73,7 +74,7 @@ function payment_prepare_head(Paiement $object)
* It loads tabs from modules looking for the entity payment
*
* @param int $id ID of bank line
* @return array Tabs for the Bankline section
* @return array<array{0:string,1:string,2:string}> Array of tabs for the Banline section
*/
function bankline_prepare_head($id)
{
@ -108,7 +109,7 @@ function bankline_prepare_head($id)
* It loads tabs from modules looking for the entity payment_supplier
*
* @param Paiement $object Current payment object
* @return array Tabs for the payment section
* @return array<array{0:string,1:string,2:string}> Tabs for the payment section
*/
function payment_supplier_prepare_head(Paiement $object)
{

View file

@ -123,7 +123,7 @@ function prelevement_check_config($type = 'direct-debit')
* @param BonPrelevement $object Member
* @param int $nbOfInvoices No of invoices
* @param int $nbOfSalaryInvoice No of salary invoices
* @return array head
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function bon_prelevement_prepare_head(BonPrelevement $object, $nbOfInvoices, $nbOfSalaryInvoice)
{

View file

@ -193,6 +193,7 @@ function product_prepare_head($object)
// Attachments
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = '';
if (isModEnabled("product") && ($object->type == Product::TYPE_PRODUCT)) {
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
}
@ -315,10 +316,10 @@ function productlot_prepare_head($object)
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
*/
* Return array head with list of tabs to view object information.
*
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function product_admin_prepare_head()
{
global $langs, $conf, $user, $db;
@ -378,7 +379,7 @@ function product_admin_prepare_head()
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function product_lot_admin_prepare_head()
{

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Frederic 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
@ -28,7 +29,7 @@
* Define head array for tabs of receipt printer setup pages
*
* @param string $mode Mode
* @return Array of head
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function receiptprinteradmin_prepare_head($mode)
{

View file

@ -3,6 +3,7 @@
* Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Gilles Poirier <gilles.poirier@netlogic.fr>
* Copyright (C) 2023 Frédéric France <frederic.france@netlogic.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
@ -28,7 +29,7 @@
* Prepare head for tabs
*
* @param Dolresource $object Object
* @return array Array of head entries
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function resource_prepare_head($object)
{
@ -110,7 +111,7 @@ function resource_prepare_head($object)
/**
* Prepare head for admin tabs
*
* @return array Array of head entries
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function resource_admin_prepare_head()
{

View file

@ -4,6 +4,7 @@
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2023 Frédéric France <frederic.france@netlogic.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
@ -25,7 +26,7 @@
* It loads tabs from modules looking for the entity salaries
*
* @param Paiement $object Current salaries object
* @return array Tabs for the salaries section
* @return array<array{0:string,1:string,2:string}> Tabs for the salaries section
*/
function salaries_prepare_head($object)
{
@ -98,7 +99,7 @@ function salaries_prepare_head($object)
/**
* Return array head with list of tabs to view object information
*
* @return array head
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function salaries_admin_prepare_head()
{

View file

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2017 Regis Houssin <regis.houssin@inodbox.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
@ -586,7 +587,7 @@ function dolJSToSetRandomPassword($htmlname, $htmlnameofbutton = 'generate_token
$out .= 'jQuery(document).ready(function () {
jQuery("#'.dol_escape_js($htmlnameofbutton).'").click(function() {
var currenttoken = jQuery("meta[name=anti-csrf-currenttoken]").attr("content");
console.log("We click on the button '.dol_escape_js($htmlnameofbutton).' to suggest a key. anti-csrf-currentotken is "+currenttoken+". We will fill '.dol_escape_js($htmlname).'");
console.log("We click on the button '.dol_escape_js($htmlnameofbutton).' to suggest a key. anti-csrf-currenttoken is "+currenttoken+". We will fill '.dol_escape_js($htmlname).'");
jQuery.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: '.($generic ? '1' : '0').',

View file

@ -4,6 +4,7 @@
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2023 Frédéric France <frederic.france@netlogic.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
@ -22,7 +23,7 @@
/**
* Function for return different onglet of socialnetworks admin page
* @return array Tabs for the admin section
* @return array<array{0:string,1:string,2:string}> Tabs for the admin section
*/
function socialnetwork_prepare_head()
{

View file

@ -87,7 +87,7 @@ function stock_prepare_head($object)
/**
* Return array head with list of tabs to view object information.
*
* @return array head array with tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function stock_admin_prepare_head()
{

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@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
@ -25,7 +26,7 @@
/**
* Prepare array with list of tabs
*
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function takepos_admin_prepare_head()
{

View file

@ -27,7 +27,7 @@
/**
* Build tabs for admin page
*
* @return array
* @return array<array{0:string,1:string,2:string}>
*/
function ticketAdminPrepareHead()
{
@ -79,7 +79,7 @@ function ticketAdminPrepareHead()
* Build tabs for a Ticket object
*
* @param Ticket $object Object Ticket
* @return array Array of tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function ticket_prepare_head($object)
{
@ -218,12 +218,12 @@ function generate_random_id($car = 16)
/**
* Show http header, open body tag and show HTML header banner for public pages for tickets
*
* @param string $title Title
* @param string $head Head array
* @param int $disablejs More content into html header
* @param int $disablehead More content into html header
* @param array $arrayofjs Array of complementary js files
* @param array $arrayofcss Array of complementary css files
* @param string $title Title
* @param string $head Head array
* @param int<0,1> $disablejs More content into html header
* @param int<0,1> $disablehead More content into html header
* @param string[] $arrayofjs Array of complementary js files
* @param string[] $arrayofcss Array of complementary css files
* @return void
*/
function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [])

View file

@ -512,8 +512,8 @@ function dolWebsiteSaveContent($content)
* @param string $containerref Ref of container to redirect to (Example: 'mypage' or 'mypage.php').
* @param string $containeraliasalt Ref of alternative aliases to redirect to.
* @param int $containerid Id of container.
* @param int $permanent 0=Use temporary redirect 302, 1=Use permanent redirect 301
* @param array $parameters Array of parameters to append to the URL.
* @param int<0,1> $permanent 0=Use temporary redirect 302, 1=Use permanent redirect 301
* @param array<string,mixed> $parameters Array of parameters to append to the URL.
* @return void
*/
function redirectToContainer($containerref, $containeraliasalt = '', $containerid = 0, $permanent = 0, $parameters = array())
@ -654,7 +654,7 @@ function includeContainer($containerref)
* <?php getStructureData('software', array('name'=>'Name', 'os'=>'Windows', 'price'=>10)); ?>
*
* @param string $type 'blogpost', 'product', 'software', 'organization', 'qa', ...
* @param array $data Array of data parameters for structured data
* @param array<string,mixed> $data Array of data parameters for structured data
* @return string HTML content
*/
function getStructuredData($type, $data = array())
@ -862,7 +862,7 @@ function getStructuredData($type, $data = array())
/**
* Return HTML content to add as header card for an article, news or Blog Post or home page.
*
* @param array $params Array of parameters
* @param ?array<string,mixed> $params Array of parameters
* @return string HTML content
*/
function getSocialNetworkHeaderCards($params = null)
@ -1106,7 +1106,7 @@ function getImagePublicURLOfObject($object, $no = 1, $extName = '')
* Return array with list of all public files of a given object.
*
* @param Object $object Object
* @return array List of public files of object
* @return array<array{filename:string,position:int,url:string}> List of public files of object
* @see getImagePublicURLOfObject()
*/
function getPublicFilesOfObject($object)
@ -1163,11 +1163,11 @@ function getPublicFilesOfObject($object)
* @param string $searchstring Search string
* @param int $max Max number of answers
* @param string $sortfield Sort Fields
* @param string $sortorder Sort order ('DESC' or 'ASC')
* @param 'DESC'|'ASC' $sortorder Sort order ('DESC' or 'ASC')
* @param string $langcode Language code ('' or 'en', 'fr', 'es', ...)
* @param array $otherfilters Other filters
* @param int $status 0 or 1, or -1 for both
* @return array Array with results of search
* @param array<string,mixed> $otherfilters Other filters
* @param int<-1,1> $status 0 or 1, or -1 for both
* @return array{list?:WebsitePage[],code?:string,message?:string} Array with results of search
*/
function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $sortfield = 'date_creation', $sortorder = 'DESC', $langcode = '', $otherfilters = [], $status = 1)
{
@ -1534,7 +1534,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify
* Retrieves the details of a news post by its ID.
*
* @param string $postId The ID of the news post to retrieve.
* @return array|int Return array if OK, -1 if KO
* @return array<string,mixed>|int<-1,-1> Return array if OK, -1 if KO
*/
function getNewsDetailsById($postId)
{

View file

@ -1,18 +1,19 @@
<?php
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017-2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017-2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Nick Fragoulis
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.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
@ -1325,6 +1326,13 @@ class pdf_crabe extends ModelePDFFactures
$posy = pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size);
$posy += 2;
if (getDolGlobalString('INVOICE_PAYMENT_ENABLE_STRUCTURED_COMMUNICATION')) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php';
$invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', 0);
}
}
}
}

View file

@ -1528,6 +1528,14 @@ class pdf_octopus extends ModelePDFFactures
$posy = pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size);
$posy += 2;
// Show structured communication
if (getDolGlobalString('INVOICE_PAYMENT_ENABLE_STRUCTURED_COMMUNICATION')) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php';
$invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', 0);
}
}
}
}

View file

@ -1,18 +1,18 @@
<?php
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Nick Fragoulis
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2022-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Nick Fragoulis
*
* 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
@ -1449,6 +1449,14 @@ class pdf_sponge extends ModelePDFFactures
$pdf->MultiCell(30, 3, $langs->trans("INVOICE_ADD_EPC_QR_CODEPay"), 0, 'L', 0);
$posy = $pdf->GetY() + 2;
}
// Show structured communication
if (getDolGlobalString('INVOICE_PAYMENT_ENABLE_STRUCTURED_COMMUNICATION')) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php';
$invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', 0);
}
}
}
}

View file

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.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
@ -123,4 +124,29 @@ class modVariants extends DolibarrModules
$this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->eventorganization->level1)
$r++;
}
/**
* Function called when module is enabled.
* The init function adds constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
public function init($options = '')
{
$result = $this->_load_tables('/install/mysql/', 'variants');
if ($result < 0) {
// Do not activate module if error 'not allowed' returned when loading module SQL queries
// (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
return -1;
}
// Permissions
$this->remove($options);
$sql = array();
return $this->_init($sql, $options);
}
}

View file

@ -559,7 +559,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
}
if ($localtax2_type && $localtax2ligne != 0) {
if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) {
$this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne;
$this->localtax2[$localtax2_type][$localtax2_rate] = (float) $localtax2ligne;
} else {
$this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne;
}
@ -869,7 +869,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
* Show total to pay
*
* @param TCPDF $pdf Object PDF
* @param Facture $object Object invoice
* @param SupplierProposal $object Object proposal
* @param int $deja_regle Montant deja regle
* @param int $posy Position depart
* @param Translate $outputlangs Object langs
@ -1144,7 +1144,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) {
$pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
$pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
}
}
@ -1210,6 +1210,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{
global $conf, $langs;
'@phan-var-force SupplierProposal $object';
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "bills", "supplier_proposal", "companies"));

View file

@ -694,7 +694,7 @@ class pdf_zenith extends ModelePDFSupplierProposal
}
if ($localtax2_type && $localtax2ligne != 0) {
if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) {
$this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne;
$this->localtax2[$localtax2_type][$localtax2_rate] = (float) $localtax2ligne;
} else {
$this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne;
}
@ -1146,7 +1146,7 @@ class pdf_zenith extends ModelePDFSupplierProposal
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) {
$pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
$pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
}
}

Some files were not shown because too many files have changed in this diff Show more