diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..44d6804de --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: "CI" + +on: [push, pull_request] +jobs: + #pre-commit: + # if: false + # uses: ./.github/workflows/pre-commit.yml + # secrets: inherit + # with: + # gh_event: ${{ github.event_name }} + phan: + uses: ./.github/workflows/phan.yml + secrets: inherit + # needs: [pre-commit] + with: + gh_event: ${{ github.event_name }} +#phpstan: +# if: false +# uses: ./.github/workflows/phpstan.yml +# secrets: inherit +# needs: [pre-commit] +# with: +# gh_event: ${{ github.event_name }} +#windows-ci: +# if: false +# needs: [pre-commit, phpstan, phan] +# secrets: inherit +# uses: ./.github/workflows/windows-ci.yml +# with: +# gh_event: ${{ github.event_name }} +#gh-travis: # Runs travis script on github runner (not on travis) +# if: false +# # needs: [pre-commit, phan] +# # needs: [windows-ci] +# secrets: inherit +# uses: ./.github/workflows/gh-travis.yml +# with: +# gh_event: ${{ github.event_name }} diff --git a/.github/workflows/phan.yml b/.github/workflows/phan.yml new file mode 100644 index 000000000..f968a3f26 --- /dev/null +++ b/.github/workflows/phan.yml @@ -0,0 +1,58 @@ +--- +on: + # pull_request: + # push: + # schedule: + # # execute once a day, the 1st + # - cron: 10 9 * * * + workflow_call: + inputs: + gh_event: + required: true + type: string + workflow_dispatch: + +concurrency: + group: phan-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +env: + gh_event: ${{ inputs.gh_event || github.event_name }} + PHAN_CONFIG: > + ${{ 'dev/tools/phan/config.php' }} + PHAN_BASELINE: dev/tools/phan/baseline.txt + PHAN_MIN_PHP: 7.0 + PHAN_QUICK: ${{ github.event.schedule && '' || '--quick' }} + GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action + +name: phan +jobs: + phan: + name: Run phan + runs-on: ubuntu-latest + # Do not run schedule on forks + if: | + github.repository == 'DoliCloud/DoliMods' + || github.event.schedule == false + steps: + - uses: actions/checkout@v4 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + coverage: none # disable xdebug, pcov + tools: cs2pr,phan + - name: Run Phan analysis + run: | + phan $PHAN_QUICK -k $PHAN_CONFIG -B $PHAN_BASELINE --analyze-twice --minimum-target-php-version $PHAN_MIN_PHP --output-mode=checkstyle -o _phan.xml + - name: Add results to PR + if: ${{ always() }} + run: | + cs2pr --prepend-filename --prepend-source --notices-as-warnings _phan.xml + - name: Provide phan log as artifact + uses: actions/upload-artifact@v4 + if: ${{ always() }} + with: + name: phan-srcrt + # path: ${{ github.workspace }}/phan.log + path: ${{ github.workspace }}/_phan.xml + retention-days: 2 diff --git a/dev/tools/phan/.baseline.txt.swp b/dev/tools/phan/.baseline.txt.swp new file mode 100644 index 000000000..ae7f08d4f Binary files /dev/null and b/dev/tools/phan/.baseline.txt.swp differ diff --git a/dev/tools/phan/README.md b/dev/tools/phan/README.md new file mode 100644 index 000000000..aabcf5f18 --- /dev/null +++ b/dev/tools/phan/README.md @@ -0,0 +1,7 @@ +# `dolibarr.php` + +The Dolibarr 'stub' is generated using `php-stubs/generator` installable with composer. + +```bash +( cd DolibarrRoot ; php -d memory_limit=4G .../vendor/bin/generate-stubs --out /fullpath/to/dolibarr.php --force htdocs ) +``` diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt new file mode 100644 index 000000000..9b8927422 --- /dev/null +++ b/dev/tools/phan/baseline.txt @@ -0,0 +1,407 @@ + [ + 'htdocs/alumni/admin/about.php' => ['PhanPluginDuplicateConditionalTernaryDuplication'], + 'htdocs/alumni/admin/setup.php' => ['PhanEmptyFQSENInClasslike', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanTypeExpectedObjectOrClassName', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredVariableDim'], + 'htdocs/alumni/class/actions_alumni.class.php' => ['PhanPluginEmptyStatementForeachLoop', 'PhanPluginEmptyStatementIf'], + 'htdocs/alumni/class/survey.class.php' => ['PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginMoreSpecificActualReturnTypeContainsFQSEN', 'PhanTypeInvalidLeftOperandOfBitwiseOp', 'PhanTypeMismatchArgument', 'PhanTypeObjectUnsetDeclaredProperty', 'PhanUndeclaredProperty'], + 'htdocs/alumni/core/modules/modAlumni.class.php' => ['PhanPluginRedundantAssignment', 'PhanTypeMismatchArgument'], + 'htdocs/alumni/lib/alumni.lib.php' => ['PhanPluginMoreSpecificActualReturnType'], + 'htdocs/alumni/lib/alumni_survey.lib.php' => ['PhanPluginMoreSpecificActualReturnType'], + 'htdocs/alumni/survey_agenda.php' => ['PhanPluginDuplicateConditionalTernaryDuplication', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeMismatchArgumentInternal'], + 'htdocs/alumni/survey_card.php' => ['PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/alumni/survey_document.php' => ['PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/alumni/survey_list.php' => ['PhanDeprecatedFunctionInternal', 'PhanParamSpecial1', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginRedundantAssignmentInGlobalScope', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/awstats/admin/about.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/awstats/admin/awstats.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/awstats/core/modules/modAWStats.class.php' => ['PhanPluginRedundantAssignment', 'PhanTypeMismatchProperty'], + 'htdocs/awstats/index.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginDuplicateIfStatements', 'PhanPluginInconsistentReturnFunction', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableAssignOp', 'PhanUndeclaredVariableDim'], + 'htdocs/billedonorders/admin/about.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/billedonorders/admin/billedonorders.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/billedonorders/class/actions_billedonorders.class.php' => ['PhanDeprecatedProperty', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchReturn'], + 'htdocs/billedonorders/core/modules/modBilledOnOrders.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/bittorrent/BDecode.php' => ['PhanTypeArraySuspicious', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredVariableDim'], + 'htdocs/bittorrent/BEncode.php' => ['PhanPluginInconsistentReturnMethod'], + 'htdocs/bittorrent/DumpTorrentCGI.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredGlobalVariable'], + 'htdocs/bittorrent/admin.php' => ['PhanDeprecatedFunction', 'PhanTypeSuspiciousStringExpression'], + 'htdocs/bittorrent/batch_upload.php' => ['PhanTypeMismatchDimFetch', 'PhanDeprecatedFunction', 'PhanDeprecatedFunctionInternal', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginSimplifyExpressionBool', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredConstant', 'PhanUndeclaredFunction', 'PhanUndeclaredGlobalVariable'], + 'htdocs/bittorrent/core/modules/modBitTorrent.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/bittorrent/deleter.php' => ['PhanDeprecatedFunction', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredFunction'], + 'htdocs/bittorrent/dltorrent.php' => ['PhanTypeSuspiciousStringExpression', 'PhanUndeclaredFunction'], + 'htdocs/bittorrent/edit_database.php' => ['PhanDeprecatedFunction', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredFunction', 'PhanUndeclaredGlobalVariable'], + 'htdocs/bittorrent/editconfig.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateAdjacentStatement', 'PhanTypeSuspiciousStringExpression'], + 'htdocs/bittorrent/funcsv2.php' => ['PhanDeprecatedEncapsVar', 'PhanDeprecatedFunctionInternal', 'PhanPluginInconsistentReturnFunction', 'PhanRedefineFunction', 'PhanRedefineFunctionInternal', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/bittorrent/index.php' => ['PhanDeprecatedEncapsVar', 'PhanDeprecatedFunction', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredFunction'], + 'htdocs/bittorrent/newtorrents.php' => ['PhanTypeMismatchDimFetch', 'PhanDeprecatedFunction', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginSimplifyExpressionBool', 'PhanTypeArraySuspiciousNullable', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredFunction'], + 'htdocs/bittorrent/rss_generator.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredFunction', 'PhanUndeclaredGlobalVariable'], + 'htdocs/bittorrent/sanity.php' => ['PhanDeprecatedEncapsVar', 'PhanDeprecatedFunction', 'PhanRedefineFunction', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredFunction'], + 'htdocs/bittorrent/sanity_no_output.php' => ['PhanDeprecatedEncapsVar', 'PhanRedefineFunction', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredFunction', 'PhanUndeclaredGlobalVariable'], + 'htdocs/bittorrent/seed.php' => ['PhanRedefineFunction', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeInvalidRightOperandOfNumericOp', 'PhanTypeMismatchArgumentInternal', 'PhanUndeclaredFunction'], + 'htdocs/bittorrent/sha1lib.php' => ['PhanCompatibleDimAlternativeSyntax', 'PhanDeprecatedFunctionInternal', 'PhanRedefineFunctionInternal', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentInternal', 'PhanUndeclaredConstant'], + 'htdocs/bittorrent/statistics.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredFunction'], + 'htdocs/bittorrent/torrent_functions.php' => ['PhanTypeMismatchDimAssignment', 'PhanTypeMismatchDimFetch', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeArraySuspiciousNull', 'PhanTypeArraySuspiciousNullable', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredFunction', 'PhanUndeclaredGlobalVariable'], + 'htdocs/bittorrent/tracker.php' => ['PhanDeprecatedEncapsVar', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentInternal', 'PhanUndeclaredFunction'], + 'htdocs/bittorrent/uploadstats.php' => ['PhanDeprecatedFunction', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredFunction'], + 'htdocs/captureserver/admin/about.php' => ['PhanDeprecatedFunction'], + 'htdocs/captureserver/admin/setup.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication'], + 'htdocs/captureserver/captureserver_card.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/captureserver/captureserver_list.php' => ['PhanDeprecatedFunctionInternal', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginRedundantAssignmentInGlobalScope', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/captureserver/class/captureserver.class.php' => ['PhanDeprecatedFunctionInternal', 'PhanDeprecatedProperty', 'PhanParamTooMany', 'PhanPluginAlwaysReturnMethod', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginDuplicateExpressionAssignment', 'PhanPluginMoreSpecificActualReturnTypeContainsFQSEN', 'PhanTypeMismatchArgument', 'PhanTypeObjectUnsetDeclaredProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], + 'htdocs/captureserver/core/includes/php-datadogstatsd/src/BatchedDogStatsd.php' => ['PhanDeprecatedFunctionInternal', 'PhanPluginNotFullyQualifiedFunctionCall'], + 'htdocs/captureserver/core/includes/php-datadogstatsd/src/DogStatsd.php' => ['PhanPluginAlwaysReturnMethod', 'PhanPluginNotFullyQualifiedFunctionCall', 'PhanPluginNotFullyQualifiedGlobalConstant', 'PhanPluginNotFullyQualifiedOptimizableFunctionCall', 'PhanPluginPossiblyStaticPrivateMethod', 'PhanPluginPrintfIncompatibleArgumentTypeWeak', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypeMissingReturn', 'PhanUndeclaredProperty'], + 'htdocs/captureserver/core/includes/php-datadogstatsd/tests/TestHelpers/CurlSpy.php' => ['PhanUndeclaredProperty'], + 'htdocs/captureserver/core/includes/php-datadogstatsd/tests/TestHelpers/CurlSpyTestCase.php' => ['PhanPluginPossiblyStaticProtectedMethod'], + 'htdocs/captureserver/core/includes/php-datadogstatsd/tests/TestHelpers/SocketSpyTestCase.php' => ['PhanPluginPossiblyStaticProtectedMethod'], + 'htdocs/captureserver/core/includes/php-datadogstatsd/tests/UnitTests/BatchedDogStatsdTest.php' => ['PhanPluginNotFullyQualifiedOptimizableFunctionCall'], + 'htdocs/captureserver/core/includes/php-datadogstatsd/tests/UnitTests/DogStatsd/CurlTest.php' => ['PhanPluginNotFullyQualifiedFunctionCall', 'PhanPluginNotFullyQualifiedGlobalConstant', 'PhanPluginNotFullyQualifiedOptimizableFunctionCall', 'PhanPluginPossiblyStaticPrivateMethod', 'PhanPluginPrintfIncompatibleArgumentTypeWeak', 'PhanTypeMismatchArgument', 'PhanTypeMismatchPropertyProbablyReal', 'PhanUnreferencedUseNormal'], + 'htdocs/captureserver/core/includes/php-datadogstatsd/tests/UnitTests/DogStatsd/SocketsTest.php' => ['PhanPluginNotFullyQualifiedGlobalConstant', 'PhanPluginNotFullyQualifiedOptimizableFunctionCall', 'PhanPluginPossiblyStaticPrivateMethod', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/captureserver/core/includes/php-datadogstatsd/tests/curl_and_error_log_function_stubs.php' => ['PhanPluginNotFullyQualifiedFunctionCall', 'PhanPluginMoreSpecificActualReturnType'], + 'htdocs/captureserver/core/includes/php-datadogstatsd/tests/mt_rand_function_stubs.php' => ['PhanPluginMoreSpecificActualReturnType', 'PhanPluginNotFullyQualifiedOptimizableFunctionCall'], + 'htdocs/captureserver/core/includes/php-datadogstatsd/tests/socket_function_stubs.php' => ['PhanPluginNotFullyQualifiedFunctionCall'], + 'htdocs/captureserver/lib/captureserver.lib.php' => ['PhanPluginMoreSpecificActualReturnType', 'PhanUndeclaredVariable'], + 'htdocs/captureserver/lib/captureserver_captureserver.lib.php' => ['PhanPluginMoreSpecificActualReturnType'], + 'htdocs/captureserver/public/index.php' => ['PhanDeprecatedFunctionInternal'], + 'htdocs/concatpdf/admin/about.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/concatpdf/admin/concatpdf.php' => ['PhanDeprecatedFunction', 'PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredVariableDim'], + 'htdocs/concatpdf/class/actions_concatpdf.class.php' => ['PhanDeprecatedFunctionInternal', 'PhanParamReqAfterOpt', 'PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginInconsistentReturnMethod', 'PhanPossiblyUndeclaredVariable', 'PhanRedefinedClassReference', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredMethod', 'PhanUndeclaredVariableDim'], + 'htdocs/concatpdf/core/modules/modConcatPdf.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/des_fr/index.php' => ['PhanEmptyFunction', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidUnaryOperandIncOrDec', 'PhanUndeclaredFunction', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/dolicloud/class/actions_dolicloud.class.php' => ['PhanCompatiblePHP8PHP4Constructor', 'PhanTypeMismatchReturn', 'PhanUndeclaredProperty', 'PhanUndeclaredVariableAssignOp'], + 'htdocs/dolicloud/core/modules/modDoliCloud.class.php' => ['PhanPluginDuplicateAdjacentStatement', 'PhanPluginRedundantAssignment'], + 'htdocs/dolicloud/core/triggers/interface_50_modDoliCloud_DoliCloudSynchro.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/dolicloud/scripts/statsemailings.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeArraySuspiciousNullable', 'PhanUndeclaredFunction', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/ecotaxdeee/admin/about.php' => ['PhanDeprecatedFunction'], + 'htdocs/ecotaxdeee/admin/index.php' => ['PhanDeprecatedFunction', 'PhanDeprecatedFunctionInternal', 'PhanPluginSimplifyExpressionBool', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable'], + 'htdocs/ecotaxdeee/admin/setup.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], + 'htdocs/ecotaxdeee/class/actions_ecotaxdeee.class.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPossiblyUndeclaredVariable', 'PhanTypeConversionFromArray', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredClassMethod', 'PhanUndeclaredTypeParameter'], + 'htdocs/ecotaxdeee/class/ecotaxdeee.class.php' => ['PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginMoreSpecificActualReturnType', 'PhanUndeclaredTypeProperty'], + 'htdocs/ecotaxdeee/core/modules/modEcoTaxDeee.class.php' => ['PhanPluginRedundantAssignment', 'PhanTypeMismatchArgument'], + 'htdocs/ecotaxdeee/core/triggers/interface_50_modEcotaxdeee_Ecotaxdeee.class.php' => ['PhanDeprecatedProperty', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyNullTypeMismatchProperty', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/ecotaxdeee/lib/ecotaxdeee.lib.php' => ['PhanPluginMoreSpecificActualReturnType', 'PhanPluginSimplifyExpressionBool'], + 'htdocs/externalbackup/admin/about.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/externalbackup/admin/externalbackup.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredGlobalVariable'], + 'htdocs/facturxutil/admin/about.php' => ['PhanDeprecatedFunction'], + 'htdocs/facturxutil/admin/setup.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication'], + 'htdocs/facturxutil/class/actions_facturx.class.php' => ['PhanPluginEmptyStatementForeachLoop', 'PhanPluginEmptyStatementIf', 'PhanUndeclaredVariable'], + 'htdocs/facturxutil/lib/facturxutil.lib.php' => ['PhanPluginMoreSpecificActualReturnType'], + 'htdocs/filemanager/admin/about.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/filemanager/admin/filemanager.php' => ['PhanDeprecatedFunction', 'PhanPluginRedundantAssignmentInGlobalScope', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredVariableDim'], + 'htdocs/filemanager/ajaxFileTree.php' => ['PhanEmptyFunction', 'PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/filemanager/ajaxfileactions.php' => ['PhanDeprecatedFunctionInternal', 'PhanEmptyFunction', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/filemanager/ajaxfileuploader.php' => ['PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/filemanager/ajaxshowpreview.php' => ['PhanDeprecatedFunctionInternal', 'PhanEmptyFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanRedefineFunction', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/filemanager/class/filemanagerroots.class.php' => ['PhanTypeMagicVoidWithReturn', 'PhanTypeMismatchArgument', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredClassMethod', 'PhanUndeclaredClassProperty'], + 'htdocs/filemanager/core/modules/modFileManager.class.php' => ['PhanParamSignatureMismatch', 'PhanTypeMismatchProperty', 'PhanTypeMismatchReturn'], + 'htdocs/filemanager/document.php' => ['PhanEmptyFunction', 'PhanPluginDuplicateExpressionAssignment', 'PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/filemanager/index.php' => ['PhanDeprecatedFunction', 'PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDefault', 'PhanUndeclaredGlobalVariable'], + 'htdocs/filemanager/viewimage.php' => ['PhanEmptyFunction', 'PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/form/core/modules/modForm.class.php' => ['PhanPluginRedundantAssignment', 'PhanUndeclaredProperty'], + 'htdocs/google/admin/about.php' => ['PhanDeprecatedFunction'], + 'htdocs/google/admin/google.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateAdjacentStatement', 'PhanTypeSuspiciousEcho'], + 'htdocs/google/admin/google_ad.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateAdjacentStatement', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/google/admin/google_an.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateAdjacentStatement', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/google/admin/google_calsync.php' => ['PhanDeprecatedFunction', 'PhanDeprecatedProperty', 'PhanParamTooFew', 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginSimplifyExpressionBool', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeArraySuspiciousNullable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredVariableDim'], + 'htdocs/google/admin/google_calsync_user.php' => ['PhanDeprecatedFunction', 'PhanDeprecatedProperty', 'PhanParamTooFew', 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginSimplifyExpressionBool', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeArraySuspiciousNullable', 'PhanTypeInvalidUnaryOperandIncOrDec', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/google/admin/google_contactsync.php' => ['PhanDeprecatedFunction', 'PhanDeprecatedFunctionInternal', 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidUnaryOperandIncOrDec', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredClassMethod', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/google/admin/google_gmaps.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateAdjacentStatement', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/google/admin/test.php' => ['PhanDeprecatedProperty'], + 'htdocs/google/class/actions_google.class.php' => ['PhanPluginDuplicateConditionalTernaryDuplication'], + 'htdocs/google/class/gcontacts.class.php' => ['PhanDeprecatedFunctionInternal', 'PhanDeprecatedImplicitNullableParam', 'PhanNonClassMethodCall', 'PhanPluginAlwaysReturnMethod', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginDuplicateExpressionAssignment', 'PhanPluginMoreSpecificActualReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeArraySuspicious', 'PhanTypeArraySuspiciousNullable', 'PhanTypeInvalidPropertyName', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentInternalReal', 'PhanTypeMismatchDeclaredParamNullable', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypeMissingReturn', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredFunction', 'PhanUndeclaredProperty', 'PhanUndeclaredTypeParameter', 'PhanUndeclaredVariable'], + 'htdocs/google/class/googlemaps.class.php' => ['PhanCompatiblePHP8PHP4Constructor', 'PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgument'], + 'htdocs/google/core/boxes/box_googlemaps.php' => ['PhanParamSignatureMismatch', 'PhanTypeMismatchReturn'], + 'htdocs/google/core/modules/modGoogle.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/google/core/triggers/interface_50_modGoogle_GoogleCalendarSynchro.class.php' => ['PhanPluginSimplifyExpressionBool', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternal', 'PhanTypeVoidAssignment'], + 'htdocs/google/core/triggers/interface_51_modGoogle_GoogleContactSynchro.class.php' => ['PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/google/gmaps.php' => ['PhanDeprecatedFunction', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/google/gmaps_all.php' => ['PhanDeprecatedFunction', 'PhanDeprecatedFunctionInternal', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginMoreSpecificActualReturnType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredClassMethod', 'PhanUndeclaredClassProperty'], + 'htdocs/google/index.php' => ['PhanDeprecatedFunction', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/google/lib/google.lib.php' => ['PhanPluginMoreSpecificActualReturnType', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchDeclaredParam'], + 'htdocs/google/lib/google_calendar.lib.php' => ['PhanDeprecatedFunctionInternal', 'PhanDeprecatedProperty', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginMoreSpecificActualReturnType', 'PhanPluginMoreSpecificActualReturnTypeContainsFQSEN', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeInvalidUnaryOperandIncOrDec', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDefault', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredClassMethod', 'PhanUndeclaredProperty', 'PhanUndeclaredVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/google/lib/google_contact.lib.php' => ['PhanCommentParamWithoutRealParam', 'PhanDeprecatedFunctionInternal', 'PhanNonClassMethodCall', 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginMoreSpecificActualReturnType', 'PhanPluginPrintfIncompatibleArgumentTypeWeak', 'PhanPossiblyUndeclaredVariable', 'PhanRedefineFunction', 'PhanTypeConversionFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimAssignment', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchReturn', 'PhanUndeclaredVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/google/oauth2callback.php' => ['PhanPluginDuplicateConditionalTernaryDuplication', 'PhanUndeclaredClassMethod', 'PhanUndeclaredGlobalVariable'], + 'htdocs/google/test/phpunit/gContactTest.php' => ['PhanDeprecatedFunctionInternal', 'PhanPluginAlwaysReturnMethod', 'PhanTypeMissingReturn', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredTypeReturnType', 'PhanUndeclaredVariable'], + 'htdocs/helloasso/admin/about.php' => ['PhanPluginDuplicateConditionalTernaryDuplication'], + 'htdocs/helloasso/admin/setup.php' => ['PhanEmptyFQSENInClasslike', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanTypeExpectedObjectOrClassName', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredVariableDim'], + 'htdocs/helloasso/class/actions_helloasso.class.php' => ['PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginEmptyStatementForeachLoop', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/helloasso/core/modules/modHelloAsso.class.php' => ['PhanPluginDuplicateAdjacentStatement', 'PhanPluginRedundantAssignment', 'PhanTypeMismatchArgument'], + 'htdocs/helloasso/lib/helloasso.lib.php' => ['PhanPluginDuplicateAdjacentStatement', 'PhanPluginMoreSpecificActualReturnType', 'PhanTypeInvalidUnaryOperandIncOrDec', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchReturn', 'PhanUndeclaredClassMethod', 'PhanUndeclaredTypeReturnType', 'PhanUndeclaredVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/helloasso/test/phpunit/functionnal/HelloAssoFunctionalTest.php' => ['PhanEmptyProtectedMethod', 'PhanEmptyPublicMethod', 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginMoreSpecificActualReturnType', 'PhanPluginNotFullyQualifiedFunctionCall', 'PhanPluginPossiblyStaticProtectedMethod', 'PhanUndeclaredClassCatch', 'PhanUndeclaredExtendedClass', 'PhanUndeclaredMethod'], + 'htdocs/ifttt/admin/index.php' => ['PhanPluginDuplicateAdjacentStatement'], + 'htdocs/ifttt/core/modules/modIFTTT.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/includes/ckfinder/config.php' => ['PhanUndeclaredFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/ipphone/admin/setup.php' => ['PhanDeprecatedFunction'], + 'htdocs/ipphone/core/modules/modIPPhone.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/ipphone/public/service.php' => ['PhanPluginDuplicateConditionalTernaryDuplication', 'PhanRedefineFunction'], + 'htdocs/lightbox/core/modules/modLightbox.class.php' => ['PhanPluginRedundantAssignment', 'PhanTypeMismatchProperty'], + 'htdocs/mantis/admin/mantis.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/mantis/class/mantis.class.php' => ['PhanCompatiblePHP8PHP4Constructor', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternalReal', 'PhanUndeclaredVariable'], + 'htdocs/mantis/mantis.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/memcached/admin/about.php' => ['PhanDeprecatedFunction'], + 'htdocs/memcached/admin/memcached.php' => ['PhanDeprecatedFunction', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredClassMethod', 'PhanUndeclaredGlobalVariable'], + 'htdocs/memcached/admin/memcached_stats.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginMoreSpecificActualReturnType', 'PhanPluginUnreachableCode', 'PhanTypeArraySuspicious', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchDefault', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypeSuspiciousStringExpression', 'PhanTypeVoidAssignment', 'PhanUndeclaredTypeReturnType', 'PhanUnextractableAnnotationSuffix'], + 'htdocs/memcached/core/modules/modMemcached.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/memcached/lib/memcached.lib.php' => ['PhanPluginMoreSpecificActualReturnType'], + 'htdocs/monitoring/admin/about.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/monitoring/admin/monitoring.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/monitoring/class/monitoring_probes.class.php' => ['PhanCompatiblePHP8PHP4Constructor', 'PhanPluginAlwaysReturnMethod', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternal', 'PhanUndeclaredProperty', 'PhanUndeclaredTypeParameter'], + 'htdocs/monitoring/core/modules/modMonitoring.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/monitoring/index.php' => ['PhanDeprecatedFunction', 'PhanNoopBinaryOperator', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeInvalidRightOperandOfNumericOp', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/monitoring/lib/monitoring.lib.php' => ['PhanNonClassMethodCall', 'PhanPluginMoreSpecificActualReturnType', 'PhanPluginMoreSpecificActualReturnTypeContainsFQSEN', 'PhanRedefineFunctionInternal', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredTypeParameter', 'PhanUndeclaredVariable'], + 'htdocs/monitoring/probes.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginRedundantAssignmentInGlobalScope', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/monitoring/scripts/monitor_daemon.php' => ['PhanPluginMoreSpecificActualReturnType', 'PhanPluginUnreachableCode', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction', 'PhanTypeArraySuspicious', 'PhanTypeArraySuspiciousNullable', 'PhanTypeInvalidUnaryOperandIncOrDec', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternalProbablyReal', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypeVoidAssignment', 'PhanUndeclaredConstant', 'PhanUndeclaredVariable'], + 'htdocs/moretemplates/admin/moretemplates.php' => ['PhanDeprecatedFunction'], + 'htdocs/moretemplates/core/modules/commande/doc/pdf_edison.modules.php' => ['PhanDeprecatedProperty', 'PhanNonClassMethodCall', 'PhanParamSignatureMismatch', 'PhanParamTooMany', 'PhanPluginMoreSpecificActualReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanRedefinedClassReference', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeInvalidLeftOperandOfAdd', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeInvalidRightOperandOfAdd', 'PhanTypeInvalidRightOperandOfNumericOp', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDefault', 'PhanTypeMismatchReturn', 'PhanUndeclaredProperty', 'PhanUndeclaredVariable'], + 'htdocs/moretemplates/core/modules/facture/doc/pdf_oursin.modules.php' => ['PhanDeprecatedProperty', 'PhanNonClassMethodCall', 'PhanParamSignatureMismatch', 'PhanParamTooMany', 'PhanPluginAlwaysReturnMethod', 'PhanPluginMoreSpecificActualReturnType', 'PhanPluginRedundantAssignment', 'PhanPluginUnreachableCode', 'PhanPossiblyUndeclaredVariable', 'PhanRedefinedClassReference', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeInvalidLeftOperandOfAdd', 'PhanTypeInvalidRightOperandOfAdd', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDefault', 'PhanTypeMismatchReturn', 'PhanTypeVoidAssignment', 'PhanUndeclaredProperty', 'PhanUndeclaredVariable'], + 'htdocs/moretemplates/core/modules/facture/doc/pdf_tourteau.modules.php' => ['PhanDeprecatedProperty', 'PhanNonClassMethodCall', 'PhanParamSignatureMismatch', 'PhanParamTooMany', 'PhanPluginAlwaysReturnMethod', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginMoreSpecificActualReturnType', 'PhanPluginRedundantAssignment', 'PhanPluginUnreachableCode', 'PhanRedefinedClassReference', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeInvalidLeftOperandOfAdd', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeInvalidRightOperandOfAdd', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDefault', 'PhanTypeMismatchReturn', 'PhanTypeVoidAssignment', 'PhanUndeclaredClassMethod', 'PhanUndeclaredProperty', 'PhanUndeclaredTypeParameter'], + 'htdocs/moretemplates/core/modules/modMoreTemplates.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/moretemplates/scripts/import-product.php' => ['PhanDeprecatedProperty', 'PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/moretemplates/scripts/materiel.net.php' => ['PhanPluginUnreachableCode', 'PhanRedefineFunction'], + 'htdocs/mywidgets/admin/about.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/mywidgets/admin/mywidgets.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/mywidgets/core/boxes/mywidgets.php' => ['PhanParamSignatureMismatch', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanUndeclaredVariable'], + 'htdocs/mywidgets/core/modules/modMyWidgets.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/netatmo/admin/about.php' => ['PhanDeprecatedFunction'], + 'htdocs/netatmo/admin/setup.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanUndeclaredConstant', 'PhanUndeclaredGlobalVariable'], + 'htdocs/netatmo/core/modules/modNetatmo.class.php' => ['PhanPluginDuplicateAdjacentStatement', 'PhanPluginRedundantAssignment'], + 'htdocs/netatmo/lib/netatmo.lib.php' => ['PhanPluginMoreSpecificActualReturnType', 'PhanUndeclaredVariable'], + 'htdocs/netatmo/public/netatmo.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/netatmo/test/phpunit/NetatmoFunctionalTest.php' => ['PhanEmptyProtectedMethod', 'PhanEmptyPublicMethod', 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginMoreSpecificActualReturnType', 'PhanPluginNotFullyQualifiedFunctionCall', 'PhanPluginPossiblyStaticProtectedMethod', 'PhanUndeclaredClassCatch', 'PhanUndeclaredExtendedClass', 'PhanUndeclaredMethod'], + 'htdocs/numberingpack/core/modules/modNumberingPack.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/numberingpack/core/modules/societe/mod_codeclient_lion.php' => ['PhanClassContainsAbstractMethod', 'PhanPluginAlwaysReturnMethod', 'PhanPluginPossiblyStaticPrivateMethod', 'PhanPluginRedundantAssignment', 'PhanTypeMismatchReturn'], + 'htdocs/numberingpack/core/modules/societe/mod_codeclient_zebre.php' => ['PhanClassContainsAbstractMethod', 'PhanParamSignatureMismatch', 'PhanPluginRedundantAssignment', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentInternalReal', 'PhanTypeMismatchDefault', 'PhanTypeMismatchReturn', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredClassProperty', 'PhanUndeclaredTypeParameter', 'PhanUndeclaredVariable', 'PhanUnextractableAnnotationElementName'], + 'htdocs/numberwords/admin/about.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/numberwords/admin/numberwords.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredVariableAssignOp', 'PhanUndeclaredVariableDim'], + 'htdocs/numberwords/core/modules/modNumberWords.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/numberwords/core/substitutions/functions_numberwords.lib.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/openstreetmap/admin/about.php' => ['PhanDeprecatedFunction'], + 'htdocs/openstreetmap/admin/openstreetmap_maps.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/openstreetmap/core/modules/modOpenStreetMap.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/openstreetmap/lib/openstreetmap.lib.php' => ['PhanPluginMoreSpecificActualReturnType'], + 'htdocs/openstreetmap/maps.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/ovh/admin/about.php' => ['PhanDeprecatedFunction'], + 'htdocs/ovh/admin/ovh_click2dial.php' => ['PhanDeprecatedFunction', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUnreferencedUseNormal'], + 'htdocs/ovh/admin/ovh_importinvoice.php' => ['PhanDeprecatedFunction', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredVariableDim', 'PhanUnreferencedUseNormal'], + 'htdocs/ovh/admin/ovh_setup.php' => ['PhanDeprecatedFunction', 'PhanDeprecatedFunctionInternal', 'PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/ovh/admin/ovh_sms_setup.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty', 'PhanUnreferencedUseNormal'], + 'htdocs/ovh/admin/ovh_smsrecap.php' => ['PhanDeprecatedFunction', 'PhanParamTooMany', 'PhanTypeArraySuspiciousNullable', 'PhanTypeConversionFromArray', 'PhanUndeclaredGlobalVariable', 'PhanUnreferencedUseNormal'], + 'htdocs/ovh/class/actions_ovh.class.php' => ['PhanPluginMoreSpecificActualReturnType', 'PhanPluginMoreSpecificActualReturnTypeContainsFQSEN', 'PhanPluginPossiblyStaticPrivateMethod', 'PhanTypeConversionFromArray', 'PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/ovh/class/ovhserver.class.php' => ['PhanPluginAlwaysReturnMethod', 'PhanPluginDuplicateExpressionBinaryOp', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchPropertyDefault', 'PhanUndeclaredProperty'], + 'htdocs/ovh/class/ovhsms.class.php' => ['PhanPluginMoreSpecificActualReturnType', 'PhanPluginUnreachableCode', 'PhanTypeMagicVoidWithReturn', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/ovh/core/modules/modOvh.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/ovh/core/triggers/interface_99_modOvh_OvhTriggers.class.php' => ['PhanPluginAlwaysReturnMethod', 'PhanTypeMismatchPropertyProbablyReal'], + 'htdocs/ovh/importovhinvoice.php' => ['PhanDeprecatedFunction', 'PhanDeprecatedFunctionInternal', 'PhanDeprecatedProperty', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeArraySuspiciousNullable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], + 'htdocs/ovh/lib/ovh.lib.php' => ['PhanPluginMoreSpecificActualReturnType'], + 'htdocs/ovh/ovh_listinfoserver.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginDuplicateExpressionBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchProperty'], + 'htdocs/ovh/scripts/importovhinvoice.php' => ['PhanDeprecatedFunctionInternal', 'PhanDeprecatedProperty', 'PhanPluginRedundantAssignmentInGlobalScope', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/ovh/sms_member.php' => ['PhanDeprecatedFunction', 'PhanDeprecatedProperty', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty', 'PhanUnreferencedUseNormal'], + 'htdocs/ovh/sms_thirdparty.php' => ['PhanPluginDuplicateConditionalTernaryDuplication', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty', 'PhanUnreferencedUseNormal'], + 'htdocs/ovh/wrapper.php' => ['PhanPluginSimplifyExpressionBool', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction', 'PhanTypeConversionFromArray', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/phpsysinfo/admin/about.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/phpsysinfo/admin/phpsysinfo.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/phpsysinfo/core/modules/modPHPSysInfo.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/phpsysinfo/frames.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/phpsysinfo/index.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/pibarcode/core/modules/barcode/pibarcode.modules.php' => ['PhanParamSignatureMismatch', 'PhanParamSignatureRealMismatchTooFewParameters', 'PhanPluginMoreSpecificActualReturnType', 'PhanRedefineClass', 'PhanUndeclaredClassMethod'], + 'htdocs/pibarcode/core/modules/modPiBarcode.class.php' => ['PhanPluginRedundantAssignment', 'PhanRedefineClass'], + 'htdocs/prestashopget/admin/about.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication'], + 'htdocs/prestashopget/admin/setup.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication'], + 'htdocs/prestashopget/class/actions_prestashopget.class.php' => ['PhanPluginEmptyStatementForeachLoop', 'PhanPluginEmptyStatementIf', 'PhanUndeclaredVariable'], + 'htdocs/prestashopget/core/boxes/prestashopgetwidget1.php' => ['PhanParamSignatureMismatch', 'PhanPluginDuplicateArrayKey'], + 'htdocs/prestashopget/index.php' => ['PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanTypeInvalidDimOffset', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeMismatchArgument'], + 'htdocs/prestashopget/lib/prestashopget.lib.php' => ['PhanPluginMoreSpecificActualReturnType', 'PhanUndeclaredVariable'], + 'htdocs/revertinvoice/admin/about.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication'], + 'htdocs/revertinvoice/admin/setup.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanTypeMismatchArgument'], + 'htdocs/revertinvoice/core/modules/modRevertInvoice.class.php' => ['PhanPluginDuplicateAdjacentStatement', 'PhanPluginRedundantAssignment'], + 'htdocs/revertinvoice/core/triggers/interface_99_modRevertInvoice_RevertInvoiceTriggers.class.php' => ['PhanDeprecatedProperty', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/revertinvoice/lib/revertinvoice.lib.php' => ['PhanPluginMoreSpecificActualReturnType'], + 'htdocs/saftpt/admin/saftpt.php' => ['PhanDeprecatedFunction', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/saftpt/class/html.formsaftpt.class.php' => ['PhanTypeMagicVoidWithReturn', 'PhanTypeMismatchReturnProbablyReal'], + 'htdocs/saftpt/class/saftpt.class.php' => ['PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginPossiblyStaticPrivateMethod', 'PhanTypeInvalidUnaryOperandIncOrDec', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternal', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredTypeParameter', 'PhanUndeclaredVariable'], + 'htdocs/saftpt/core/modules/modSaftPt.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/saftpt/exportsaft.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/saftpt/index.php' => ['PhanDeprecatedFunction'], + 'htdocs/scanner/admin/scannersetuppage.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/scanner/config.php' => ['PhanPluginUnsafeShellExecDynamic', 'PhanTypeMismatchArgument'], + 'htdocs/scanner/core/modules/modScanner.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/scanner/index.php' => ['PhanDeprecatedFunctionInternal', 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginRedundantAssignmentInGlobalScope', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeArraySuspiciousNullable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/selectbank/admin/about.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/selectbank/admin/selectbank.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/selectbank/class/actions_selectbank.class.php' => ['PhanPluginDuplicateAdjacentStatement', 'PhanTypeMismatchReturn', 'PhanUndeclaredProperty'], + 'htdocs/selectbank/core/modules/modSelectBank.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/sendgrid/admin/about.php' => ['PhanDeprecatedFunction'], + 'htdocs/sendgrid/admin/importinvoice.php' => ['PhanDeprecatedFunction', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/sendgrid/admin/setup.php' => ['PhanDeprecatedFunction', 'PhanPluginEmptyStatementIf', 'PhanRedefineFunction', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredClassMethod', 'PhanUndeclaredGlobalVariable'], + 'htdocs/sendgrid/core/modules/modSendGrid.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/sendgrid/importinvoice.php' => ['PhanDeprecatedFunction', 'PhanDeprecatedProperty', 'PhanPluginDuplicateExpressionAssignment', 'PhanTypeArraySuspiciousNullable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/sendgrid/lib/sendgrid.lib.php' => ['PhanPluginMoreSpecificActualReturnType'], + 'htdocs/sendgrid/scripts/importovhinvoice.php' => ['PhanDeprecatedFunctionInternal', 'PhanDeprecatedProperty', 'PhanPluginRedundantAssignmentInGlobalScope', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/skincoloreditor/admin/about.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/skincoloreditor/admin/advancededitor.php' => ['PhanDeprecatedFunction', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/skincoloreditor/admin/quickeditor.php' => ['PhanDeprecatedFunction', 'PhanDeprecatedFunctionInternal', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/skincoloreditor/core/modules/modSkinColorEditor.class.php' => ['PhanPluginDuplicateAdjacentStatement', 'PhanPluginRedundantAssignment'], + 'htdocs/skincoloreditor/usercolors.php' => ['PhanDeprecatedFunction', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/stancer/admin/about.php' => ['PhanPluginDuplicateConditionalTernaryDuplication'], + 'htdocs/stancer/admin/setup.php' => ['PhanEmptyFQSENInClasslike', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanTypeExpectedObjectOrClassName', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredVariableDim'], + 'htdocs/stancer/class/actions_stancer.class.php' => ['PhanTypeMismatchArgumentInternal', 'PhanDeprecatedFunctionInternal', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginEmptyStatementForeachLoop', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeArraySuspiciousNull', 'PhanTypeMismatchArgument', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/stancer/core/modules/modStancer.class.php' => ['PhanPluginDuplicateAdjacentStatement', 'PhanPluginRedundantAssignment', 'PhanTypeMismatchArgument'], + 'htdocs/stancer/lib/stancer.lib.php' => ['PhanPluginMoreSpecificActualReturnType', 'PhanTypeInvalidUnaryOperandIncOrDec', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredVariable', 'PhanUndeclaredVariableDim', 'PhanUnreferencedUseNormal'], + 'htdocs/stancer/test/phpunit/functionnal/StancerFunctionalTest.php' => ['PhanEmptyProtectedMethod', 'PhanEmptyPublicMethod', 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginMoreSpecificActualReturnType', 'PhanPluginNotFullyQualifiedFunctionCall', 'PhanPluginPossiblyStaticProtectedMethod', 'PhanUndeclaredClassCatch', 'PhanUndeclaredExtendedClass', 'PhanUndeclaredMethod'], + 'htdocs/statistic/core/modules/modStat.class.php' => ['PhanPluginRedundantAssignment', 'PhanUndeclaredProperty'], + 'htdocs/statistic/core/modules/statistic/modules_statistic.php' => ['PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredClassProperty', 'PhanUndeclaredProperty', 'PhanUndeclaredThis', 'PhanUndeclaredTypeParameter', 'PhanUndeclaredVariable'], + 'htdocs/statistic/core/modules/statistic/pdf_statistic_test.modules.php' => ['PhanAccessMethodProtected', 'PhanAccessPropertyProtected', 'PhanCompatiblePHP8PHP4Constructor', 'PhanPluginUnreachableCode', 'PhanRedefinedClassReference', 'PhanTypeArraySuspicious', 'PhanTypeArraySuspiciousNullable', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredClassMethod', 'PhanUndeclaredClassProperty', 'PhanUndeclaredConstant', 'PhanUndeclaredFunction', 'PhanUndeclaredProperty', 'PhanUndeclaredTypeParameter', 'PhanUndeclaredVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/statistic/index.php' => ['PhanDeprecatedFunction', 'PhanPluginEmptyStatementIf', 'PhanUndeclaredClassMethod', 'PhanUndeclaredClassProperty'], + 'htdocs/statistic/stock.php' => ['PhanDeprecatedFunction', 'PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredClassMethod', 'PhanUndeclaredClassProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/submiteverywhere/admin/submiteverywheresetuppage.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/submiteverywhere/card.php' => ['PhanDeprecatedFunction', 'PhanParamTooFewInternal', 'PhanParamTooMany', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], + 'htdocs/submiteverywhere/class/SubmitewMessage.class.php' => ['PhanCompatiblePHP8PHP4Constructor', 'PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgument', 'PhanUndeclaredClassMethod', 'PhanUndeclaredClassProperty', 'PhanUndeclaredProperty'], + 'htdocs/submiteverywhere/core/lib/submiteverywhere.lib.php' => ['PhanPluginMoreSpecificActualReturnType'], + 'htdocs/submiteverywhere/core/modules/modSubmitEveryWhere.class.php' => ['PhanPluginRedundantAssignment', 'PhanUndeclaredProperty'], + 'htdocs/submiteverywhere/index.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPluginRedundantAssignmentInGlobalScope', 'PhanUndeclaredGlobalVariable'], + 'htdocs/submiteverywhere/list.php' => ['PhanPluginDuplicateConditionalTernaryDuplication', 'PhanUndeclaredGlobalVariable'], + 'htdocs/tawkto/admin/about.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/tawkto/admin/setup.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableDim'], + 'htdocs/tawkto/class/actions_tawkto.class.php' => ['PhanPluginDuplicateConditionalTernaryDuplication', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredProperty', 'PhanUndeclaredTypeReturnType'], + 'htdocs/tawkto/core/modules/modTawkTo.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/themespack/core/modules/modThemesPack.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/themespack/theme/bluelagoon/index.php' => ['PhanEmptyFile'], + 'htdocs/themespack/theme/bluelagoon/tpl/index.php' => ['PhanEmptyFile'], + 'htdocs/themespack/theme/freelug/style.css.php' => ['PhanPluginDuplicateConditionalUnnecessary', 'PhanUndeclaredGlobalVariable'], + 'htdocs/themespack/theme/yellow/style.css.php' => ['PhanPluginDuplicateConditionalUnnecessary', 'PhanUndeclaredGlobalVariable'], + 'htdocs/tvacerfa/admin/tvacerfa.php' => ['PhanDeprecatedFunction'], + 'htdocs/tvacerfa/core/modules/modTvaCerfa.class.php' => ['PhanPluginRedundantAssignment'], + 'htdocs/tvacerfa/quadri_detail.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateConditionalTernaryDuplication', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeComparisonFromArray', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeInvalidRightOperandOfNumericOp', 'PhanTypeInvalidUnaryOperandIncOrDec', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredFunction', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredVariableAssignOp'], + 'htdocs/webmailr/core/modules/modWebMailR.class.php' => ['PhanPluginRedundantAssignment', 'PhanTypeMismatchProperty'], + 'htdocs/zipautofillfr/admin/about.php' => ['PhanDeprecatedFunction', 'PhanUndeclaredVariableDim'], + 'htdocs/zipautofillfr/admin/zipautofillfr.php' => ['PhanDeprecatedFunction'], + 'htdocs/zipautofillfr/tools/fixcase.php' => ['PhanTypeMismatchArgument'], + ], + // 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed. + // (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases) +]; diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php new file mode 100644 index 000000000..2d4cb8130 --- /dev/null +++ b/dev/tools/phan/config.php @@ -0,0 +1,198 @@ + 6, + 'backward_compatibility_checks' => false, + 'simplify_ast'=>true, + 'analyzed_file_extensions' => ['php','inc'], + + // Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`, `'7.4'`, `null`. + // If this is set to `null`, + // then Phan assumes the PHP version which is closest to the minor version + // of the php executable used to execute Phan. + //"target_php_version" => null, + //"target_php_version" => '7.0', + //"target_php_version" => '7.4', + //"target_php_version" => '7.3', + //"target_php_version" => '5.6', + "target_php_version" => '8.2', + 'minimum-target-php-version'=>'7.0', + + // A list of directories that should be parsed for class and + // method information. After excluding the directories + // defined in exclude_analysis_directory_list, the remaining + // files will be statically analyzed for errors. + // + // Thus, both first-party and third-party code being used by + // your application should be included in this list. + 'directory_list' => [ + 'htdocs', + 'dev/tools/phan/stubs', + //'tests', + ], + + // A directory list that defines files that will be excluded + // from static analysis, but whose class and method + // information should be included. + // + // Generally, you'll want to include the directories for + // third-party code (such as "vendor/") in this list. + // + // n.b.: If you'd like to parse but not analyze 3rd + // party code, directories containing that code + // should be added to the `directory_list` as + // to `exclude_analysis_directory_list`. + "exclude_analysis_directory_list" => [ + 'dev/tools/phan/stubs', + 'htdocs/google/includes/google-api-php-client/vendor', + 'htdocs/facturxutil/includes', + 'htdocs/filemanager/includes', + 'htdocs/google/includes', + 'htdocs/netatmo/includes', + 'htdocs/numberwords/includes/Numbers', + 'htdocs/ovh/includes', + 'htdocs/phpsysinfo/includes/phpsysinfo', + 'htdocs/pibarcode/includes/barcode', + 'htdocs/tawkto/includes', + 'htdocs/webmailr/includes/roundcubemail', + ], + //'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@', + 'exclude_file_regex' => '@^(' + .'nonexisting' + .'|htdocs/google/includes/google-api-php-client/vendor/guzzlehttp/.*' + .')$@', + + + + // A list of plugin files to execute. + // Plugins which are bundled with Phan can be added here by providing their name + // (e.g. 'AlwaysReturnPlugin') + // + // Documentation about available bundled plugins can be found + // at https://github.com/phan/phan/tree/master/dev/tools/phan/plugins + // + // Alternately, you can pass in the full path to a PHP file + // with the plugin's implementation (e.g. 'vendor/phan/phan/dev/tools/phan/plugins/AlwaysReturnPlugin.php') + 'plugins' => [ + // checks if a function, closure or method unconditionally returns. + // can also be written as 'vendor/phan/phan/dev/tools/phan/plugins/AlwaysReturnPlugin.php' + 'DeprecateAliasPlugin', + 'EmptyMethodAndFunctionPlugin', + 'InvalidVariableIssetPlugin', + 'MoreSpecificElementTypePlugin', + 'NoAssertPlugin', + 'NotFullyQualifiedUsagePlugin', + 'PHPDocRedundantPlugin', + 'PHPUnitNotDeadCodePlugin', + 'PossiblyStaticMethodPlugin', + 'PreferNamespaceUsePlugin', + 'PrintfCheckerPlugin', + 'RedundantAssignmentPlugin', + // PhanPluginCanUseParamType : 1300+ occurrences + // PhanPluginComparisonNotStrictForScalar : 700+ occurrences + // PhanPluginCanUseReturnType : 680+ occurrences + // PhanPluginNumericalComparison : 470+ occurrences + // PhanPluginNonBoolInLogicalArith : 290+ occurrences + // PhanPluginPossiblyStaticClosure : 270+ occurrences + // PhanPluginPossiblyStaticPublicMethod : 230+ occurrences + // PhanPluginSuspiciousParamPosition : 150+ occurrences + // PhanPluginCanUseNullableParamType : 140+ occurrences + // PhanPluginCanUsePHP71Void : 130+ occurrences + // PhanPluginInlineHTML : 100+ occurrences + // PhanPluginPossiblyStaticPrivateMethod : 100+ occurrences + // PhanPluginCanUseNullableReturnType : 90+ occurrences + // PhanPluginInlineHTMLTrailing : 65+ occurrences + +/* Could be enabled for new code. + 'ConstantVariablePlugin', // Warns about values that are actually constant + 'HasPHPDocPlugin', // Requires PHPDoc + 'InlineHTMLPlugin', // html in PHP file, or at end of file + 'NonBoolBranchPlugin', // Requires test on bool, nont on ints + 'NonBoolInLogicalArithPlugin', + 'NumericalComparisonPlugin', + 'PHPDocToRealTypesPlugin', + 'ShortArrayPlugin', // Checks that [] is used + 'StrictLiteralComparisonPlugin', + 'UnknownClassElementAccessPlugin', + 'UnknownElementTypePlugin', + 'WhitespacePlugin', +/**/ + 'PHPDocInWrongCommentPlugin', // Missing /** (/* was used) + //'RemoveDebugStatementPlugin', // Reports echo, print, ... + 'SimplifyExpressionPlugin', + //'StrictComparisonPlugin', // Expects === + //'SuspiciousParamOrderPlugin', // reports function calls for parameters, not clear + 'UnsafeCodePlugin', + //'UnusedSuppressionPlugin', + + 'AlwaysReturnPlugin', + //'DollarDollarPlugin', + 'DuplicateArrayKeyPlugin', + 'DuplicateExpressionPlugin', + 'PregRegexCheckerPlugin', + 'PrintfCheckerPlugin', + 'SleepCheckerPlugin', + // Checks for syntactically unreachable statements in + // the global scope or function bodies. + 'UnreachableCodePlugin', + 'UseReturnValuePlugin', + 'EmptyStatementListPlugin', + 'LoopVariableReusePlugin', + ], + + // Add any issue types (such as 'PhanUndeclaredMethod') + // here to inhibit them from being reported + 'suppress_issue_types' => [ + 'PhanTypeMismatchReturnSuperType', // Newly introduced in phan many occurences. + //'PhanUndeclaredThis', + 'PhanPluginMixedKeyNoKey', + 'PhanPluginDuplicateConditionalNullCoalescing', // Suggests to optimize to ?? + //'PhanUnreferencedClosure', // False positives seen with closures in arrays, TODO: move closure checks closer to what is done by unused variable plugin + //'PhanPluginNoCommentOnProtectedMethod', + //'PhanPluginDescriptionlessCommentOnProtectedMethod', + //'PhanPluginNoCommentOnPrivateMethod', + //'PhanPluginDescriptionlessCommentOnPrivateMethod', + //'PhanPluginDescriptionlessCommentOnPrivateProperty', + // TODO: Fix edge cases in --automatic-fix for PhanPluginRedundantClosureComment + //'PhanPluginRedundantClosureComment', + 'PhanPluginPossiblyStaticPublicMethod', + //'PhanPluginPossiblyStaticProtectedMethod', + + // The types of ast\Node->children are all possibly unset. + 'PhanTypePossiblyInvalidDimOffset', // Also checks optional array keys and requires that they are checked for existance. + ], + // You can put relative paths to internal stubs in this config option. + // Phan will continue using its detailed type annotations, + // but load the constants, classes, functions, and classes (and their Reflection types) + // from these stub files (doubling as valid php files). + // Use a different extension from php (and preferably a separate folder) + // to avoid accidentally parsing these as PHP (includes projects depending on this). + // The 'mkstubs' script can be used to generate your own stubs (compatible with php 7.0+ right now) + // Note: The array key must be the same as the extension name reported by `php -m`, + // so that phan can skip loading the stubs if the extension is actually available. + 'autoload_internal_extension_signatures' => [ + // Xdebug stubs are bundled with Phan 0.10.1+/0.8.9+ for usage, + // because Phan disables xdebug by default. + //'xdebug' => 'vendor/phan/phan/dev/tools/phan/internal_stubs/xdebug.phan_php', + //'memcached' => 'dev/tools/phan/your_internal_stubs_folder_name/memcached.phan_php', + 'curl' => 'dev/tools/phan/stubs/curl.phan_php', + 'gd' => 'dev/tools/phan/stubs/gd.phan_php', + 'intl' => 'dev/tools/phan/stubs/intl.phan_php', + 'mcrypt' => 'dev/tools/phan/stubs/mcrypt.phan_php', + 'soap' => 'dev/tools/phan/stubs/soap.phan_php', + 'pdo_mysql' => 'dev/tools/phan/stubs/pdo_mysql.phan_php', + 'PDO' => 'dev/tools/phan/stubs/PDO.phan_php', + 'zip' => 'dev/tools/phan/stubs/zip.phan_php', + 'SimpleXML' => 'dev/tools/phan/stubs/SimpleXML.phan_php', + ], +]; diff --git a/dev/tools/phan/stubs/Core.phan_php b/dev/tools/phan/stubs/Core.phan_php new file mode 100644 index 000000000..d2f722d17 --- /dev/null +++ b/dev/tools/phan/stubs/Core.phan_php @@ -0,0 +1,333 @@ + Sum debit credit per account + */ + public $sdcperaccount; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create object into database + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id object + * @param string $code Code + * @param string $label Label + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $code = '', $label = '') + { + } + /** + * Update object into database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Function to select into ->lines_display all accounting accounts for a given custom accounting group + * + * @param int $id Id + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function display($id) + { + } + /** + * Function to fill ->lines_cptbk with accounting account (defined in chart of account) and not yet into a custom group + * + * @param int $id Id of category to know which account to exclude + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function getAccountsWithNoCategory($id) + { + } + /** + * Function to add an accounting account in an accounting category + * + * @param int $id_cat Id category + * @param array $cpts list of accounts array + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function updateAccAcc($id_cat, $cpts = array()) + { + } + /** + * Function to delete an accounting account from an accounting category + * + * @param int $cpt_id Id of accounting account + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function deleteCptCat($cpt_id) + { + } + /** + * Function to show result of an accounting account from the ledger with a direction and a period + * + * @param int|array $cpt Accounting account or array of accounting account + * @param string $date_start Date start + * @param string $date_end Date end + * @param int<0,1> $sens Sens of the account: 0: credit - debit (use this by default), 1: debit - credit + * @param string $thirdparty_code Third party code + * @param int $month Specific month - Can be empty + * @param int $year Specific year - Can be empty + * @return integer Return integer <0 if KO, >= 0 if OK + */ + public function getSumDebitCredit($cpt, $date_start, $date_end, $sens, $thirdparty_code = 'nofilter', $month = 0, $year = 0) + { + } + /** + * Function to get an array of all active custom groups (llx_c_accunting_categories) with their accounts from the chart of account (ll_accounting_acount) + * + * @param int $catid Custom group ID + * @return array>|int<-1,-1> Result in table (array), -1 if KO + * @see getCats(), getCptsCat() + */ + public function getCatsCpts($catid = 0) + { + } + /** + * Return list of custom groups. + * For list + detail of accounting account, see getCatsCpt() + * + * @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups + * @param int $active 1= active, 0=not active + * @return array|int Array of groups or -1 if error + * @see getCatsCpts(), getCptsCat() + */ + public function getCats($categorytype = -1, $active = 1) + { + } + /** + * Get all accounting account of a given custom group (or a list of custom groups). + * You must choose between first parameter (personalized group) or the second (free criteria filter) + * + * @param int $cat_id Id if personalized accounting group/category + * @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts. This value must be sanitized and not come from an input of a user. + * Example: "pcg_type = 'EXPENSE' AND fk_pcg_version = 'xx'" + * Example: "fk_accounting_category = 99" + * @return array|int<-1,-1> Array of accounting accounts or -1 if error + * @see getCats(), getCatsCpts() + */ + public function getCptsCat($cat_id, $predefinedgroupwhere = '') + { + } + } + /** + * Manage the different format accountancy export + */ + class AccountancyExport + { + // Types of export. + /** @var int */ + public static $EXPORT_TYPE_CONFIGURABLE = 1; + // CSV + /** @var int */ + public static $EXPORT_TYPE_AGIRIS = 10; + /** @var int */ + public static $EXPORT_TYPE_EBP = 15; + /** @var int */ + public static $EXPORT_TYPE_CEGID = 20; + /** @var int */ + public static $EXPORT_TYPE_COGILOG = 25; + /** @var int */ + public static $EXPORT_TYPE_COALA = 30; + /** @var int */ + public static $EXPORT_TYPE_BOB50 = 35; + /** @var int */ + public static $EXPORT_TYPE_CIEL = 40; + /** @var int */ + public static $EXPORT_TYPE_SAGE50_SWISS = 45; + /** @var int */ + public static $EXPORT_TYPE_CHARLEMAGNE = 50; + /** @var int */ + public static $EXPORT_TYPE_QUADRATUS = 60; + /** @var int */ + public static $EXPORT_TYPE_WINFIC = 70; + /** @var int */ + public static $EXPORT_TYPE_OPENCONCERTO = 100; + /** @var int */ + public static $EXPORT_TYPE_LDCOMPTA = 110; + /** @var int */ + public static $EXPORT_TYPE_LDCOMPTA10 = 120; + /** @var int */ + public static $EXPORT_TYPE_GESTIMUMV3 = 130; + /** @var int */ + public static $EXPORT_TYPE_GESTIMUMV5 = 135; + /** @var int */ + public static $EXPORT_TYPE_ISUITEEXPERT = 200; + // Generic FEC after that + /** @var int */ + public static $EXPORT_TYPE_FEC = 1000; + /** @var int */ + public static $EXPORT_TYPE_FEC2 = 1010; + /** + * @var DoliDB Database handler + */ + public $db; + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + /** + * @var string Separator + */ + public $separator = ''; + /** + * @var string End of line + */ + public $end_line = ''; + /** + * @var array{downloadFilePath:string,downloadFileMimeType:string,downloadFileFullName:string}|array{} Generated file + */ + public $generatedfiledata = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Array with all export type available (key + label) + * + * @param int<0,1> $mode Mode of list: 0=flat list, 1=rich list + * @return array|array array of type + */ + public function getType($mode = 0) + { + } + /** + * Return string to summarize the format (Used to generated export filename) + * + * @param int $type Format id + * @return string Format code + */ + public static function getFormatCode($type) + { + } + /** + * Array with all export types available (key + label) and parameters for config + * + * @return array{param:array>,cr:array,format:array} of type + */ + public function getTypeConfig() + { + } + /** + * Return the MIME type of a file + * + * @param int $formatexportset Id of export format + * @return string MIME type. + */ + public function getMimeType($formatexportset) + { + } + /** + * Function who chose which export to use with the default config, and make the export into a file + * + * @param BookKeepingLine[] $TData Array with data + * @param int $formatexportset Id of export format + * @param int<0,1> $withAttachment [=0] Not add files + * or 1 to have attached in an archive (ex : Quadratus) - Force output mode to write in a file (output mode = 1) + * @param int<1,1> $downloadMode [=0] Direct download. Deprecated. Always use value 1. + * or 1 to download after writing files - Forced by default when use withAttachment = 1 + * or -1 not to download files + * @param int<1,1> $outputMode [=0] Print on screen. Deprecated. Always use value 1. + * or 1 to write in file and uses the temp directory - Forced by default when use withAttachment = 1 + * or 2 to write in file a default export directory (accounting/export/) + * @param int<1,1> $noouput 0=old mode. Deprecated. Always use value 1. + * or 1=Do not output the file on stdout with this method. This must always be done by the main page, never by a method. + * @return int Return integer <0 if KO, >0 OK. The property ->generatedfile is also filled. + */ + public function export(&$TData, $formatexportset, $withAttachment = 0, $downloadMode = 1, $outputMode = 1, $noouput = 1) + { + } + /** + * Export format : CEGID + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportCegid($objectLines, $exportFile = \null) + { + } + /** + * Export format : COGILOG + * Last review for this format : 2022-07-12 Alexandre Spangaro (aspangaro@open-dsi.fr) + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportCogilog($objectLines, $exportFile = \null) + { + } + /** + * Export format : COALA + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportCoala($objectLines, $exportFile = \null) + { + } + /** + * Export format : BOB50 + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportBob50($objectLines, $exportFile = \null) + { + } + /** + * Export format : CIEL (Format XIMPORT) + * Format since 2003 compatible CIEL version > 2002 / Sage50 + * Last review for this format : 2021-09-13 Alexandre Spangaro (aspangaro@open-dsi.fr) + * + * Help : https://sage50c.online-help.sage.fr/aide-technique/ + * In sage software | Use menu : "Exchange" > "Importing entries..." + * + * If you want to force filename to "XIMPORT.TXT" for automatically import file present in a directory : + * use constant ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportCiel($objectLines, $exportFile = \null) + { + } + /** + * Export format : Quadratus (Format ASCII) + * Format since 2015 compatible QuadraCOMPTA + * Last review for this format : 2023/10/12 Alexandre Spangaro (aspangaro@open-dsi.fr) + * + * Information on format: https://docplayer.fr/20769649-Fichier-d-entree-ascii-dans-quadracompta.html + * Help to import in Quadra: https://wiki.dolibarr.org/index.php?title=Module_Comptabilit%C3%A9_en_Partie_Double#Import_vers_CEGID_Quadra + * In QuadraCompta | Use menu : "Outils" > "Suivi des dossiers" > "Import ASCII(Compta)" + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @param array $archiveFileList [=array()] Archive file list : array of ['path', 'name'] + * @param int<0,1> $withAttachment [=0] Not add files or 1 to have attached in an archive + * @return array Archive file list : array of ['path', 'name'] + */ + public function exportQuadratus($objectLines, $exportFile = \null, $archiveFileList = array(), $withAttachment = 0) + { + } + /** + * Export format : WinFic - eWinfic - WinSis Compta + * Last review for this format : 2022-11-01 Alexandre Spangaro (aspangaro@open-dsi.fr) + * + * Help : https://wiki.gestan.fr/lib/exe/fetch.php?media=wiki:v15:compta:accountancy-format_winfic-ewinfic-winsiscompta.pdf + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportWinfic($objectLines, $exportFile = \null) + { + } + /** + * Export format : EBP + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportEbp($objectLines, $exportFile = \null) + { + } + /** + * Export format : Agiris Isacompta + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportAgiris($objectLines, $exportFile = \null) + { + } + /** + * Export format : OpenConcerto + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportOpenConcerto($objectLines, $exportFile = \null) + { + } + /** + * Export format : Configurable CSV + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportConfigurable($objectLines, $exportFile = \null) + { + } + /** + * Export format : FEC + * Last review for this format : 2023/10/12 Alexandre Spangaro (aspangaro@open-dsi.fr) + * + * Help to import in your software: https://wiki.dolibarr.org/index.php?title=Module_Comptabilit%C3%A9_en_Partie_Double#Exports_avec_fichiers_sources + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @param array $archiveFileList [=array()] Archive file list : array of ['path', 'name'] + * @param int<0,1> $withAttachment [=0] Not add files or 1 to have attached in an archive + * @return array Archive file list : array of ['path', 'name'] + */ + public function exportFEC($objectLines, $exportFile = \null, $archiveFileList = array(), $withAttachment = 0) + { + } + /** + * Export format : FEC2 + * Last review for this format : 2023/10/12 Alexandre Spangaro (aspangaro@open-dsi.fr) + * + * Help to import in your software: https://wiki.dolibarr.org/index.php?title=Module_Comptabilit%C3%A9_en_Partie_Double#Exports_avec_fichiers_sources + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @param array $archiveFileList [=array()] Archive file list : array of ['path', 'name'] + * @param int<0,1> $withAttachment [=0] Not add files or 1 to have attached in an archive + * @return array Archive file list : array of ['path', 'name'] + */ + public function exportFEC2($objectLines, $exportFile = \null, $archiveFileList = array(), $withAttachment = 0) + { + } + /** + * Export format : SAGE50SWISS + * + * https://onlinehelp.sageschweiz.ch/default.aspx?tabid=19984 + * http://media.topal.ch/Public/Schnittstellen/TAF/Specification/Sage50-TAF-format.pdf + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportSAGE50SWISS($objectLines, $exportFile = \null) + { + } + /** + * Export format : LD Compta version 9 + * http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW9.pdf + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportLDCompta($objectLines, $exportFile = \null) + { + } + /** + * Export format : LD Compta version 10 & higher + * Last review for this format : 08-15-2021 Alexandre Spangaro (aspangaro@open-dsi.fr) + * + * Help : http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportLDCompta10($objectLines, $exportFile = \null) + { + } + /** + * Export format : Charlemagne + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportCharlemagne($objectLines, $exportFile = \null) + { + } + /** + * Export format : Gestimum V3 + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportGestimumV3($objectLines, $exportFile = \null) + { + } + /** + * Export format : Gestimum V5 + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportGestimumV5($objectLines, $exportFile = \null) + { + } + /** + * Export format : iSuite Expert + * + * by OpenSolus [https://opensolus.fr] + * + * @param BookKeepingLine[] $objectLines data + * @param ?resource $exportFile [=null] File resource to export or print if null + * @return void + */ + public function exportiSuiteExpert($objectLines, $exportFile = \null) + { + } + /** + * trunc + * + * @param string $str String + * @param integer $size Data to trunc + * @return string + */ + public static function trunc($str, $size) + { + } + /** + * toAnsi + * + * @param string $str Original string to encode and optionally truncate + * @param integer $size Truncate string after $size characters + * @return string String encoded in Windows-1251 charset + */ + public static function toAnsi($str, $size = -1) + { + } + } + /* + * Copyright (C) 2007-2012 Laurent Destailleur + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Florian Henry + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2016 Pierre-Henry Favre + * Copyright (C) 2016-2020 Alexandre Spangaro + * Copyright (C) 2013-2017 Olivier Geffroy + * Copyright (C) 2017 Elarifr. Ari Elbaz + * Copyright (C) 2017-2019 Frédéric France + * Copyright (C) 2017 André Schild + * Copyright (C) 2020 Guillaume Alexandre + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/accountancy/class/accountancyimport.class.php + * \ingroup Accountancy (Double entries) + * \brief Class with methods for accountancy import + */ + /** + * Manage the different format accountancy import + */ + class AccountancyImport + { + /** + * @var DoliDB Database handler + */ + public $db; + /** + * @var string[] Array of error strings + */ + public $errors = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Clean amount + * + * @param array}> $arrayrecord Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]... + * @param array $listfields Fields list to add + * @param int $record_key Record key + * @return float Value + */ + public function cleanAmount(&$arrayrecord, $listfields, $record_key) + { + } + /** + * Clean value with trim + * + * @param array}> $arrayrecord Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]... + * @param array $listfields Fields list to add + * @param int $record_key Record key + * @return mixed Value + */ + public function cleanValue(&$arrayrecord, $listfields, $record_key) + { + } + /** + * Compute amount + * + * @param array}> $arrayrecord Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]... + * @param array $listfields Fields list to add + * @param int $record_key Record key + * @return string Value + */ + public function computeAmount(&$arrayrecord, $listfields, $record_key) + { + } + /** + * Compute direction + * + * @param array}> $arrayrecord Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]... + * @param array $listfields Fields list to add + * @param int $record_key Record key + * @return string Value + */ + public function computeDirection(&$arrayrecord, $listfields, $record_key) + { + } + /** + * Compute piece number + * + * @param array}> $arrayrecord Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]... + * @param array $listfields Fields list to add + * @param int $record_key Record key + * @return string Value + */ + public function computePieceNum(&$arrayrecord, $listfields, $record_key) + { + } + } + /* Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2023 Frédéric France + * + * 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 . + */ + /** + * \file htdocs/accountancy/class/accountancysystem.class.php + * \ingroup Accountancy (Double entries) + * \brief File of class to manage accountancy systems + */ + /** + * Class to manage accountancy systems + */ + class AccountancySystem + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Array of Errors code (or messages) + */ + public $errors = array(); + /** + * @var int ID + */ + public $id; + /** + * @var int ID + * @deprecated + * @see $id + */ + public $rowid; + /** + * @var int ID + */ + public $fk_pcg_version; + /** + * @var int pcg version + */ + public $pcg_version; + /** + * @var string ref + */ + public $ref; + /** + * @var int active + */ + public $active; + /** + * @var string pcg type + */ + public $pcg_type; + /** + * @var string Accountancy System numero + */ + public $numero; + /** + * @var string Accountancy System label + */ + public $label; + /** + * @var string account number + */ + public $account_number; + /** + * @var string account parent + */ + public $account_parent; + /** + * Constructor + * + * @param DoliDB $db handler + */ + public function __construct($db) + { + } + /** + * Load record in memory + * + * @param int $rowid Id + * @param string $ref ref + * @return int Return integer <0 if KO, Id of record if OK and found + */ + public function fetch($rowid = 0, $ref = '') + { + } + /** + * Insert accountancy system name into database + * + * @param User $user making insert + * @return int if KO, Id of line if OK + */ + public function create($user) + { + } + } + /* Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * @file DeprecationHandler.php + * @ingroup core + * @brief trait for handling deprecated properties and methods + */ + /** + * Class for handling deprecated properties and methods + */ + trait DolDeprecationHandler + { + // Define the following in the class using the trait + // to allow properties to not be defined when referenced. + // So only deprecated value generate exceptions. + // + // protected $enableDynamicProperties = true; + // Define the following in the class using the trait + // to disallow Dolibarr deprecation warnings. + // + // protected $enableDeprecatedReporting = false; + /** + * Get deprecated property + * + * @param string $name Name of property + * @return mixed Value for replacement property + */ + public function __get($name) + { + } + /** + * Set deprecated property + * + * @param string $name Name of property + * @param mixed $value Value of property + * @return void + */ + public function __set($name, $value) + { + } + /** + * Unset deprecated property + * + * @param string $name Name of property + * @return void + */ + public function __unset($name) + { + } + /** + * Test if deprecated property is set + * + * @param string $name Name of property + * @return void + */ + public function __isset($name) + { + } + /** + * Call deprecated method + * + * @param string $name Name of method + * @param mixed[] $arguments Method arguments + * @return mixed + */ + public function __call($name, $arguments) + { + } + /** + * Indicate if deprecations should be reported. Depends on ->enableDeprecatedReporting. If not set, depends on PHP setup. + * + * @return bool + */ + private function isDeprecatedReportingEnabled() + { + } + /** + * Indicate if dynamic properties are accepted + * + * @return bool + */ + private function isDynamicPropertiesEnabled() + { + } + /** + * Provide list of deprecated properties + * + * Override this method in subclasses + * + * @return array Mapping of deprecated properties + */ + protected function deprecatedProperties() + { + } + /** + * Provide list of deprecated methods + * + * Override this method in subclasses + * + * @return array Mapping of deprecated methods + */ + protected function deprecatedMethods() + { + } + /** + * Get caller info + * + * @return string + */ + protected static final function getCallerInfoString() + { + } + } + /** + * Parent class of all other business classes (invoices, contracts, proposals, orders, ...) + * + * @phan-forbid-undeclared-magic-properties + */ + abstract class CommonObject + { + use \DolDeprecationHandler; + const TRIGGER_PREFIX = ''; + // to be overridden in child class implementations, i.e. 'BILL', 'TASK', 'PROPAL', etc. + /** + * @var string ID of module. + */ + public $module; + /** + * @var DoliDB Database handler (result of a new DoliDB) + */ + public $db; + /** + * @var int The object identifier + */ + public $id; + /** + * @var int The environment ID when using a multicompany module + */ + public $entity; + /** + * @var string Error string + * @see $errors + */ + public $error; + /** + * @var string Error string that is hidden but can be used to store additional technical code + */ + public $errorhidden; + /** + * @var string[] Array of error strings + */ + public $errors = array(); + /** + * @var string ID to identify managed object + */ + public $element; + /** + * @var string|int Field with ID of parent key if this field has a parent (a string). For example 'fk_product'. + * ID of parent key itself (an int). For example in few classes like 'Comment', 'ActionComm' or 'AdvanceTargetingMailing'. + */ + public $fk_element; + /** + * @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea(). + * Undefined means same value than $element. + * Can be use to force a check on another element (for example for class of a line, we mention here its parent element). + */ + public $element_for_permission; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; + /** + * @var string Name of subtable line + */ + public $table_element_line = ''; + /** + * @var int<0,1>|string Does this object support multicompany module ? + * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table (example 'fk_soc@societe') + */ + public $ismultientitymanaged; + /** + * @var string Key value used to track if data is coming from import wizard + */ + public $import_key; + /** + * @var array Contains data to manage extrafields + */ + public $array_options = array(); + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array(); + /** + * @var array> Array to store alternative languages values of object + * + * Note: call fetchValuesForExtraLanguages() before using this + */ + public $array_languages = \null; + // Value is array() when load already tried + /** + * @var array To store result of ->liste_contact() + */ + public $contacts_ids; + /** + * @var mixed Array of linked objects, set and used when calling ->create() to be able to create links during the creation of object + */ + public $linked_objects; + /** + * @var int[][] Array of linked objects ids. Loaded by ->fetchObjectLinked + */ + public $linkedObjectsIds; + /** + * @var array Array of linked objects. Loaded by ->fetchObjectLinked, key = object type + */ + public $linkedObjects; + /** + * @var ?static To store a cloned copy of the object before editing it (to keep track of its former properties) + */ + public $oldcopy; + /** + * @var string To store the old value of a modified reference + */ + public $oldref; + /** + * @var string Column name of the ref field. + */ + protected $table_ref_field = ''; + /** + * @var integer 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user + */ + public $restrictiononfksoc = 0; + // The following vars are used by some objects only. + // We keep these properties in CommonObject in order to provide common methods using them. + /** + * @var array Can be used to pass information when only the object is provided to the method + */ + public $context = array(); + /** + * @var string Properties set and used by Agenda trigger + */ + public $actionmsg; + /** + * @var string Properties set and used by Agenda trigger + */ + public $actionmsg2; + /** + * @var string Contains canvas name if record is an alternative canvas record + */ + public $canvas; + /** + * @var Project|null The related project object + * @see fetch_projet() + */ + public $project; + /** + * @var int The related project ID + * @see setProject(), project + */ + public $fk_project; + /** + * @var int + * @deprecated Use $fk_project instead. + * @see $fk_project + */ + public $fk_projet; + /** + * @var Contact|null A related contact object + * @see fetch_contact() + */ + public $contact; + /** + * @var int The related contact ID + * @see fetch_contact() + */ + public $contact_id; + /** + * @var Societe|null A related thirdparty object + * @see fetch_thirdparty() + */ + public $thirdparty; + /** + * @var User A related user + * @see fetch_user() + */ + public $user; + /** + * @var string The type of originating object. Combined with $origin_id, it allows to reload $origin_object + * @see fetch_origin() + */ + public $origin_type; + /** + * @var int The id of originating object. Combined with $origin_type, it allows to reload $origin_object + * @see fetch_origin() + */ + public $origin_id; + /** + * @var ?CommonObject Origin object. This is set by fetch_origin() from this->origin_type and this->origin_id. + */ + public $origin_object; + /** + * @var CommonObject|string|null Sometimes the type of the originating object ('commande', 'facture', ...), sometimes the object (as with MouvementStock) + * @deprecated Use $origin_type and $origin_id instead. + * @see fetch_origin() + */ + public $origin; + /** + * @var string The object's reference + */ + public $ref; + /** + * @var string An external reference to the object + */ + public $ref_ext; + /** + * @var string The object's previous reference + */ + public $ref_previous; + /** + * @var string The object's next reference + */ + public $ref_next; + /** + * @var string Ref to store on object to save the new ref to use for example when making a validate() of an object + */ + public $newref; + /** + * @var int|array The object's status. Use status instead. + * @deprecated Use $status instead. + * @see $status + * @see setStatut(), $status + */ + public $statut; + /** + * @var int|array The object's status (an int). + * Or an array listing all the potential status of the object: + * array: int of the status => translated label of the status + * See for example the Account class. + * @see setStatut() + */ + public $status; + /** + * @var string Country name + * @see getFullAddress() + */ + public $country; + /** + * @var int Country ID + * @see getFullAddress(), country + */ + public $country_id; + /** + * @var string ISO country code on 2 chars + * @see getFullAddress(), isInEEC(), country + */ + public $country_code; + /** + * @var string State name + * @see getFullAddress() + */ + public $state; + /** + * @var int State ID + * @see getFullAddress(), state + */ + public $state_id; + /** + * @var int State ID + * @deprecated Use $state_id. We can remove this property when the field 'fk_departement' have been renamed into 'state_id' in all tables + */ + public $fk_departement; + /** + * @var string State code + * @see getFullAddress(), $state + */ + public $state_code; + /** + * @var int Region ID + * @see getFullAddress(), $region_code, $region + */ + public $region_id; + /** + * @var string Region code + * @see getFullAddress(), $region_id, $region + */ + public $region_code; + /** + * @var string Region name + * @see getFullAddress(), $region_id, $region_code + */ + public $region; + /** + * @var int Barcode type + * @see fetch_barcode() + */ + public $barcode_type; + /** + * @var string Code of the barcode type + * @see fetch_barcode(), barcode_type + */ + public $barcode_type_code; + /** + * @var string Label of the barcode type + * @see fetch_barcode(), barcode_type + */ + public $barcode_type_label; + /** + * @var string + * @see fetch_barcode(), barcode_type + */ + public $barcode_type_coder; + /** + * @var int Payment method ID (cheque, cash, ...) + * @see setPaymentMethods() + */ + public $mode_reglement_id; + /** + * @var int Payment terms ID + * @see setPaymentTerms() + */ + public $cond_reglement_id; + /** + * @var int Demand reason ID + */ + public $demand_reason_id; + /** + * @var int Transport mode ID (For module intracomm report) + * @see setTransportMode() + */ + public $transport_mode_id; + // Private to call DolDeprecationHandler + /** + * @var int|string Internal to detect deprecated access + */ + protected $depr_cond_reglement; + // Internal value for deprecation + /** + * @var int Delivery address ID + * @see setDeliveryAddress() + * @deprecated + */ + public $fk_delivery_address; + /** + * @var int Shipping method ID + * @see setShippingMethod() + */ + public $shipping_method_id; + /** + * @var string Shipping method label + * @see setShippingMethod() + */ + public $shipping_method; + // Multicurrency + /** + * @var int ID + */ + public $fk_multicurrency; + /** + * @var string|string[] Multicurrency code + * Or, just for the Paiement object, an array: invoice ID => currency code for that invoice. + */ + public $multicurrency_code; + /** + * @var float|float[] Multicurrency rate ("tx" = "taux" in French) + * Or, just for the Paiement object, an array: invoice ID => currency rate for that invoice. + */ + public $multicurrency_tx; + /** + * @var float Multicurrency total amount excluding taxes (HT = "Hors Taxe" in French) + */ + public $multicurrency_total_ht; + /** + * @var float Multicurrency total VAT amount (TVA = "Taxe sur la Valeur Ajoutée" in French) + */ + public $multicurrency_total_tva; + /** + * @var float Multicurrency total amount including taxes (TTC = "Toutes Taxes Comprises" in French) + */ + public $multicurrency_total_ttc; + /** + * @var float Multicurrency total localta1 + */ + public $multicurrency_total_localtax1; + // not in database + /** + * @var float Multicurrency total localtax2 + */ + public $multicurrency_total_localtax2; + // not in database + /** + * @var string + * @see SetDocModel() + */ + public $model_pdf; + /** + * @var string + * Contains relative path of last generated main file + */ + public $last_main_doc; + /** + * @var int Bank account ID sometimes, ID of record into llx_bank sometimes + * @deprecated + * @see $fk_account + */ + public $fk_bank; + /** + * @var int Bank account ID + * @see SetBankAccount() + */ + public $fk_account; + /** + * @var string Public note + * @see update_note() + */ + public $note_public; + /** + * @var string Private note + * @see update_note() + */ + public $note_private; + /** + * @var string + * @deprecated Use $note_private instead. + * @see $note_private + */ + public $note; + /** + * @var float Total amount excluding taxes (HT = "Hors Taxe" in French) + * @see update_price() + */ + public $total_ht; + /** + * @var float Total VAT amount (TVA = "Taxe sur la Valeur Ajoutée" in French) + * @see update_price() + */ + public $total_tva; + /** + * @var float Total local tax 1 amount + * @see update_price() + */ + public $total_localtax1; + /** + * @var float Total local tax 2 amount + * @see update_price() + */ + public $total_localtax2; + /** + * @var float Total amount including taxes (TTC = "Toutes Taxes Comprises" in French) + * @see update_price() + */ + public $total_ttc; + /** + * @var CommonObjectLine[]|CommonObject[]|stdClass[] + */ + public $lines; + /** + * @var string Action type code to use to record auto event in agenda. For example 'AC_OTH_AUTO' + */ + public $actiontypecode; + /** + * @var mixed Comments + * @see fetchComments() + */ + public $comments = array(); + /** + * @var string The name + */ + public $name; + /** + * @var string The lastname + */ + public $lastname; + /** + * @var string The firstname + */ + public $firstname; + /** + * @var string The civility code, not an integer + */ + public $civility_id; + // Dates + /** + * @var integer|''|null Object creation date + */ + public $date_creation; + /** + * @var integer|''|null Object last validation date + */ + public $date_validation; + /** + * @var integer|''|null Object last modification date + */ + public $date_modification; + /** + * Update timestamp record (tms) + * @var integer + * @deprecated Use $date_modification + */ + public $tms; + /** + * @var integer|''|null Object closing date + */ + public $date_cloture; + /** + * @var User User author/creation + * @deprecated Store only id in user_creation_id + */ + public $user_author; + /** + * @var User User author/creation + * @deprecated + */ + public $user_creation; + /** + * @var int User id author/creation + */ + public $user_creation_id; + /** + * @var User User of validation + * @deprecated + */ + public $user_valid; + /** + * @var User User of validation + * @deprecated + */ + public $user_validation; + /** + * @var int|null User id of validation + */ + public $user_validation_id; + /** + * @var int User id closing object + */ + public $user_closing_id; + /** + * @var User User last modifier + * @deprecated + */ + public $user_modification; + /** + * @var int User ID who last modified the object + */ + public $user_modification_id; + /** + * @var int ID + * @deprecated Use $user_creation_id + */ + public $fk_user_creat; + /** + * @var int ID + * @deprecated Use $user_modification_id + */ + public $fk_user_modif; + /** + * @var string XX + */ + public $next_prev_filter; + /** + * @var int<0,1> 1 if object is specimen + */ + public $specimen = 0; + /** + * @var int[] Id of contacts to send objects (mails, etc.) + */ + public $sendtoid; + /** + * @var float Amount already paid from getSommePaiement() (used to show correct status) + */ + public $totalpaid; + /** + * @var array Array with labels of status + */ + public $labelStatus = array(); + /** + * @var array Array with short labels of status + */ + public $labelStatusShort = array(); + /** + * @var array Array to store lists of tpl + */ + public $tpl; + /** + * @var int show photo on popup + */ + public $showphoto_on_popup; + /** + * @var array{actionscomm?:int,banklines?:int,cheques?:int,contacts?:int,contracts?:int,customers?:int,dolresource?:int,donations?:int,expensereports?:int,holidays?:int,interventions?:int,invoices?:int,members?:int,orders?:int,products?:int,projects?:int,proposals?:int,prospects?:int,services?:int,supplier_invoices?:int,supplier_orders?:int,supplier_proposals?:int,suppliers?:int,tasks?:int,ticket?:int,users?:int} nb used in load_stateboard + */ + public $nb = array(); + /** + * @var int used for the return of show_photos() + */ + public $nbphoto; + /** + * @var string output content. Used topropagate information by cron jobs. + */ + public $output; + /** + * @var array|string extra parameters. Try to store here the array of parameters. Old code is sometimes storing a string. + */ + public $extraparams = array(); + /** + * @var string[]|array List of child tables. To test if we can delete object. + */ + protected $childtables = array(); + /** + * @var string[] List of child tables. To know object to delete on cascade. + * If name is like '@ClassName:FilePathClass:ParentFkFieldName', it will + * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object. + */ + protected $childtablesoncascade = array(); + /** + * @var Product Populated by fetch_product() + */ + public $product; + /** + * @var int Populated by setPaymentTerms() + */ + public $cond_reglement_supplier_id; + /** + * @var float|string Deposit percent for payment terms. + * Populated by setPaymentTerms(). + * @see setPaymentTerms() + */ + public $deposit_percent; + /** + * @var int Populated by setRetainedWarrantyPaymentTerms() + */ + public $retained_warranty_fk_cond_reglement; + /** + * @var int Populated by setWarehouse() + */ + public $warehouse_id; + /** + * @var int<0,1> Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 0; + // No constructor as it is an abstract class + /** + * Provide list of deprecated properties and replacements + * + * @return array + */ + protected function deprecatedProperties() + { + } + /** + * Check if an object id or ref exists + * If you don't need or want to instantiate the object and just need to know if the object exists, use this method instead of fetch + * + * @param string $element String of element ('product', 'facture', ...) + * @param int $id Id of object + * @param string $ref Ref of object to check + * @param string $ref_ext Ref ext of object to check + * @return int Return integer <0 if KO, 0 if OK but not found, >0 if OK and exists + */ + public static function isExistingObject($element, $id, $ref = '', $ref_ext = '') + { + } + /** + * isEmpty We consider CommonObject isEmpty if this->id is empty + * + * @return bool + */ + public function isEmpty() + { + } + /** + * setErrorsFromObject + * + * @param CommonObject $object commonobject + * @return void + */ + public function setErrorsFromObject($object) + { + } + /** + * Return array of data to show into a tooltip. This method must be implemented in each object class. + * + * @since v18 + * @param array $params params to construct tooltip data + * @return array Data to show in tooltip + */ + public function getTooltipContentArray($params) + { + } + /** + * getTooltipContent + * + * @param array $params params + * @since v18 + * @return string + */ + public function getTooltipContent($params) + { + } + /** + * Method to output saved errors + * + * @return string String with errors + */ + public function errorsToString() + { + } + /** + * Return customer ref for screen output. + * + * @param string $objref Customer ref + * @return string Customer ref formatted + */ + public function getFormatedCustomerRef($objref) + { + } + /** + * Return supplier ref for screen output. + * + * @param string $objref Supplier ref + * @return string Supplier ref formatted + */ + public function getFormatedSupplierRef($objref) + { + } + /** + * Return full address of contact + * + * @param int<0,1> $withcountry 1=Add country into address string + * @param string $sep Separator to use to build string + * @param int<0,1> $withregion 1=Add region into address string + * @param string $extralangcode User extralanguages as value + * @return string Full address string + */ + public function getFullAddress($withcountry = 0, $sep = "\n", $withregion = 0, $extralangcode = '') + { + } + /** + * Return the link of last main doc file for direct public download. + * + * @param string $modulepart Module related to document + * @param int $initsharekey Init the share key if it was not yet defined + * @param int $relativelink 0=Return full external link, 1=Return link relative to root of file + * @return string|-1 Returns the link, or an empty string if no link was found, or -1 if error. + */ + public function getLastMainDocLink($modulepart, $initsharekey = 0, $relativelink = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Add a link between element $this->element and a contact + * + * @param int $fk_socpeople Id of thirdparty contact (if source = 'external') or id of user (if source = 'internal') to link + * @param int|string $type_contact Type of contact (code or id). Must be id or code found into table llx_c_type_contact. For example: SALESREPFOLL + * @param string $source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user) + * @param int $notrigger Disable all triggers + * @return int Return integer <0 if KO, 0 if already added or code not valid, >0 if OK + */ + public function add_contact($fk_socpeople, $type_contact, $source = 'external', $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Copy contact from one element to current + * + * @param CommonObject $objFrom Source element + * @param 'internal'|'external' $source Nature of contact ('internal' or 'external') + * @return int >0 if OK, <0 if KO + */ + public function copy_linked_contact($objFrom, $source = 'internal') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update a link to contact line + * + * @param int $rowid Id of line contact-element + * @param int $statut New status of link + * @param int $type_contact_id Id of contact type (not modified if 0) + * @param int $fk_socpeople Id of soc_people to update (not modified if 0) + * @return int Return integer <0 if KO, >= 0 if OK + */ + public function update_contact($rowid, $statut, $type_contact_id = 0, $fk_socpeople = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Delete a link to contact line + * + * @param int $rowid Id of contact link line to delete + * @param int $notrigger Disable all triggers + * @return int >0 if OK, <0 if KO + */ + public function delete_contact($rowid, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Delete all links between an object $this and all its contacts in llx_element_contact + * + * @param string $source '' or 'internal' or 'external' + * @param string $code Type of contact (code or id) + * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK + */ + public function delete_linked_contact($source = '', $code = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Get array of all contacts for an object + * + * @param int $statusoflink Status of links to get (-1=all). Not used. + * @param 'external'|'thirdparty'|'internal' $source Source of contact: 'external' or 'thirdparty' (llx_socpeople) or 'internal' (llx_user) + * @param int<0,1> $list 0:Returned array contains all properties, 1:Return array contains just id + * @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...) + * @param int $status Status of user or company + * @param int[] $arrayoftcids Array with ID of type of contacts. If we provide this, we can filter on ec.fk_c_type_contact IN ($arrayoftcids) to avoid a link on c_type_contact table (faster). + * @return array|int<-1,-1> Array of contacts, -1 if error + */ + public function liste_contact($statusoflink = -1, $source = 'external', $list = 0, $code = '', $status = -1, $arrayoftcids = array()) + { + } + /** + * Update status of a contact linked to object + * + * @param int $rowid Id of link between object and contact + * @return int Return integer <0 if KO, >=0 if OK + */ + public function swapContactStatus($rowid) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return array with list of possible values for type of contacts + * + * @param 'internal'|'external'|'all' $source 'internal', 'external' or 'all' + * @param string $order Sort order by : 'position', 'code', 'rowid'... + * @param int<0,1> $option 0=Return array id->label, 1=Return array code->label + * @param int<0,1> $activeonly 0=all status of contact, 1=only the active + * @param string $code Type of contact (Example: 'CUSTOMER', 'SERVICE') + * @return array|array|null Array list of type of contacts (id->label if option=0, code->label if option=1), or null if error + */ + public function liste_type_contact($source = 'internal', $order = 'position', $option = 0, $activeonly = 0, $code = '') + { + } + /** + * Return array with list of possible values for type of contacts + * + * @param string $source 'internal', 'external' or 'all' + * @param int<0,1> $option 0=Return array id->label, 1=Return array code->label + * @param int<0,1> $activeonly 0=all status of contact, 1=only the active + * @param string $code Type of contact (Example: 'CUSTOMER', 'SERVICE') + * @param string $element Filter on 1 element type + * @param string $excludeelement Exclude 1 element type. Example: 'agenda' + * @return array|array|null Array list of type of contacts (id->label if option=0, code->label if option=1), or null if error + */ + public function listeTypeContacts($source = 'internal', $option = 0, $activeonly = 0, $code = '', $element = '', $excludeelement = '') + { + } + /** + * Return id of contacts for a source and a contact code. + * Example: contact client de facturation ('external', 'BILLING') + * Example: contact client de livraison ('external', 'SHIPPING') + * Example: contact interne suivi paiement ('internal', 'SALESREPFOLL') + * + * @param string $source 'external' or 'internal' + * @param string $code 'BILLING', 'SHIPPING', 'SALESREPFOLL', ... + * @param int $status limited to a certain status + * @return int[]|null List of id for such contacts, or null if error + */ + public function getIdContact($source, $code, $status = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load object contact with id=$this->contact_id into $this->contact + * + * @param ?int $contactid Id du contact. Use this->contact_id if empty. + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function fetch_contact($contactid = \null) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty + * + * @param int<0,1> $force_thirdparty_id Force thirdparty id + * @return int<-1,1> Return integer <0 if KO, >0 if OK + * @phan-suppress PhanUndeclaredProperty + */ + public function fetch_thirdparty($force_thirdparty_id = 0) + { + } + /** + * Looks for an object with ref matching the wildcard provided + * It does only work when $this->table_ref_field is set + * + * @param string $ref Wildcard + * @return int<-1,1> >1 = OK, 0 = Not found or table_ref_field not defined, <0 = KO + */ + public function fetchOneLike($ref) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load data for barcode into properties ->barcode_type* + * Properties ->barcode_type that is id of barcode. Type is used to find other properties, but + * if it is not defined, ->element must be defined to know default barcode type. + * + * @return int<-1,1> Return integer <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded) + */ + public function fetch_barcode() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load the project with id $this->fk_project into this->project + * + * @return int<-1,1> Return integer <0 if KO, >=0 if OK + */ + public function fetch_project() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load the project with id $this->fk_project into this->project + * + * @return int Return integer <0 if KO, >=0 if OK + */ + public function fetch_projet() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load the product with id $this->fk_product into this->product + * + * @return int<-1,1> Return integer <0 if KO, >=0 if OK + */ + public function fetch_product() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load the user with id $userid into this->user + * + * @param int $userid Id du contact + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function fetch_user($userid) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Read linked origin object. + * Set ->origin_object + * + * @return void + */ + public function fetch_origin() + { + } + /** + * Load object from specific field + * + * @param string $table Table element or element line + * @param string $field Field selected + * @param string $key Import key + * @param string $element Element name + * @return int<-1,1>|false Return -1 or false if KO, >0 if OK + */ + public function fetchObjectFrom($table, $field, $key, $element = \null) + { + } + /** + * Getter generic. Load value from a specific field + * + * @param string $table Table of element or element line + * @param int $id Element id + * @param string $field Field selected + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function getValueFrom($table, $id, $field) + { + } + /** + * Setter generic. Update a specific field into database. + * Warning: Trigger is run only if param trigkey is provided. + * + * @param string $field Field to update + * @param mixed $value New value + * @param string $table To force other table element or element line (should not be used) + * @param ?int $id To force other object id (should not be used) + * @param string $format Data format ('text', 'int', 'date'). 'text' is used if not defined + * @param string $id_field To force rowid field name. 'rowid' is used if not defined + * @param User|string|null $fuser Update the user of last update field with this user. If not provided, current user is used except if value is 'none' + * @param string $trigkey Trigger key to run (in most cases something like 'XXX_MODIFY') + * @param string $fk_user_field Name of field to save user id making change + * @return int<-2,1> Return integer <0 if KO, >0 if OK + * @see updateExtraField() + */ + public function setValueFrom($field, $value, $table = '', $id = \null, $format = '', $id_field = '', $fuser = \null, $trigkey = '', $fk_user_field = 'fk_user_modif') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load properties id_previous and id_next by comparing $fieldid with $this->ref + * + * @param string $filter Optional SQL filter. Use SQL or Universal Search Filter. + * Example: "(t.field1 = 'aa' OR t.field2 = 'bb')". Do not allow user input data here with this syntax. + * Example: "((t.field1:=:'aa') OR (t.field2:=:'bb'))". + * @param string $fieldid Name of field to use for the select MAX and MIN + * @param int<0,1> $nodbprefix Do not include DB prefix to forge table name + * @return int<-2,1> Return integer <0 if KO, >0 if OK + */ + public function load_previous_next_ref($filter, $fieldid, $nodbprefix = 0) + { + } + /** + * Return list of id of contacts of object + * + * @param string $source Source of contact: external (llx_socpeople) or internal (llx_user) or thirdparty (llx_societe) + * @return int[] Array of id of contacts (if source=external or internal) + * Array of id of third parties with at least one contact on object (if source=thirdparty) + */ + public function getListContactId($source = 'external') + { + } + /** + * Link element with a project + * + * @param int $projectid Project id to link element to + * @param int<0,1> $notrigger Disable the trigger + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function setProject($projectid, $notrigger = 0) + { + } + /** + * Change the payments methods + * + * @param int $id Id of new payment method + * @return int >0 if OK, <0 if KO + */ + public function setPaymentMethods($id) + { + } + /** + * Change the multicurrency code + * + * @param string $code multicurrency code + * @return int >0 if OK, <0 if KO + */ + public function setMulticurrencyCode($code) + { + } + /** + * Change the multicurrency rate + * + * @param double $rate multicurrency rate + * @param int $mode mode 1 : amounts in company currency will be recalculated, mode 2 : amounts in foreign currency will be recalculated + * @return int >0 if OK, <0 if KO + */ + public function setMulticurrencyRate($rate, $mode = 1) + { + } + /** + * Change the payments terms + * + * @param int $id Id of new payment terms + * @param float $deposit_percent % of deposit if needed by payment terms + * @return int >0 if OK, <0 if KO + */ + public function setPaymentTerms($id, $deposit_percent = \null) + { + } + /** + * Change the transport mode methods + * + * @param int $id Id of transport mode + * @return int >0 if OK, <0 if KO + */ + public function setTransportMode($id) + { + } + /** + * Change the retained warranty payments terms + * + * @param int $id Id of new payment terms + * @return int >0 if OK, <0 if KO + */ + public function setRetainedWarrantyPaymentTerms($id) + { + } + /** + * Define delivery address + * @deprecated + * + * @param int $id Address id + * @return int Return integer <0 si ko, >0 si ok + */ + public function setDeliveryAddress($id) + { + } + /** + * Change the shipping method + * + * @param int $shipping_method_id Id of shipping method + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @param User $userused Object user + * @return int 1 if OK, 0 if KO + */ + public function setShippingMethod($shipping_method_id, $notrigger = 0, $userused = \null) + { + } + /** + * Change the warehouse + * + * @param int $warehouse_id Id of warehouse + * @return int 1 if OK, 0 if KO + */ + public function setWarehouse($warehouse_id) + { + } + /** + * Set last model used by doc generator + * + * @param User $user User object that make change + * @param string $modelpdf Modele name + * @return int Return integer <0 if KO, >0 if OK + */ + public function setDocModel($user, $modelpdf) + { + } + /** + * Change the bank account + * + * @param int $fk_account Id of bank account + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @param User $userused Object user + * @return int 1 if OK, 0 if KO + */ + public function setBankAccount($fk_account, $notrigger = 0, $userused = \null) + { + } + // TODO: Move line related operations to CommonObjectLine? + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Save a new position (field rang) for details lines. + * You can choose to set position for lines with already a position or lines without any position defined. + * + * @param boolean $renum True to renum all already ordered lines, false to renum only not already ordered lines. + * @param string $rowidorder ASC or DESC + * @param boolean $fk_parent_line Table with fk_parent_line field or not + * @return int Return integer <0 if KO, >0 if OK + */ + public function line_order($renum = \false, $rowidorder = 'ASC', $fk_parent_line = \true) + { + } + /** + * Get children of line + * + * @param int $id Id of parent line + * @param int<0,1001> $includealltree 0 = 1st level child, 1 = All level child, 2-1001: internal use + * @return int[] Array with list of children lines id + */ + public function getChildrenOfLine($id, $includealltree = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update a line to have a lower rank + * + * @param int $rowid Id of line + * @param boolean $fk_parent_line Table with fk_parent_line field or not + * @return void + */ + public function line_up($rowid, $fk_parent_line = \true) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update a line to have a higher rank + * + * @param int $rowid Id of line + * @param boolean $fk_parent_line Table with fk_parent_line field or not + * @return void + */ + public function line_down($rowid, $fk_parent_line = \true) + { + } + /** + * Update position of line (rang) + * + * @param int $rowid Id of line + * @param int $rang Position + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function updateRangOfLine($rowid, $rang) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update position of line with ajax (rang) + * + * @param int[] $rows Array of rows + * @return void + */ + public function line_ajaxorder($rows) + { + } + /** + * Update position of line up (rang) + * + * @param int $rowid Id of line + * @param int $rang Position + * @return void + */ + public function updateLineUp($rowid, $rang) + { + } + /** + * Update position of line down (rang) + * + * @param int $rowid Id of line + * @param int $rang Position + * @param int $max Max + * @return void + */ + public function updateLineDown($rowid, $rang, $max) + { + } + /** + * Get position of line (rang) + * + * @param int $rowid Id of line + * @return int Value of rang in table of lines + */ + public function getRangOfLine($rowid) + { + } + /** + * Get rowid of the line relative to its position + * + * @param int $rang Rang value + * @return int Rowid of the line + */ + public function getIdOfLine($rang) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Get max value used for position of line (rang) + * + * @param int $fk_parent_line Parent line id + * @return int Max value of rang in table of lines + */ + public function line_max($fk_parent_line = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update external ref of element + * + * @param string $ref_ext Update field ref_ext + * @return int Return integer <0 if KO, >0 if OK + */ + public function update_ref_ext($ref_ext) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update note of element + * + * @param string $note New value for note + * @param string $suffix '', '_public' or '_private' + * @param int $notrigger 1=Does not execute triggers, 0=execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update_note($note, $suffix = '', $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update public note (kept for backward compatibility) + * + * @param string $note New value for note + * @return int Return integer <0 if KO, >0 if OK + * @deprecated + * @see update_note() + */ + public function update_note_public($note) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update total_ht, total_ttc, total_vat, total_localtax1, total_localtax2 for an object (sum of lines). + * Must be called at end of methods addline or updateline. + * + * @param int $exclspec >0 = Exclude special product (product_type=9) + * @param 'none'|'auto'|'0'|'1' $roundingadjust 'none'=Do nothing, 'auto'=Use default method (MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND if defined, or '0'), '0'=Force mode Total of rounding, '1'=Force mode Rounding of total + * @param int<0,1> $nodatabaseupdate 1=Do not update database total fields of the main object. Update only properties in memory. Can be used to save SQL when this method is called several times, so we can do it only once at end. + * @param ?Societe $seller If roundingadjust is '0' or '1' or maybe 'auto', it means we recalculate total for lines before calculating total for object and for this, we need seller object (used to analyze lines to check corrupted data). + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function update_price($exclspec = 0, $roundingadjust = 'auto', $nodatabaseupdate = 0, $seller = \null) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Add an object link into llx_element_element. + * + * @param string $origin Linked element type + * @param int $origin_id Linked element id + * @param User $f_user User that create + * @param int $notrigger 1=Does not execute triggers, 0=execute triggers + * @return int Return integer <=0 if KO, >0 if OK + * @see fetchObjectLinked(), updateObjectLinked(), deleteObjectLinked() + */ + public function add_object_linked($origin = \null, $origin_id = \null, $f_user = \null, $notrigger = 0) + { + } + /** + * Return an element type string formatted like element_element target_type and source_type + * + * @return string + */ + public function getElementType() + { + } + /** + * Fetch array of objects linked to current object (object of enabled modules only). Links are loaded into + * this->linkedObjectsIds array + + * this->linkedObjects array if $loadalsoobjects = 1 or $loadalsoobjects = type + * Possible usage for parameters: + * - all parameters empty -> we look all link to current object (current object can be source or target) + * - source id+type -> will get list of targets linked to source + * - target id+type -> will get list of sources linked to target + * - source id+type + target type -> will get list of targets of the type linked to source + * - target id+type + source type -> will get list of sources of the type linked to target + * + * @param ?int $sourceid Object source id (if not defined, $this->id) + * @param string $sourcetype Object source type (if not defined, $this->element) + * @param ?int $targetid Object target id (if not defined, $this->id) + * @param string $targettype Object target type (if not defined, $this->element) + * @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided + * @param int<0,1> $alsosametype 0=Return only links to object that differs from source type. 1=Include also link to objects of same type. + * @param string $orderby SQL 'ORDER BY' clause + * @param int<0,1>|string $loadalsoobjects Load also the array $this->linkedObjects. Use 0 to not load (increase performances), Use 1 to load all, Use value of type ('facture', 'facturerec', ...) to load only a type of object. + * @return int<-1,1> Return integer <0 if KO, >0 if OK + * @see add_object_linked(), updateObjectLinked(), deleteObjectLinked() + */ + public function fetchObjectLinked($sourceid = \null, $sourcetype = '', $targetid = \null, $targettype = '', $clause = 'OR', $alsosametype = 1, $orderby = 'sourcetype', $loadalsoobjects = 1) + { + } + /** + * Clear the cache saying that all linked object were already loaded. So next fetchObjectLinked will reload all links. + * + * @return int Return integer <0 if KO, >0 if OK + * @see fetchObjectLinked() + */ + public function clearObjectLinkedCache() + { + } + /** + * Update object linked of a current object + * + * @param int $sourceid Object source id + * @param string $sourcetype Object source type + * @param int $targetid Object target id + * @param string $targettype Object target type + * @param User $f_user User that create + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int >0 if OK, <0 if KO + * @see add_object_linked(), fetObjectLinked(), deleteObjectLinked() + */ + public function updateObjectLinked($sourceid = \null, $sourcetype = '', $targetid = \null, $targettype = '', $f_user = \null, $notrigger = 0) + { + } + /** + * Delete all links between an object $this + * + * @param int $sourceid Object source id + * @param string $sourcetype Object source type + * @param int $targetid Object target id + * @param string $targettype Object target type + * @param int $rowid Row id of line to delete. If defined, other parameters are not used. + * @param User $f_user User that create + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int >0 if OK, <0 if KO + * @see add_object_linked(), updateObjectLinked(), fetchObjectLinked() + */ + public function deleteObjectLinked($sourceid = \null, $sourcetype = '', $targetid = \null, $targettype = '', $rowid = 0, $f_user = \null, $notrigger = 0) + { + } + /** + * Function used to get an array with all items linked to an object id in association table + * + * @param int $fk_object_where id of object we need to get linked items + * @param string $field_select name of field we need to get a list + * @param string $field_where name of field of object we need to get linked items + * @param string $table_element name of association table + * @return array|int Array of record, -1 if empty + */ + public static function getAllItemsLinkedByObjectID($fk_object_where, $field_select, $field_where, $table_element) + { + } + /** + * Count items linked to an object id in association table + * + * @param int $fk_object_where id of object we need to get linked items + * @param string $field_where name of field of object we need to get linked items + * @param string $table_element name of association table + * @return array|int Array of record, -1 if empty + */ + public static function getCountOfItemsLinkedByObjectID($fk_object_where, $field_where, $table_element) + { + } + /** + * Function used to remove all items linked to an object id in association table + * + * @param int $fk_object_where id of object we need to remove linked items + * @param string $field_where name of field of object we need to delete linked items + * @param string $table_element name of association table + * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK and something done + */ + public static function deleteAllItemsLinkedByObjectID($fk_object_where, $field_where, $table_element) + { + } + /** + * Set status of an object. + * + * @param int $status Status to set + * @param int $elementId Id of element to force (use this->id by default if null) + * @param string $elementType Type of element to force (use this->table_element by default) + * @param string $trigkey Trigger key to use for trigger. Use '' means automatic but it is not recommended and is deprecated. + * @param string $fieldstatus Name of status field in this->table_element + * @return int Return integer <0 if KO, >0 if OK + */ + public function setStatut($status, $elementId = \null, $elementType = '', $trigkey = '', $fieldstatus = 'fk_statut') + { + } + /** + * Load type of canvas of an object if it exists + * + * @param int $id Record id + * @param string $ref Record ref + * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK + */ + public function getCanvas($id = 0, $ref = '') + { + } + /** + * Get special code of a line + * + * @param int $lineid Id of line + * @return int Special code + */ + public function getSpecialCode($lineid) + { + } + /** + * Function to check if an object is used by others (by children). + * Check is done into this->childtables. There is no check into llx_element_element. + * + * @param int $id Force id of object + * @param int $entity Force entity to check + * @return int Return integer <0 if KO, 0 if not used, >0 if already used + */ + public function isObjectUsed($id = 0, $entity = 0) + { + } + /** + * Function to say how many lines object contains + * + * @param int $predefined -1=All, 0=Count free product/service only, 1=Count predefined product/service only, 2=Count predefined product, 3=Count predefined service + * @return int Return integer <0 if KO, 0 if no predefined products, nb of lines with predefined products if found + */ + public function hasProductsOrServices($predefined = -1) + { + } + /** + * Function that returns the total amount HT of discounts applied for all lines. + * + * @return float|null Total amount of discount, or null if $table_element_line is empty + */ + public function getTotalDiscount() + { + } + /** + * Return into unit=0, the calculated total of weight and volume of all lines * qty + * Calculate by adding weight and volume of each product line, so properties ->volume/volume_units/weight/weight_units must be loaded on line. + * + * @return array{weight:int|float,volume:int|float,ordered:int|float,toship:int|float}|array{} array('weight'=>...,'volume'=>...) + */ + public function getTotalWeightVolume() + { + } + /** + * Set extra parameters + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function setExtraParameters() + { + } + // -------------------- + // TODO: All functions here must be redesigned and moved as they are not business functions but output functions + // -------------------- + /* This is to show add lines */ + /** + * Show add free and predefined products/services form + * + * @param int $dateSelector 1=Show also date range input fields + * @param Societe $seller Object thirdparty who sell + * @param ?Societe $buyer Object thirdparty who buy + * @param string $defaulttpldir Directory where to find the template + * @return void + */ + public function formAddObjectLine($dateSelector, $seller, $buyer, $defaulttpldir = '/core/tpl') + { + } + /* This is to show array of line of details */ + /** + * Return HTML table for object lines + * TODO Move this into an output class file (htmlline.class.php) + * If lines are into a template, title must also be into a template + * But for the moment we don't know if it's possible as we keep a method available on overloaded objects. + * + * @param string $action Action code + * @param Societe $seller Object of seller third party + * @param ?Societe $buyer Object of buyer third party + * @param int $selected ID line selected + * @param int $dateSelector 1=Show also date range input fields + * @param string $defaulttpldir Directory where to find the template + * @return void + */ + public function printObjectLines($action, $seller, $buyer, $selected = 0, $dateSelector = 0, $defaulttpldir = '/core/tpl') + { + } + /** + * Return HTML content of a detail line + * TODO Move this into an output class file (htmlline.class.php) + * + * @param string $action GET/POST action + * @param CommonObjectLine $line Selected object line to output + * @param '' $var Not used + * @param int $num Number of line (0) + * @param int $i I + * @param int $dateSelector 1=Show also date range input fields + * @param Societe $seller Object of seller third party + * @param Societe $buyer Object of buyer third party + * @param int $selected ID line selected + * @param Extrafields $extrafields Object of extrafields + * @param string $defaulttpldir Directory where to find the template (deprecated) + * @return void + */ + public function printObjectLine($action, $line, $var, $num, $i, $dateSelector, $seller, $buyer, $selected = 0, $extrafields = \null, $defaulttpldir = '/core/tpl') + { + } + /* This is to show array of line of details of source object */ + /** + * Return HTML table table of source object lines + * TODO Move this and previous function into output html class file (htmlline.class.php). + * If lines are into a template, title must also be into a template + * But for the moment we don't know if it's possible, so we keep the method available on overloaded objects. + * + * @param ''|'services' $restrictlist ''=All lines, 'services'=Restrict to services only + * @param int[] $selectedLines Array of lines id for selected lines + * @return void + */ + public function printOriginLinesList($restrictlist = '', $selectedLines = array()) + { + } + /** + * Return HTML with a line of table array of source object lines + * TODO Move this and previous function into output html class file (htmlline.class.php). + * If lines are into a template, titles must also be into a template + * But for the moment we don't know if it's possible as we keep a method available on overloaded objects. + * + * @param CommonObjectLine $line Line + * @param string $var Not used + * @param string $restrictlist ''=All lines, 'services'=Restrict to services only (strike line if not) + * @param string $defaulttpldir Directory where to find the template + * @param int[] $selectedLines Array of lines id for selected lines + * @return void + */ + public function printOriginLine($line, $var, $restrictlist = '', $defaulttpldir = '/core/tpl', $selectedLines = array()) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Add resources to the current object : add entry into llx_element_resources + * Need $this->element & $this->id + * + * @param int $resource_id Resource id + * @param string $resource_type 'resource' + * @param int $busy Busy or not + * @param int $mandatory Mandatory or not + * @return int Return integer <=0 if KO, >0 if OK + */ + public function add_element_resource($resource_id, $resource_type, $busy = 0, $mandatory = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Delete a link to resource line + * + * @param int $rowid Id of resource line to delete + * @param string $element element name (for trigger) TODO: use $this->element into commonobject class + * @param int $notrigger Disable all triggers + * @return int >0 if OK, <0 if KO + */ + public function delete_resource($rowid, $element, $notrigger = 0) + { + } + /** + * Overwrite magic function to solve problem of cloning object that are kept as references + * + * @return void + */ + public function __clone() + { + } + /** + * Common function for all objects extending CommonObject for generating documents + * + * @param string $modelspath Relative folder where generators are placed + * @param string $modele Generator to use. Caller must set it to from obj->model_pdf or from GETPOST for example. + * @param Translate $outputlangs Output language to use + * @param int<0,1> $hidedetails 1 to hide details. 0 by default + * @param int<0,1> $hidedesc 1 to hide product description. 0 by default + * @param int<0,1> $hideref 1 to hide product reference. 0 by default + * @param ?array $moreparams Array to provide more information + * @return int<-1,1> >0 if OK, <0 if KO + * @see addFileIntoDatabaseIndex() + */ + protected function commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams = \null) + { + } + /** + * Index a file into the ECM database + * + * @param string $destfull Full path of file to index + * @param int $update_main_doc_field Update field main_doc field into the table of the object. + * This param is set when called for a document generation if document generator hase + * ->update_main_doc_field set and returns ->result['fullpath']. + * @return int Return integer <0 if KO, >0 if OK + */ + public function indexFile($destfull, $update_main_doc_field) + { + } + /** + * Build thumb + * @todo Move this into files.lib.php + * + * @param string $file Path file in UTF8 to original file to create thumbs from. + * @return void + */ + public function addThumbs($file) + { + } + /** + * Delete thumbs + * @todo Move this into files.lib.php + * + * @param string $file Path file in UTF8 to original file to delete thumbs. + * @return void + */ + public function delThumbs($file) + { + } + /* Functions common to commonobject and commonobjectline */ + /* For default values */ + /** + * Return the default value to use for a field when showing the create form of object. + * Return values in this order: + * 1) If parameter is available into POST, we return it first. + * 2) If not but an alternate value was provided as parameter of function, we return it. + * 3) If not but a constant $conf->global->OBJECTELEMENT_FIELDNAME is set, we return it (It is better to use the dedicated table). + * 4) Return value found into database (TODO No yet implemented) + * + * @param string $fieldname Name of field + * @param string $alternatevalue Alternate value to use + * @param string $type Type of data + * @return string|string[] Default value (can be an array if the GETPOST return an array) + **/ + public function getDefaultCreateValueFor($fieldname, $alternatevalue = \null, $type = 'alphanohtml') + { + } + /* For triggers */ + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Call trigger based on this instance. + * Some context information may also be provided into array property this->context. + * NB: Error from trigger are stacked in interface->errors + * NB2: If return code of triggers are < 0, action calling trigger should cancel all transaction. + * + * @param string $triggerName trigger's name to execute + * @param User $user Object user + * @return int Result of run_triggers + */ + public function call_trigger($triggerName, $user) + { + } + /* Functions for data in other language */ + /** + * Function to get alternative languages of a data into $this->array_languages + * This method is NOT called by method fetch of objects but must be called separately. + * + * @return int<-1,1> Return integer <0 if error, 0 if no values of alternative languages to find nor found, 1 if a value was found and loaded + * @see fetch_optionnals() + */ + public function fetchValuesForExtraLanguages() + { + } + /** + * Fill array_options property of object by extrafields value (using for data sent by forms) + * + * @param string $onlykey Only the following key is filled. When we make update of only one language field ($action = 'update_languages'), calling page must set this to avoid to have other languages being reset. + * @return int<-1,1> 1 if array_options set, 0 if no value, -1 if error (field required missing for example) + */ + public function setValuesForExtraLanguages($onlykey = '') + { + } + /* Functions for extrafields */ + /** + * Function to make a fetch but set environment to avoid to load computed values before. + * + * @param int $id ID of object + * @return int<-1,1> >0 if OK, 0 if not found, <0 if KO + */ + public function fetchNoCompute($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Function to get extra fields of an object into $this->array_options + * This method is in most cases called by method fetch of objects but you can call it separately. + * + * @param int $rowid Id of line. Use the id of object if not defined. Deprecated. Function must be called without parameters. + * @param array{}|array{label:array,type:array,size:array,default:array,computed:array,unique:array,required:array,param:array,perms:array,list:array|array,pos:array,totalizable:array,help:array,printable:array,enabled:array,langfile:array,css:array,csslist:array,hidden:array,mandatoryfieldsofotherentities?:array,loaded?:int,count:int} $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters. + * @return int<-1,1> Return integer <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded + * @see fetchValuesForExtraLanguages() + */ + public function fetch_optionals($rowid = \null, $optionsArray = \null) + { + } + /** + * Delete all extra fields values for the current object. + * + * @return int<-1,1> Return integer <0 if KO, >0 if OK + * @see deleteExtraLanguages(), insertExtraField(), updateExtraField(), setValueFrom() + */ + public function deleteExtraFields() + { + } + /** + * Add/Update all extra fields values for the current object. + * Data to describe values to insert/update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) + * This function delete record with all extrafields and insert them again from the array $this->array_options. + * + * @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY) + * @param User $userused Object user + * @return int<-1,1> -1=error, O=did nothing, 1=OK + * @see insertExtraLanguages(), updateExtraField(), deleteExtraField(), setValueFrom() + */ + public function insertExtraFields($trigger = '', $userused = \null) + { + } + /** + * Add/Update all extra fields values for the current object. + * Data to describe values to insert/update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) + * This function delete record with all extrafields and insert them again from the array $this->array_options. + * + * @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY) + * @param User $userused Object user + * @return int<-1,1> -1=error, O=did nothing, 1=OK + * @see insertExtraFields(), updateExtraField(), setValueFrom() + */ + public function insertExtraLanguages($trigger = '', $userused = \null) + { + } + /** + * Update 1 extra field value for the current object. Keep other fields unchanged. + * Data to describe values to update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) + * + * @param string $key Key of the extrafield to update (without starting 'options_') + * @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY) + * @param User $userused Object user + * @return int<-1,1> -1=error, O=did nothing, 1=OK + * @see updateExtraLanguages(), insertExtraFields(), deleteExtraFields(), setValueFrom() + */ + public function updateExtraField($key, $trigger = \null, $userused = \null) + { + } + /** + * Convenience method for retrieving the value of an extrafield without actually fetching it from the database. + * + * @param string $key Name of the extrafield + * @return mixed|null + */ + public function getExtraField($key) + { + } + /** + * Convenience method for setting the value of an extrafield without actually updating it in the database. + * + * @param string $key Name of the extrafield + * @param mixed $value Value to be assigned to the extrafield + * @return void + */ + public function setExtraField($key, $value) + { + } + /** + * Update an extra language value for the current object. + * Data to describe values to update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) + * + * @param string $key Key of the extrafield (without starting 'options_') + * @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY) + * @param User $userused Object user + * @return int -1=error, O=did nothing, 1=OK + * @see updateExtraField(), insertExtraLanguages() + */ + public function updateExtraLanguages($key, $trigger = \null, $userused = \null) + { + } + /** + * Return HTML string to put an input field into a page + * Code very similar with showInputField of extra fields + * + * @param ?array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $val Array of properties for field to show (used only if ->fields not defined) + * Array of properties of field to show + * @param string $key Key of attribute + * @param string|string[] $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array) + * @param string $moreparam To add more parameters on html input tag + * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) + * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @param string|int $morecss Value for css to define style/length of field. May also be a numeric. + * @param int<0,1> $nonewbutton Force to not show the new button on field that are links to object + * @return string + */ + public function showInputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = 0, $nonewbutton = 0) + { + } + /** + * Return HTML string to show a field into a page + * Code very similar with showOutputField of extra fields + * + * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $val Array of properties of field to show + * @param string $key Key of attribute + * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) + * @param string $moreparam To add more parameters on html tag + * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names) + * @param mixed $morecss Value for CSS to use (Old usage: May also be a numeric to define a size). + * @return string + */ + public function showOutputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '') + { + } + /** + * clear validation message result for a field + * + * @param string $fieldKey Key of attribute to clear + * @return void + */ + public function clearFieldError($fieldKey) + { + } + /** + * set validation error message a field + * + * @param string $fieldKey Key of attribute + * @param string $msg the field error message + * @return void + */ + public function setFieldError($fieldKey, $msg = '') + { + } + /** + * get field error message + * + * @param string $fieldKey Key of attribute + * @return string Error message of validation ('' if no error) + */ + public function getFieldError($fieldKey) + { + } + /** + * Return validation test result for a field + * + * @param array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> $fields Array of properties of field to show + * @param string $fieldKey Key of attribute + * @param string $fieldValue Value of attribute + * @return bool Return false if fail true on success, see $this->error for error message + */ + public function validateField($fields, $fieldKey, $fieldValue) + { + } + /** + * Function to show lines of extrafields with output data. + * This function is responsible to output the and according to correct number of columns received into $params['colspan'] or
according to $display_type + * + * @param Extrafields $extrafields Extrafield Object + * @param string $mode Show output ('view') or input ('create' or 'edit') for extrafield + * @param array $params Optional parameters. Example: array('style'=>'class="oddeven"', 'colspan'=>$colspan) + * @param string $keysuffix Suffix string to add after name and id of field (can be used to avoid duplicate names) + * @param string $keyprefix Prefix string to add before name and id of field (can be used to avoid duplicate names) + * @param string $onetrtd All fields in same tr td. Used by objectline_create.tpl.php for example. + * @param string $display_type "card" for form display, "line" for document line display (extrafields on propal line, order line, etc...) + * @return string String with html content to show + */ + public function showOptionals($extrafields, $mode = 'view', $params = \null, $keysuffix = '', $keyprefix = '', $onetrtd = '', $display_type = 'card') + { + } + /** + * @param string $type Type for prefix + * @return string JavaScript code to manage dependency + */ + public function getJSListDependancies($type = '_extra') + { + } + /** + * Returns the rights used for this class + * + * @return null|int|stdClass Object of permission for the module + */ + public function getRights() + { + } + /** + * Function used to replace a thirdparty id with another one. + * This function is meant to be called from replaceThirdparty with the appropriate tables + * Column name fk_soc MUST exist. + * + * @param DoliDB $dbs Database handler + * @param int $origin_id Old thirdparty id (the thirdparty to delete) + * @param int $dest_id New thirdparty id (the thirdparty that will received element of the other) + * @param string[] $tables Tables that need to be changed + * @param int<0,1> $ignoreerrors Ignore errors. Return true even if errors. We need this when replacement can fails like for categories (categorie of old thirdparty may already exists on new one) + * @return bool True if success, False if error + */ + public static function commonReplaceThirdparty(\DoliDB $dbs, $origin_id, $dest_id, array $tables, $ignoreerrors = 0) + { + } + /** + * Function used to replace a product id with another one. + * This function is meant to be called from replaceProduct with the appropriate tables + * Column name fk_product MUST be used to identify products + * + * @param DoliDB $dbs Database handler + * @param int $origin_id Old product id (the product to delete) + * @param int $dest_id New product id (the product that will received element of the other) + * @param string[] $tables Tables that need to be changed + * @param int<0,1> $ignoreerrors Ignore errors. Return true even if errors. We need this when replacement can fails like for categories (categorie of old product may already exists on new one) + * @return bool True if success, False if error + */ + public static function commonReplaceProduct(\DoliDB $dbs, $origin_id, $dest_id, array $tables, $ignoreerrors = 0) + { + } + /** + * Get buy price to use for margin calculation. This function is called when buy price is unknown. + * Set buy price = sell price if ForceBuyingPriceIfNull configured, + * elseif calculation MARGIN_TYPE = 'costprice' and costprice is defined, use costprice as buyprice + * elseif calculation MARGIN_TYPE = 'pmp' and pmp is calculated, use pmp as buyprice + * else set min buy price as buy price + * + * @param float $unitPrice Product unit price + * @param float $discountPercent Line discount percent + * @param int $fk_product Product id + * @return float|int<-1,-1> Return buy price if OK, integer <0 if KO + */ + public function defineBuyPrice($unitPrice = 0.0, $discountPercent = 0.0, $fk_product = 0) + { + } + /** + * Function used to get the logos or photos of an object + * + * @param string $modulepart Module part + * @param string $imagesize Image size ('', 'mini' or 'small') + * @return array{dir:string,file:string,originalfile:string,altfile:string,email:string,capture:string} Array of data to show photo + */ + public function getDataToShowPhoto($modulepart, $imagesize) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show photos of an object (nbmax maximum), into several columns + * + * @param string $modulepart 'product', 'ticket', ... + * @param string $sdir Directory to scan (full absolute path) + * @param int<0,1>|''|'small' $size 0 or ''=original size, 1 or 'small'=use thumbnail if possible + * @param int $nbmax Nombre maximum de photos (0=pas de max) + * @param int $nbbyrow Number of image per line or -1 to use div separator or 0 to use no separator. Used only if size=1 or 'small'. + * @param int $showfilename 1=Show filename + * @param int $showaction 1=Show icon with action links (resize, delete) + * @param int $maxHeight Max height of original image when size='small' (so we can use original even if small requested). If 0, always use 'small' thumb image. + * @param int $maxWidth Max width of original image when size='small' + * @param int $nolink Do not add a href link to view enlarged imaged into a new tab + * @param int|string $overwritetitle Do not add title tag on image + * @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead) + * @param string $cache A string if we want to use a cached version of image + * @param string $addphotorefcss Add CSS to img of photos + * @return string Html code to show photo. Number of photos shown is saved in this->nbphoto + */ + public function show_photos($modulepart, $sdir, $size = 0, $nbmax = 0, $nbbyrow = 5, $showfilename = 0, $showaction = 0, $maxHeight = 120, $maxWidth = 160, $nolink = 0, $overwritetitle = 0, $usesharelink = 0, $cache = '', $addphotorefcss = 'photoref') + { + } + /** + * Function test if type is array + * + * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $info content information of field + * @return bool true if array + */ + protected function isArray($info) + { + } + /** + * Function test if type is date + * + * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $info content information of field + * @return bool true if date + */ + public function isDate($info) + { + } + /** + * Function test if type is duration + * + * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $info content information of field + * @return bool true if field of type duration + */ + public function isDuration($info) + { + } + /** + * Function test if type is integer + * + * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $info Properties of field + * @return bool true if integer + */ + public function isInt($info) + { + } + /** + * Function test if type is float + * + * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $info content information of field + * @return bool true if float + */ + public function isFloat($info) + { + } + /** + * Function test if type is text + * + * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $info Properties of field + * @return bool true if type text + */ + public function isText($info) + { + } + /** + * Function test if field can be null + * + * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $info content information of field + * @return bool true if it can be null + */ + protected function canBeNull($info) + { + } + /** + * Function test if field is forced to null if zero or empty + * + * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $info content information of field + * @return bool true if forced to null + */ + protected function isForcedToNullIfZero($info) + { + } + /** + * Function test if is indexed + * + * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $info content information of field + * @return bool + */ + protected function isIndex($info) + { + } + /** + * Function to return the array of data key-value from the ->fields and all the ->properties of an object. + * + * Note: $this->${field} are set by the page that make the createCommon() or the updateCommon(). + * $this->${field} should be a clean and string value (so date are formatted for SQL insert). + * + * @return array Array with all values of each property to update + */ + protected function setSaveQuery() + { + } + /** + * Function to load data from a SQL pointer into properties of current object $this + * + * @param stdClass $obj Contain data of object from database + * @return void + */ + public function setVarsFromFetchObj(&$obj) + { + } + /** + * Sets all object fields to null. Useful for example in lists, when printing multiple lines and a different object os fetched for each line. + * @return void + */ + public function emtpyObjectVars() + { + } + /** + * Function to concat keys of fields + * + * @param string $alias String of alias of table for fields. For example 't'. It is recommended to use '' and set alias into fields definition. + * @param string[] $excludefields Array of fields to exclude + * @return string List of alias fields + */ + public function getFieldList($alias = '', $excludefields = array()) + { + } + /** + * Add quote to field value if necessary + * + * @param string|int $value Value to protect + * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $fieldsentry Properties of field + * @return string|int + */ + protected function quote($value, $fieldsentry) + { + } + /** + * Create object in the database + * + * @param User $user User that creates + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int<-1,max> Return integer <0 if KO, Id of created object if OK + */ + public function createCommon(\User $user, $notrigger = 0) + { + } + /** + * Load object in memory from the database. This does not load line. This is done by parent fetch() that call fetchCommon + * + * @param int $id Id object + * @param string $ref Ref + * @param string $morewhere More SQL filters (' AND ...') + * @param int<0,1> $noextrafields 0=Default to load extrafields, 1=No extrafields + * @return int<-4,1> Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetchCommon($id, $ref = \null, $morewhere = '', $noextrafields = 0) + { + } + /** + * Load object in memory from the database + * + * @param string $morewhere More SQL filters (' AND ...') + * @param int<0,1> $noextrafields 0=Default to load extrafields, 1=No extrafields + * @return int<-1,1> Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLinesCommon($morewhere = '', $noextrafields = 0) + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function updateCommon(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @param int<0,1> $forcechilddeletion 0=no, 1=Force deletion of children + * @return int<-1,1> Return integer <0 if KO, 0=Nothing done because object has child, >0 if OK + */ + public function deleteCommon(\User $user, $notrigger = 0, $forcechilddeletion = 0) + { + } + /** + * Delete all child object from a parent ID + * + * @param int $parentId Parent Id + * @param string $parentField Name of Foreign key parent column + * @param string $filter Filter as an Universal Search string. + * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')' + * @param string $filtermode No more used + * @return int Return integer <0 if KO, >0 if OK + * @throws Exception + */ + public function deleteByParentField($parentId = 0, $parentField = '', $filter = '', $filtermode = "AND") + { + } + /** + * Delete a line of object in database + * + * @param User $user User that delete + * @param int $idline Id of line to delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int >0 if OK, <0 if KO + */ + public function deleteLineCommon(\User $user, $idline, $notrigger = 0) + { + } + /** + * Set to a status + * + * @param User $user Object user that modify + * @param int $status New status to set (often a constant like self::STATUS_XXX) + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @param string $triggercode Trigger code to use + * @return int Return integer <0 if KO, >0 if OK + */ + public function setStatusCommon($user, $status, $notrigger = 0, $triggercode = '') + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimenCommon() + { + } + /* Part for comments */ + /** + * Load comments linked with current task + * + * @return int<0,max>|-1 Returns the number of comments if OK, -1 if error + */ + public function fetchComments() + { + } + /** + * Return nb comments already posted + * + * @return int + */ + public function getNbComments() + { + } + /** + * Trim object parameters + * + * @param string[] $parameters array of parameters to trim + * @return void + */ + public function trimParameters($parameters) + { + } + /* Part for categories/tags */ + /** + * Sets object to given categories. + * + * Deletes object from existing categories not supplied. + * Adds it to non existing supplied categories. + * Existing categories are left untouch. + * + * @param string $type_categ Category type ('customer', 'supplier', 'website_page', ...) + * @return int[]|int Array of category IDs or < 0 if KO + */ + public function getCategoriesCommon($type_categ) + { + } + /** + * Sets object to given categories. + * + * Adds it to non existing supplied categories. + * Deletes object from existing categories not supplied (if remove_existing==true). + * Existing categories are left untouch. + * + * @param int[]|int $categories Category ID or array of Categories IDs + * @param string $type_categ Category type ('customer', 'supplier', 'website_page', ...) defined into const class Categorie type + * @param boolean $remove_existing True: Remove existings categories from Object if not supplies by $categories, False: let them + * @return int Return integer <0 if KO, >0 if OK + */ + public function setCategoriesCommon($categories, $type_categ = '', $remove_existing = \true) + { + } + /** + * Copy related categories to another object + * + * @param int $fromId Id object source + * @param int $toId Id object cible + * @param string $type Type of category ('product', ...) + * @return int Return integer < 0 if error, > 0 if ok + */ + public function cloneCategories($fromId, $toId, $type = '') + { + } + /** + * Delete related files of object in database + * + * @param integer $mode 0=Use path to find record, 1=Use src_object_xxx fields (Mode 1 is recommended for new objects) + * @return bool True if OK, False if KO + */ + public function deleteEcmFiles($mode = 0) + { + } + } + /** + * Class to manage accounting accounts + */ + class AccountingAccount extends \CommonObject + { + /** + * @var string Name of element + */ + public $element = 'accounting_account'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'accounting_account'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'billr'; + /** + * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user + * @var integer + */ + public $restrictiononfksoc = 1; + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var int ID + */ + public $id; + /** + * @var int ID + */ + public $rowid; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + /** + * @var string pcg version + */ + public $fk_pcg_version; + /** + * @var string pcg type + */ + public $pcg_type; + /** + * @var string account number + */ + public $account_number; + /** + * @var int ID parent account + */ + public $account_parent; + /** + * @var int ID category account + */ + public $account_category; + /** + * @var int Label category account + */ + public $account_category_label; + /** + * @var int Status + */ + public $status; + /** + * @var string Label of account + */ + public $label; + /** + * @var string Label short of account + */ + public $labelshort; + /** + * @var int ID + */ + public $fk_user_author; + /** + * @var int ID + */ + public $fk_user_modif; + /** + * @var int active (duplicate with status) + */ + public $active; + /** + * @var int reconcilable + */ + public $reconcilable; + const STATUS_ENABLED = 1; + const STATUS_DISABLED = 0; + /** + * Constructor + * + * @param DoliDB $db Database handle + */ + public function __construct($db) + { + } + /** + * Load record in memory + * + * @param int $rowid Id + * @param string|null $account_number Account number + * @param int|boolean $limittocurrentchart 1 or true=Load record only if it is into current active chart of account + * @param string $limittoachartaccount 'ABC'=Load record only if it is into chart account with code 'ABC' (better and faster than previous parameter if you have chart of account code). + * @return int Return integer <0 if KO, 0 if not found, Id of record if OK and found + */ + public function fetch($rowid = 0, $account_number = \null, $limittocurrentchart = 0, $limittoachartaccount = '') + { + } + /** + * Insert new accounting account in chart of accounts + * + * @param User $user User making action + * @param int $notrigger Disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Update record + * + * @param User $user User making update + * @return int Return integer <0 if KO (-2 = duplicate), >0 if OK + */ + public function update($user) + { + } + /** + * Check usage of accounting code + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function checkUsage() + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $withlabel 0=No label, 1=Include label of account + * @param int $nourl 1=Disable url + * @param string $moretitle Add more text to title tooltip + * @param int $notooltip 1=Disable tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $withcompletelabel 0=Short label (field short label), 1=Complete label (field label) + * @param string $option 'ledger', 'journals', 'accountcard' + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '') + { + } + /** + * Information on record + * + * @param int $id ID of record + * @return void + */ + public function info($id) + { + } + /** + * Deactivate an account (for status active or status reconcilable) + * + * @param int $id Id + * @param int $mode 0=field active, 1=field reconcilable + * @return int Return integer <0 if KO, >0 if OK + */ + public function accountDeactivate($id, $mode = 0) + { + } + /** + * Account activated + * + * @param int $id Id + * @param int $mode 0=field active, 1=field reconcilable + * @return int Return integer <0 if KO, >0 if OK + */ + public function accountActivate($id, $mode = 0) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Return a suggested account (from chart of accounts) to bind + * + * @param Societe $buyer Object buyer + * @param Societe $seller Object seller + * @param Product $product Product object sell or buy + * @param Facture|FactureFournisseur $facture Facture + * @param FactureLigne|SupplierInvoiceLine $factureDet Facture Det + * @param array $accountingAccount Array of Accounting account + * @param string $type Customer / Supplier + * @return array{suggestedaccountingaccountbydefaultfor:string,suggestedaccountingaccountfor:string,suggestedid:?int,code_l:string,code_p:string,code_t:string}|int<-1,-1> Array of accounting accounts suggested or < 0 if technical error. + * 'suggestedaccountingaccountbydefaultfor'=>Will be used for the label to show on tooltip for account by default on any product + * 'suggestedaccountingaccountfor'=>Is the account suggested for this product + */ + public function getAccountingCodeToBind(\Societe $buyer, \Societe $seller, \Product $product, $facture, $factureDet, $accountingAccount = array(), $type = '') + { + } + } + /* Copyright (C) 2017-2022 OpenDSI + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * + * 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 . + */ + /** + * \file htdocs/accountancy/class/accountingjournal.class.php + * \ingroup Accountancy (Double entries) + * \brief File of class to manage accounting journals + */ + /** + * Class to manage accounting journals + */ + class AccountingJournal extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'accounting_journal'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'accounting_journal'; + /** + * @var string Fieldname with ID of parent key if this field has a parent + */ + public $fk_element = ''; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'generic'; + /** + * @var int ID + */ + public $rowid; + /** + * @var string Accounting journal code + */ + public $code; + /** + * @var string Accounting Journal label + */ + public $label; + /** + * @var int 1:various operations, 2:sale, 3:purchase, 4:bank, 5:expense-report, 8:inventory, 9: has-new + */ + public $nature; + /** + * @var int is active or not + */ + public $active; + /** + * @var array Accounting account cached + */ + public static $accounting_account_cached = array(); + /** + * @var array Nature mapping + */ + public static $nature_maps = array(1 => 'variousoperations', 2 => 'sells', 3 => 'purchases', 4 => 'bank', 5 => 'expensereports', 8 => 'inventories', 9 => 'hasnew'); + /** + * Constructor + * + * @param DoliDB $db Database handle + */ + public function __construct($db) + { + } + /** + * Load an object from database + * + * @param int $rowid Id of record to load + * @param ?string $journal_code Journal code + * @return int Return integer <0 if KO, Id of record if OK and found + */ + public function fetch($rowid = 0, $journal_code = \null) + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $withlabel 0=No label, 1=Include label of journal, 2=Include nature of journal + * @param int $nourl 1=Disable url + * @param string $moretitle Add more text to title tooltip + * @param int $notooltip 1=Disable tooltip + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0) + { + } + /** + * Return the label of the status + * + * @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibType($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return type of an accounting journal + * + * @param int $nature Id type + * @param int<0,1> $mode 0=label long, 1=label short + * @return string Label of type + */ + public function LibType($nature, $mode = 0) + { + } + /** + * Get journal data + * + * @param User $user User who get infos + * @param string $type Type data returned ('view', 'bookkeeping', 'csv') + * @param int $date_start Filter 'start date' + * @param int $date_end Filter 'end date' + * @param string $in_bookkeeping Filter 'in bookkeeping' ('already', 'notyet') + * @return int<-1,-1>|array>}> Return integer <0 if KO, array + */ + public function getData(\User $user, $type = 'view', $date_start = \null, $date_end = \null, $in_bookkeeping = 'notyet') + { + } + /** + * Get asset data for various journal + * + * @param User $user User who get infos + * @param 'view'|'bookkeeping'|'csv' $type Type data returned ('view', 'bookkeeping', 'csv') + * @param ?int $date_start Filter 'start date' + * @param ?int $date_end Filter 'end date' + * @param 'already'|'notyet' $in_bookkeeping Filter 'in bookkeeping' ('already', 'notyet') + * @return int<-1,-1>|array>}> Return integer <0 if KO, array + */ + public function getAssetData(\User $user, $type = 'view', $date_start = \null, $date_end = \null, $in_bookkeeping = 'notyet') + { + } + /** + * Write bookkeeping + * + * @param User $user User who write in the bookkeeping + * @param array>}> $journal_data Journal data to write in the bookkeeping + * $journal_data = array( + * . id_element => array( + * . 'ref' => 'ref', + * . 'error' => '', + * . 'blocks' => array( + * . pos_block => array( + * . num_line => array( + * . 'doc_date' => '', + * . 'date_lim_reglement' => '', + * . 'doc_ref' => '', + * . 'date_creation' => '', + * . 'doc_type' => '', + * . 'fk_doc' => '', + * . 'fk_docdet' => '', + * . 'thirdparty_code' => '', + * . 'subledger_account' => '', + * . 'subledger_label' => '', + * . 'numero_compte' => '', + * . 'label_compte' => '', + * . 'label_operation' => '', + * . 'montant' => '', + * . 'sens' => '', + * . 'debit' => '', + * . 'credit' => '', + * . 'code_journal' => '', + * . 'journal_label' => '', + * . 'piece_num' => '', + * . 'import_key' => '', + * . 'fk_user_author' => '', + * . 'entity' => '', + * . ), + * . ), + * . ), + * . ), + * ); + * @param int $max_nb_errors Nb errors authorized before stopping the process + * @return int Return integer <0 if KO, >0 if OK + */ + public function writeIntoBookkeeping(\User $user, &$journal_data = array(), $max_nb_errors = 10) + { + } + /** + * Export journal CSV + * ISO and not UTF8 ! + * + * @param array>>}> $journal_data Journal data to write in the bookkeeping + * $journal_data = array( + * id_element => array( + * 'continue' => false, + * 'blocks' => array( + * pos_block => array( + * num_line => array( + * data to write in the CSV line + * ), + * ), + * ), + * ), + * ); + * @param int $search_date_end Search date end + * @param string $sep CSV separator + * @return int|string Return integer <0 if KO, >0 if OK + */ + public function exportCsv(&$journal_data = array(), $search_date_end = 0, $sep = '') + { + } + /** + * Get accounting account info + * + * @param string $account Accounting account number + * @return array{found:bool,label:string,code_formatted1:string,label_formatted_1:string,label_formatted_2:string} Accounting account info + */ + public function getAccountingAccountInfos($account) + { + } + } + /** + * Class for API REST v1 + */ + class DolibarrApi + { + /** + * @var DoliDB $db Database object + */ + protected $db; + /** + * @var Restler $r Restler object + */ + public $r; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $cachedir Cache dir + * @param boolean $refreshCache Update cache + */ + public function __construct($db, $cachedir = '', $refreshCache = \false) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Check and convert a string depending on its type/name. + * + * @param string $field Field name + * @param string|string[] $value Value to check/clean + * @param Object $object Object + * @return string|array Value cleaned + */ + protected function _checkValForAPI($field, $value, $object) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Filter properties that will be returned on object + * + * @param Object $object Object to clean + * @param String $properties Comma separated list of properties names + * @return Object Object with cleaned properties + */ + protected function _filterObjectProperties($object, $properties) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensitive object data + * @phpstan-template T of Object + * + * @param Object $object Object to clean + * @return Object Object with cleaned properties + * + * @phpstan-param T $object + * @phpstan-return T + */ + protected function _cleanObjectDatas($object) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Check access by user to a given resource + * + * @param string $resource element to check + * @param int $resource_id Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional). + * @param string $dbtablename 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity. Not used if objectid is null (optional) + * @param string $feature2 Feature to check, second level of permission (optional). Can be or check with 'level1|level2'. + * @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional) + * @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional) + * @return bool + */ + protected static function _checkAccessToResource($resource, $resource_id = 0, $dbtablename = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Return if a $sqlfilters parameter is valid + * Function no more used. Kept for backward compatibility with old APIs of modules + * + * @param string $sqlfilters sqlfilter string + * @param string $error Error message + * @return boolean|string True if valid, False if not valid + */ + protected function _checkFilters($sqlfilters, &$error = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Function to forge a SQL criteria from a Generic filter string. + * Function no more used. Kept for backward compatibility with old APIs of modules + * + * @param string[] $matches Array of found string by regex search. + * Each entry is 1 and only 1 criteria. + * Example: "t.ref:like:'SO-%'", "t.date_creation:<:'20160101'", "t.date_creation:<:'2016-01-01 12:30:00'", "t.nature:is:NULL", "t.field2:isnot:NULL" + * @return string Forged criteria. Example: "t.field like 'abc%'" + */ + protected static function _forge_criteria_callback($matches) + { + } + } + /** + * API class for accountancy + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + * + */ + class Accountancy extends \DolibarrApi + { + /** + * + * @var string[] $FIELDS Mandatory fields, checked when create and update object + */ + public static $FIELDS = array(); + /** + * @var BookKeeping $bookkeeping {@type BookKeeping} + */ + public $bookkeeping; + /** + * @var AccountancyExport $accountancyexport {@type AccountancyExport} + */ + public $accountancyexport; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Accountancy export data + * + * @param string $period Period : 'lastmonth', 'currentmonth', 'last3months', 'last6months', 'currentyear', 'lastyear', 'fiscalyear', 'lastfiscalyear', 'actualandlastfiscalyear' or 'custom' (see above) + * @param string $date_min [=''] Start date of period if 'custom' is set in period parameter + * Date format is 'YYYY-MM-DD' + * @param string $date_max [=''] End date of period if 'custom' is set in period parameter + * Date format is 'YYYY-MM-DD' + * @param string $format [=''] by default uses '1' for 'Configurable (CSV)' for format number + * or '1000' for FEC + * or '1010' for FEC2 + * (see AccountancyExport class) + * @param int $lettering [=0] by default don't export or 1 to export lettering data (columns 'letterring_code' and 'date_lettering' returns empty or not) + * @param int $alreadyexport [=0] by default export data only if it's not yet exported or 1 already exported (always export data even if 'date_export" is set) + * @param int $notnotifiedasexport [=0] by default notified as exported or 1 not notified as exported (when the export is done, notified or not the column 'date_export') + * + * @return string + * + * @url GET exportdata + * + * @throws RestException 401 Insufficient rights + * @throws RestException 404 Accountancy export period not found + * @throws RestException 404 Accountancy export start or end date not defined + * @throws RestException 404 Accountancy export format not found + * @throws RestException 500 Error on accountancy export + */ + public function exportData($period, $date_min = '', $date_max = '', $format = '', $lettering = 0, $alreadyexport = 0, $notnotifiedasexport = 0) + { + } + } + /** + * Class to manage Ledger (General Ledger and Subledger) + */ + class BookKeeping extends \CommonObject + { + /** + * @var string Id to identify managed objects + */ + public $element = 'accountingbookkeeping'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'accounting_bookkeeping'; + /** + * @var int Entity + */ + public $entity; + /** + * @var BookKeepingLine[] Lines + */ + public $lines = array(); + /** + * @var int ID + */ + public $id; + /** + * @var int Date of source document, in db date NOT NULL + */ + public $doc_date; + /** + * @var int Deadline for payment + */ + public $date_lim_reglement; + /** + * @var string Doc type + */ + public $doc_type; + /** + * @var string Doc ref + */ + public $doc_ref; + /** + * @var int ID + */ + public $fk_doc; + /** + * @var int ID + */ + public $fk_docdet; + /** + * @var string Thirdparty code + */ + public $thirdparty_code; + /** + * @var string|null Subledger account + */ + public $subledger_account; + /** + * @var string|null Subledger label + */ + public $subledger_label; + /** + * @var string doc_type + */ + public $numero_compte; + /** + * @var string label compte + */ + public $label_compte; + /** + * @var string label operation + */ + public $label_operation; + /** + * @var float FEC:Debit + */ + public $debit; + /** + * @var float FEC:Credit + */ + public $credit; + /** + * @var float FEC:Amount (Not necessary) + * @deprecated No more used (we have info into debit/credit and sens) + */ + public $montant; + /** + * @var float FEC:Amount (Not necessary) + * @deprecated No more used (we have info into debit/credit and sens) + */ + public $amount; + /** + * @var string FEC:Sens (Not necessary) + */ + public $sens; + /** + * @var int ID + */ + public $fk_user_author; + /** + * @var string key for import + */ + public $import_key; + /** + * @var string code journal + */ + public $code_journal; + /** + * @var string label journal + */ + public $journal_label; + /** + * @var int accounting transaction id + */ + public $piece_num; + /** + * @var BookKeepingLine[] Movement line array + */ + public $linesmvt = array(); + /** + * @var BookKeepingLine[] export line array + */ + public $linesexport = array(); + /** + * @var int|string date of movement who are noticed like exported + */ + public $date_export; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'generic'; + /** + * @var string[] SQL filter used for check if the bookkeeping record can be created/inserted/modified/deleted (cached) + */ + public static $can_modify_bookkeeping_sql_cached; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger false=launch triggers after, true=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger false=launch triggers after, true=disable triggers + * @param string $mode Mode + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function createStd(\User $user, $notrigger = 0, $mode = '') + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string|null $ref Ref + * @param string $mode Mode ('' or 'tmp_') + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = \null, $mode = '') + { + } + /** + * Load object in memory from the database in ->lines. Or just make a simple count if $countonly=1. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset offset limit + * @param array $filter filter array + * @param string $filtermode filter mode (AND or OR) + * @param int $option option (0: general account or 1: subaccount) + * @param int $countonly Do not fill the $object->lines, return only the count. + * @return int Return integer <0 if KO, Number of lines if OK + */ + public function fetchAllByAccount($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND', $option = 0, $countonly = 0) + { + } + /** + * Load object in memory from the database + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit Limit + * @param int $offset Offset limit + * @param string|array $filter Filter array + * @param string $filtermode Filter mode (AND or OR) + * @param int $showAlreadyExportMovements Show movements when field 'date_export' is not empty (0:No / 1:Yes (Default)) + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND', $showAlreadyExportMovements = 1) + { + } + /** + * Load object in memory from the database + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit Limit + * @param int $offset Offset limit + * @param string|array $filter Filter + * @param string $filtermode Filter mode (AND or OR) + * @param int $option option (0: aggregate by general account or 1: aggreegate by subaccount) + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetchAllBalance($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND', $option = 0) + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger false=launch triggers after, true=disable triggers + * @param string $mode Mode ('' or _tmp') + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0, $mode = '') + { + } + /** + * Update accounting movement + * + * @param string $piece_num Piece num + * @param string $field Field + * @param string $value Value + * @param string $mode Mode ('' or _tmp') + * @return int Return integer <0 if KO, >0 if OK + */ + public function updateByMvt($piece_num = '', $field = '', $value = '', $mode = '') + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @param string $mode Mode ('' or 'tmp_') + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0, $mode = '') + { + } + /** + * Delete bookkeeping by importkey + * + * @param string $importkey Import key + * @param string $mode Mode + * @return int Result + */ + public function deleteByImportkey($importkey, $mode = '') + { + } + /** + * Delete bookkeeping by year + * + * @param int $delyear Year to delete + * @param string $journal Journal to delete + * @param string $mode Mode + * @param int $delmonth Month + * @return int Return integer <0 if KO, >0 if OK + */ + public function deleteByYearAndJournal($delyear = 0, $journal = '', $mode = '', $delmonth = 0) + { + } + /** + * Delete bookkeeping by piece number + * + * @param int $piecenum Piecenum to delete + * @param string $mode Mode ('' or '_tmp') + * @return int Result + */ + public function deleteMvtNum($piecenum, $mode = '') + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $user User making the clone + * @param int $fromid Id of object to clone + * @return int New id of clone + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Load an accounting document into memory from database + * + * @param int $piecenum Accounting document to get + * @param string $mode Mode + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetchPerMvt($piecenum, $mode = '') + { + } + /** + * Return next movement number + * + * @param string $mode Mode + * @return int<1, max>|-1 Return next movement number or -1 if error + */ + public function getNextNumMvt($mode = '') + { + } + /** + * Load all accounting lines related to a given transaction ID $piecenum + * + * @param int $piecenum Id of line to get + * @param string $mode Mode ('' or '_tmp') + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetchAllPerMvt($piecenum, $mode = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Export bookkeeping + * + * @param string $model Model + * @return int Result + */ + public function export_bookkeeping($model = 'ebp') + { + } + /** + * Transform transaction + * + * @param int $direction If 0: tmp => real, if 1: real => tmp + * @param string $piece_num Piece num = Transaction ref + * @return int int Return integer <0 if KO, >0 if OK + */ + public function transformTransaction($direction = 0, $piece_num = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of accounts with label by chart of accounts + * + * @param string $selectid Preselected chart of accounts + * @param string $htmlname Name of field in html form + * @param int<0,1> $showempty Add an empty field + * @param array}> $event Event options + * @param int $select_in Value is a aa.rowid (0 default) or aa.account_number (1) + * @param int $select_out Set value returned by select 0=rowid (default), 1=account_number + * @param string $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account starting from this number + * @return string|int String with HTML select or -1 if KO + */ + public function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '') + { + } + /** + * Return id and description of a root accounting account. + * FIXME: This function takes the parent of parent to get the root account ! + * + * @param string $account Accounting account + * @return array{id:int,account_number:string,label:string}|int<-1,-1> Array with root account information (max 2 upper level), <0 if KO + */ + public function getRootAccount($account = \null) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Description of accounting account + * + * @param string $account Accounting account + * @return string|int Account desc or -1 if KO + */ + public function get_compte_desc($account = \null) + { + } + /** + * Get SQL string for check if the bookkeeping can be modified or deleted ? (cached) + * + * @param string $alias Bookkeeping alias table + * @param bool $force Force reload + * @return string|null SQL filter or null if error + */ + public function getCanModifyBookkeepingSQL($alias = '', $force = \false) + { + } + /** + * Is the bookkeeping can be modified or deleted ? + * + * @param int $id Bookkeeping ID + * @param string $mode Mode ('' or 'tmp_') + * @return int Return integer <0 if KO, == 0 if No, == 1 if Yes + */ + public function canModifyBookkeeping($id, $mode = '') + { + } + /** + * Is the bookkeeping date valid (on an open period or not on a closed period) ? + * + * @param int $date Bookkeeping date + * @return int Return integer <0 if KO, == 0 if No, == 1 if date is valid for a transfer + */ + public function validBookkeepingDate($date) + { + } + /** + * Load list of active fiscal period + * + * @param bool $force Force reload + * @param string $mode active or closed ? + * @return int Return integer <0 if KO, >0 if OK + */ + public function loadFiscalPeriods($force = \false, $mode = 'active') + { + } + /** + * Get list of fiscal period + * + * @param string $filter Filter + * @return array|int Return integer <0 if KO, Fiscal periods : [[id, date_start, date_end, label], ...] + */ + public function getFiscalPeriods($filter = '') + { + } + /** + * Get list of count by month into the fiscal period + * + * @param int $date_start Date start + * @param int $date_end Date end + * @return array{total:int,list:array,int>,total:int}>}|int<-1,-1> Return integer <0 if KO, Fiscal periods : [[id, date_start, date_end, label], ...] + */ + public function getCountByMonthForFiscalPeriod($date_start, $date_end) + { + } + /** + * Validate all movement between the specified dates + * + * @param int $date_start Date start + * @param int $date_end Date end + * @return int int Return integer <0 if KO, >0 if OK + */ + public function validateMovementForFiscalPeriod($date_start, $date_end) + { + } + /** + * Define accounting result + * + * @param int $date_start Date start + * @param int $date_end Date end + * @return string Accounting result + */ + public function accountingResult($date_start, $date_end) + { + } + /** + * Close fiscal period + * + * @param int $fiscal_period_id Fiscal year ID + * @param int $new_fiscal_period_id New fiscal year ID + * @param bool $separate_auxiliary_account Separate auxiliary account + * @param bool $generate_bookkeeping_records Generate closure bookkeeping records + * @return int int Return integer <0 if KO, >0 if OK + */ + public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $separate_auxiliary_account = \false, $generate_bookkeeping_records = \true) + { + } + /** + * Insert accounting reversal into the inventory journal of the new fiscal period + * + * @param int $fiscal_period_id Fiscal year ID + * @param int $inventory_journal_id Inventory journal ID + * @param int $new_fiscal_period_id New fiscal year ID + * @param int $date_start Date start + * @param int $date_end Date end + * @return int int Return integer <0 if KO, >0 if OK + */ + public function insertAccountingReversal($fiscal_period_id, $inventory_journal_id, $new_fiscal_period_id, $date_start, $date_end) + { + } + } + /* Copyright (C) 2006-2008 Laurent Destailleur + * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * + * 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 . + */ + /** + * \file htdocs/core/class/commonobjectline.class.php + * \ingroup core + * \brief File of the superclass of classes of lines of business objects (invoice, contract, proposal, orders, etc. ...) + */ + /** + * Parent class for class inheritance lines of business objects + * This class is useless for the moment so no inherit are done on it + * + * TODO For the moment we use the extends on CommonObject until PHP min is 5.4 so we can use Traits. + */ + abstract class CommonObjectLine extends \CommonObject + { + /** + * @var string ID to identify parent CommonObject type (element name) + */ + public $parent_element = ''; + /** + * @var string Attribute related to parent CommonObject rowid (many2one) + */ + public $fk_parent_attribute = ''; + /** + * Id of the line + * @var int + */ + public $id; + /** + * Id of the line + * @var int + * @deprecated Try to use id property as possible (even if field into database is still rowid) + * @see $id + */ + public $rowid; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'line'; + /** + * @var int|null ID of the unit of measurement (rowid in llx_c_units table) + * @see measuringUnitString() + * @see getLabelOfUnit() + */ + public $fk_unit; + public $date_debut_prevue; + public $date_debut_reel; + public $date_fin_prevue; + public $date_fin_reel; + public $weight; + public $weight_units; + public $width; + public $width_units; + public $height; + public $height_units; + public $length; + public $length_units; + public $surface; + public $surface_units; + public $volume; + public $volume_units; + public $multilangs; + /** + * @var int type in line + */ + public $product_type; + /** + * @var int product id in line (when line is linked to a product or service) + */ + public $fk_product; + /** + * Description of the line + * @var string + */ + public $desc; + /** + * Description of the line + * @var string + * @deprecated + * @see $desc + */ + public $description; + /** + * @var Product Object product to store full product object after a fetch_product() on a line + */ + public $product; + /** + * @var string reference in product table + */ + public $product_ref; + /** + * @var string label in product table + */ + public $product_label; + /** + * @var string barcode in product table + */ + public $product_barcode; + /** + * @var string description in product table + */ + public $product_desc; + /** + * @var int type in product table + */ + public $fk_product_type; + /** + * @var float Quantity + */ + public $qty; + public $duree; + public $remise_percent; + /** + * List of cumulative options: + * Bit 0: 0 for common VAT - 1 if VAT french NPR + * Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except) + * @var int + */ + public $info_bits; + /** + * @var int special code + */ + public $special_code; + /** + * Unit price before taxes + * @var float + */ + public $subprice; + public $tva_tx; + /** + * @var int multicurrency id + */ + public $fk_multicurrency; + /** + * @var string Multicurrency code + */ + public $multicurrency_code; + /** + * @var float Multicurrency subprice + */ + public $multicurrency_subprice; + /** + * @var float Multicurrency total without tax + */ + public $multicurrency_total_ht; + /** + * @var float Multicurrency total vat + */ + public $multicurrency_total_tva; + /** + * @var float Multicurrency total with tax + */ + public $multicurrency_total_ttc; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Returns the label, short_label or code found in units dictionary from ->fk_unit. + * A langs->trans() must be called on result to get translated value. + * + * @param string $type Label type ('long', 'short' or 'code'). This can be a translation key. + * @return string|int Return integer <0 if KO, label if OK (Example: 'long', 'short' or 'unitCODE') + */ + public function getLabelOfUnit($type = 'long') + { + } + /** + * Empty function to prevent errors on call of this function. Must be overload if useful + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit Limit the number of lines returned + * @param int $offset Offset + * @param string|array $filter Filter as an Universal Search string. + * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')' + * @param string $filtermode No more used + * @return array|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') + { + } + } + /** + * Class BookKeepingLine + */ + class BookKeepingLine extends \CommonObjectLine + { + /** + * @var int ID + */ + public $id; + /** + * @var ?int Date of source document + */ + public $doc_date = \null; + /** + * @var string Doc type + */ + public $doc_type; + /** + * @var string Doc ref + */ + public $doc_ref; + /** + * @var int ID + */ + public $fk_doc; + /** + * @var int ID + */ + public $fk_docdet; + /** + * @var string Thirdparty code + */ + public $thirdparty_code; + /** + * @var string|null Subledger account + */ + public $subledger_account; + /** + * @var string|null Subledger label + */ + public $subledger_label; + /** + * @var string doc_type + */ + public $numero_compte; + /** + * @var string label compte + */ + public $label_compte; + /** + * @var string label operation + */ + public $label_operation; + /** + * @var float FEC:Debit + */ + public $debit; + /** + * @var float FEC:Credit + */ + public $credit; + /** + * @var float Amount + * @deprecated see $amount + */ + public $montant; + /** + * @var float Amount + */ + public $amount; + /** + * @var float Multicurrency amount + */ + public $multicurrency_amount; + /** + * @var string Multicurrency code + */ + public $multicurrency_code; + /** + * @var string Sens + */ + public $sens; + /** + * @var ?string + */ + public $lettering_code; + /** + * @var string + */ + public $date_lettering; + /** + * @var int ID + */ + public $fk_user_author; + /** + * @var string key for import + */ + public $import_key; + /** + * @var string + */ + public $code_journal; + /** + * @var string + */ + public $journal_label; + /** + * @var int accounting transaction id + */ + public $piece_num; + /** + * @var int|string $date_export; + */ + public $date_export; + /** + * @var int|string $date_lim_reglement; + */ + public $date_lim_reglement; + } + /** + * Class Lettering + */ + class Lettering extends \BookKeeping + { + /** + * @var array}> + */ + public static $doc_type_infos = array('customer_invoice' => array('payment_table' => 'paiement', 'payment_table_fk_bank' => 'fk_bank', 'doc_payment_table' => 'paiement_facture', 'doc_payment_table_fk_payment' => 'fk_paiement', 'doc_payment_table_fk_doc' => 'fk_facture', 'linked_info' => array(array('table' => 'paiement_facture', 'fk_doc' => 'fk_facture', 'fk_link' => 'fk_paiement', 'prefix' => 'p'), array('table' => 'societe_remise_except', 'fk_doc' => 'fk_facture_source', 'fk_link' => 'fk_facture', 'fk_line_link' => 'fk_facture_line', 'table_link_line' => 'facturedet', 'fk_table_link_line' => 'rowid', 'fk_table_link_line_parent' => 'fk_facture', 'prefix' => 'a', 'is_fk_link_is_also_fk_doc' => \true))), 'supplier_invoice' => array('payment_table' => 'paiementfourn', 'payment_table_fk_bank' => 'fk_bank', 'doc_payment_table' => 'paiementfourn_facturefourn', 'doc_payment_table_fk_payment' => 'fk_paiementfourn', 'doc_payment_table_fk_doc' => 'fk_facturefourn', 'linked_info' => array(array('table' => 'paiementfourn_facturefourn', 'fk_doc' => 'fk_facturefourn', 'fk_link' => 'fk_paiementfourn', 'prefix' => 'p'), array('table' => 'societe_remise_except', 'fk_doc' => 'fk_invoice_supplier_source', 'fk_link' => 'fk_invoice_supplier', 'fk_line_link' => 'fk_invoice_supplier_line', 'table_link_line' => 'facture_fourn_det', 'fk_table_link_line' => 'rowid', 'fk_table_link_line_parent' => 'fk_facture_fourn', 'prefix' => 'a', 'is_fk_link_is_also_fk_doc' => \true)))); + /** + * letteringThirdparty + * + * @param int $socid Thirdparty id + * @return int 1 OK, <0 error + */ + public function letteringThirdparty($socid) + { + } + /** + * + * @param int[] $ids ids array + * @param int $notrigger no trigger + * @param bool $partial Partial lettering + * @return int + */ + public function updateLettering($ids = array(), $notrigger = 0, $partial = \false) + { + } + /** + * + * @param int[] $ids ids array + * @param int $notrigger no trigger + * @return int Nb of affectd rows or <0 if error + */ + public function deleteLettering($ids, $notrigger = 0) + { + } + /** + * Lettering bookkeeping lines all types + * + * @param int[] $bookkeeping_ids Lettering specific list of bookkeeping id + * @param bool $unlettering Do unlettering + * @return int Return integer <0 if error (nb lettered = result -1), 0 if noting to lettering, >0 if OK (nb lettered) + */ + public function bookkeepingLetteringAll($bookkeeping_ids, $unlettering = \false) + { + } + /** + * Lettering bookkeeping lines + * + * @param int[] $bookkeeping_ids Lettering specific list of bookkeeping id + * @param bool $unlettering Do unlettering + * @return int Return integer <0 if error (nb lettered = result -1), 0 if noting to lettering, >0 if OK (nb lettered) + */ + public function bookkeepingLettering($bookkeeping_ids, $unlettering = \false) + { + } + /** + * Lettering bookkeeping lines + * + * @param int[] $bookkeeping_ids Lettering specific list of bookkeeping id + * @param bool $only_has_subledger_account Get only lines who have subledger account + * @return int<-1,-1>|array> Return integer <0 if error otherwise all linked lines by block + */ + public function getLinkedLines($bookkeeping_ids, $only_has_subledger_account = \true) + { + } + /** + * Get all fk_doc by doc_type from list of bank ids + * + * @param int[] $bank_ids List of bank ids + * @return array>|int Return integer <0 if error otherwise all fk_doc by doc_type + */ + public function getDocTypeAndFkDocFromBankLines($bank_ids) + { + } + /** + * Get all bank ids from list of document ids of a type + * + * @param array $document_ids List of document id + * @param string $doc_type Type of document ('customer_invoice' or 'supplier_invoice', ...) + * @return array|int<-1,-1> Return integer <0 if error otherwise all all bank ids from list of document ids of a type + */ + public function getBankLinesFromFkDocAndDocType($document_ids, $doc_type) + { + } + /** + * Get all linked document ids by group and type + * + * @param int[] $document_ids List of document id + * @param string $doc_type Type of document ('customer_invoice' or 'supplier_invoice', ...) + * @return array>|int<-1,-1> Return integer <0 if error otherwise all linked document ids by group and type [ [ 'doc_type' => [ doc_id, ... ], ... ], ... ] + */ + public function getLinkedDocumentByGroup($document_ids, $doc_type) + { + } + /** + * Get element ids grouped by link or element in common + * + * @param array> $link_by_element List of payment ids by link key + * @param array> $element_by_link List of element ids by link key + * @param string $link_key Link key (used for recursive function) + * @param array $current_group Current group (used for recursive function) + * @return array> List of element ids grouped by link or element in common + */ + public function getGroupElements(&$link_by_element, &$element_by_link, $link_key = '', &$current_group = array()) + { + } + } + /* Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2012 Philippe Grand + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/adherents/canvas/actions_adherentcard_common.class.php + * \ingroup adherent + * \brief File of class Thirdparty member card controller (common) + */ + /** + * Class to manage members using default canvas + */ + abstract class ActionsAdherentCardCommon + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string + */ + public $dirmodule; + /** + * @var string + */ + public $targetmodule; + /** + * @var string + */ + public $canvas; + /** + * @var string + */ + public $card; + /** + * @var array Template container + */ + public $tpl = array(); + /** + * @var Object container + */ + public $object; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + /** + * Get object + * + * @param int $id Object id + * @return Adherent Object loaded + */ + public function getObject($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set content of ->tpl array, to use into template + * + * @param string $action Type of action + * @param int $id Id + * @return void + */ + public function assign_values(&$action, $id) + { + } + } + /** + * \class ActionsAdherentCardDefault + * \brief Class allowing the management of the members by default + */ + class ActionsAdherentCardDefault extends \ActionsAdherentCardCommon + { + /** + * Constructor + * + * @param DoliDB $db Handler access data base + * @param string $dirmodule Name of directory of module + * @param string $targetmodule Name of directory of module where canvas is stored + * @param string $canvas Name of canvas + * @param string $card Name of tab (sub-canvas) + */ + public function __construct($db, $dirmodule, $targetmodule, $canvas, $card) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Assign custom values for canvas + * + * @param string $action Type of action + * @param int $id Id + * @return void + */ + public function assign_values(&$action, $id) + { + } + } + /* Copyright (C) 2023 Frédéric France + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/core/class/commonpeople.class.php + * \ingroup core + * \brief File of the superclass of object classes that support people + */ + /** + * Support class for third parties, contacts, members, users or resources + * + * + * Properties expected in the host class receiving this trait. + * + * @property int $id + * @property int $contact_id + * @property int $fk_soc + * @property string $civility_code + * @property DoliDB $db + * @property string $element + * @property string $name + * @property string $name_alias + * @property string $nom + * @property string $company + * @property string $firstname + * @property string $lastname + * @property string $personal_email + * @property array $socialnetworks + * @property string $fax + * @property string $office_fax + * @property string $office_phone + * @property string $phone + * @property string $phone_perso + * @property string $phone_pro + * @property string $phone_mobile + * @property string $user_mobile + * @property string $country_code + * @property string $region + */ + trait CommonPeople + { + /** + * @var string Address + */ + public $address; + /** + * @var string zip code + */ + public $zip; + /** + * @var string town + */ + public $town; + /** + * @var int The state/department + */ + public $state_id; + /** + * @var string + */ + public $state_code; + /** + * @var string + */ + public $state; + /** + * @var string email + */ + public $email; + /** + * @var string url + */ + public $url; + /** + * Return full name (civility+' '+name+' '+lastname) + * + * @param Translate $langs Language object for translation of civility (used only if option is 1) + * @param int $option 0=No option, 1=Add civility + * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname, 3=Firstname if defined else lastname, 4=Lastname, 5=Lastname if defined else firstname + * @param int $maxlen Maximum length + * @return string String with full name + */ + public function getFullName($langs, $option = 0, $nameorder = -1, $maxlen = 0) + { + } + /** + * Return full address for banner + * + * @param string $htmlkey HTML id to make banner content unique + * @param Object $object Object (thirdparty, thirdparty of contact for contact, null for a member) + * @return string Full address string + */ + public function getBannerAddress($htmlkey, $object) + { + } + /** + * Set to upper or ucwords/lower if needed + * + * @return void + */ + public function setUpperOrLowerCase() + { + } + // Methods used by this Trait that must be implemented in the parent class. + // Note: this helps static type checking + /** + * Return full address of contact + * + * @param int<0,1> $withcountry 1=Add country into address string + * @param string $sep Separator to use to build string + * @param int<0,1> $withregion 1=Add region into address string + * @param string $extralangcode User extralanguages as value + * @return string Full address string + */ + public abstract function getFullAddress($withcountry = 0, $sep = "\n", $withregion = 0, $extralangcode = ''); + /** + * Function to get alternative languages of a data into $this->array_languages + * This method is NOT called by method fetch of objects but must be called separately. + * + * @return int<-1,1> Return integer <0 if error, 0 if no values of alternative languages to find nor found, 1 if a value was found and loaded + * @see fetch_optionnals() + */ + public abstract function fetchValuesForExtraLanguages(); + } + /** + * Class to manage members of a foundation + */ + class Adherent extends \CommonObject + { + use \CommonPeople; + /** + * @var string ID to identify managed object + */ + public $element = 'member'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'adherent'; + /** + * @var string picto + */ + public $picto = 'member'; + /** + * @var string[] array of messages + */ + public $mesgs; + /** + * @var string login of member + */ + public $login; + /** + * @var string Clear password in memory + */ + public $pass; + /** + * @var string Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0) + */ + public $pass_indatabase; + /** + * @var string Encrypted password in database (always defined) + */ + public $pass_indatabase_crypted; + /** + * @var string fullname + */ + public $fullname; + /** + * @var string + * @deprecated Use $civility_code + * @see $civility_code + */ + public $civility_id; + /** + * @var string The civility code, not an integer (ex: 'MR', 'MME', 'MLE', etc.) + */ + public $civility_code; + /** + * @var int + */ + public $civility; + /** + * @var string company name + * @deprecated Use $company + * @see $company + */ + public $societe; + /** + * @var string company name + */ + public $company; + /** + * @var int Thirdparty ID + * @deprecated Use $socid + * @see $socid + */ + public $fk_soc; + /** + * @var int socid + */ + public $socid; + /** + * @var array array of socialnetworks + */ + public $socialnetworks; + /** + * @var string Phone number + */ + public $phone; + /** + * @var string Private Phone number + */ + public $phone_perso; + /** + * @var string Professional Phone number + */ + public $phone_pro; + /** + * @var string Mobile phone number + */ + public $phone_mobile; + /** + * @var string Fax number + */ + public $fax; + /** + * @var string Function + */ + public $poste; + /** + * @var string mor or phy + */ + public $morphy; + /** + * @var int Info can be public + */ + public $public; + /** + * Default language code of member (en_US, ...) + * @var string + */ + public $default_lang; + /** + * @var string photo of member + */ + public $photo; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + /** + * Date modification record (tms) + * + * @var integer + */ + public $datem; + /** + * @var string|int + */ + public $datevalid; + /** + * @var string gender + */ + public $gender; + /** + * @var int|string date of birth + */ + public $birth; + /** + * @var int id type member + */ + public $typeid; + /** + * @var string label type member + */ + public $type; + /** + * @var int need_subscription + */ + public $need_subscription; + /** + * @var int user_id + */ + public $user_id; + /** + * @var string user_login + */ + public $user_login; + /** + * @var string|int + */ + public $datefin; + // Fields loaded by fetch_subscriptions() from member table + /** + * @var int|string date + */ + public $first_subscription_date; + /** + * @var int|string date + */ + public $first_subscription_date_start; + /** + * @var int|string date + */ + public $first_subscription_date_end; + /** + * @var int|string date + */ + public $first_subscription_amount; + /** + * @var int|string date + */ + public $last_subscription_date; + /** + * @var int|string date + */ + public $last_subscription_date_start; + /** + * @var int|string date + */ + public $last_subscription_date_end; + /** + * @var int|string date + */ + public $last_subscription_amount; + /** + * @var Subscription[] + */ + public $subscriptions = array(); + /** + * @var string ip + */ + public $ip; + // Fields loaded by fetchPartnerships() from partnership table + /** + * @var array> + */ + public $partnerships = array(); + /** + * @var ?Facture To store the created invoice into subscriptionComplementaryActions() + */ + public $invoice; + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), 'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'default' => '1', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 12, 'index' => 1), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), 'ref_ext' => array('type' => 'varchar(128)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 20), 'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => -1, 'position' => 25), 'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'showoncombobox' => 1), 'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => 1, 'position' => 35, 'showoncombobox' => 1), 'login' => array('type' => 'varchar(50)', 'label' => 'Login', 'enabled' => 1, 'visible' => 1, 'position' => 40), 'pass' => array('type' => 'varchar(50)', 'label' => 'Pass', 'enabled' => 1, 'visible' => -1, 'position' => 45), 'pass_crypted' => array('type' => 'varchar(128)', 'label' => 'Pass crypted', 'enabled' => 1, 'visible' => -1, 'position' => 50), 'morphy' => array('type' => 'varchar(3)', 'label' => 'MemberNature', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 55), 'fk_adherent_type' => array('type' => 'integer', 'label' => 'Fk adherent type', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 60), 'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => 1, 'position' => 65, 'showoncombobox' => 2), 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => 1, 'position' => 70), 'address' => array('type' => 'text', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 75), 'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80), 'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 85), 'state_id' => array('type' => 'integer', 'label' => 'State id', 'enabled' => 1, 'visible' => -1, 'position' => 90), 'country' => array('type' => 'integer:Ccountry:core/class/ccountry.class.php', 'label' => 'Country', 'enabled' => 1, 'visible' => 1, 'position' => 95), 'phone' => array('type' => 'varchar(30)', 'label' => 'Phone', 'enabled' => 1, 'visible' => -1, 'position' => 115), 'phone_perso' => array('type' => 'varchar(30)', 'label' => 'Phone perso', 'enabled' => 1, 'visible' => -1, 'position' => 120), 'phone_mobile' => array('type' => 'varchar(30)', 'label' => 'Phone mobile', 'enabled' => 1, 'visible' => -1, 'position' => 125), 'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'visible' => 1, 'position' => 126), 'url' => array('type' => 'varchar(255)', 'label' => 'Url', 'enabled' => 1, 'visible' => -1, 'position' => 127), 'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => -1, 'position' => 128), 'birth' => array('type' => 'date', 'label' => 'DateOfBirth', 'enabled' => 1, 'visible' => -1, 'position' => 130), 'gender' => array('type' => 'varchar(10)', 'label' => 'Gender', 'enabled' => 1, 'visible' => -1, 'position' => 132), 'photo' => array('type' => 'varchar(255)', 'label' => 'Photo', 'enabled' => 1, 'visible' => -1, 'position' => 135), 'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 145), 'datefin' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => 1, 'position' => 150), 'default_lang' => array('type' => 'varchar(6)', 'label' => 'Default lang', 'enabled' => 1, 'visible' => -1, 'position' => 153), 'note_public' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155), 'note_private' => array('type' => 'text', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 160), 'datevalid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 165), 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175), 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 180), 'fk_user_mod' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user mod', 'enabled' => 1, 'visible' => -1, 'position' => 185), 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 190), 'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => -1, 'position' => 195), 'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 500, 'arrayofkeyval' => array(-1 => 'Draft', 1 => 'Validated', 0 => 'MemberStatusResiliatedShort', -2 => 'MemberStatusExcludedShort')), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 800), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 805)); + /** + * Draft status + */ + const STATUS_DRAFT = -1; + /** + * Validated status + */ + const STATUS_VALIDATED = 1; + /** + * Resiliated + */ + const STATUS_RESILIATED = 0; + /** + * Excluded + */ + const STATUS_EXCLUDED = -2; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Function sending an email to the current member with the text supplied in parameter. + * + * @param string $text Content of message (not html entities encoded) + * @param string $subject Subject of message + * @param string[] $filename_list Array of attached files + * @param string[] $mimetype_list Array of mime types of attached files + * @param string[] $mimefilename_list Array of public names of attached files + * @param string $addr_cc Email cc + * @param string $addr_bcc Email bcc + * @param int $deliveryreceipt Ask a delivery receipt + * @param int $msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown need autodetection + * @param string $errors_to errors to + * @param string $moreinheader Add more html headers + * @deprecated since V18 + * @see sendEmail() + * @return int Return integer <0 if KO, >0 if OK + */ + public function send_an_email($text, $subject, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = -1, $errors_to = '', $moreinheader = '') + { + } + /** + * Function sending an email to the current member with the text supplied in parameter. + * + * @param string $text Content of message (not html entities encoded) + * @param string $subject Subject of message + * @param string[] $filename_list Array of attached files + * @param string[] $mimetype_list Array of mime types of attached files + * @param string[] $mimefilename_list Array of public names of attached files + * @param string $addr_cc Email cc + * @param string $addr_bcc Email bcc + * @param int $deliveryreceipt Ask a delivery receipt + * @param int $msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown need autodetection + * @param string $errors_to errors to + * @param string $moreinheader Add more html headers + * @since V18 + * @return int Return integer <0 if KO, >0 if OK + */ + public function sendEmail($text, $subject, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = -1, $errors_to = '', $moreinheader = '') + { + } + /** + * Make substitution of tags into text with value of current object. + * + * @param string $text Text to make substitution to + * @return string Value of input text string with substitutions done + */ + public function makeSubstitution($text) + { + } + /** + * Return translated label by the nature of a adherent (physical or moral) + * + * @param string $morphy Nature of the adherent (physical or moral) + * @param int<0,2> $addbadge Add badge (1=Full label, 2=First letters only) + * @return string Label + */ + public function getmorphylib($morphy = '', $addbadge = 0) + { + } + /** + * Create a member into database + * + * @param User $user Object user qui demande la creation + * @param int $notrigger 1 ne declenche pas les triggers, 0 sinon + * @return int Return integer <0 if KO, >0 if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Update a member in database (standard information and password) + * + * @param User $user User making update + * @param int $notrigger 1=disable trigger UPDATE (when called by create) + * @param int $nosyncuser 0=Synchronize linked user (standard info), 1=Do not synchronize linked user + * @param int $nosyncuserpass 0=Synchronize linked user (password), 1=Do not synchronize linked user + * @param int $nosyncthirdparty 0=Synchronize linked thirdparty (standard info), 1=Do not synchronize linked thirdparty + * @param string $action Current action for hookmanager + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass = 0, $nosyncthirdparty = 0, $action = 'update') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update denormalized last subscription date. + * This function is called when we delete a subscription for example. + * + * @param User $user User making change + * @return int Return integer <0 if KO, >0 if OK + */ + public function update_end_date($user) + { + } + /** + * Fonction to delete a member and its data + * + * @param User $user User object + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, 0=nothing to do, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Change password of a user + * + * @param User $user Object user de l'utilisateur qui fait la modification + * @param string $password New password (to generate if empty) + * @param int $isencrypted 0 ou 1 if the password needs to be encrypted in the DB (default: 0) + * @param int $notrigger 1=Does not raise the triggers + * @param int $nosyncuser Do not synchronize linked user + * @return string|int Clear password if change ok, 0 if no change, <0 if error + */ + public function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0) + { + } + /** + * Set link to a user + * + * @param int $userid Id of user to link to + * @return int 1=OK, -1=KO + */ + public function setUserId($userid) + { + } + /** + * Set link to a third party + * + * @param int $thirdpartyid Id of user to link to + * @return int 1=OK, -1=KO + */ + public function setThirdPartyId($thirdpartyid) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Method to load member from its login + * + * @param string $login login of member + * @return void + */ + public function fetch_login($login) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Method to load member from its name + * + * @param string $firstname Firstname + * @param string $lastname Lastname + * @return void + */ + public function fetch_name($firstname, $lastname) + { + } + /** + * Load member from database + * + * @param int $rowid Id of object to load + * @param string $ref To load member from its ref + * @param int $fk_soc To load member from its link to third party + * @param string $ref_ext External reference + * @param bool $fetch_optionals To load optionals (extrafields) + * @param bool $fetch_subscriptions To load member subscriptions + * @return int >0 if OK, 0 if not found, <0 if KO + */ + public function fetch($rowid, $ref = '', $fk_soc = 0, $ref_ext = '', $fetch_optionals = \true, $fetch_subscriptions = \true) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Function to get member subscriptions data: + * subscriptions, + * first_subscription_date, first_subscription_date_start, first_subscription_date_end, first_subscription_amount + * last_subscription_date, last_subscription_date_start, last_subscription_date_end, last_subscription_amount + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch_subscriptions() + { + } + /** + * Function to get partnerships array + * + * @param string $mode 'member' or 'thirdparty' + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetchPartnerships($mode) + { + } + /** + * Insert subscription into database and eventually add links to banks, mailman, etc... + * + * @param int $date Date of effect of subscription + * @param double $amount Amount of subscription (0 accepted for some members) + * @param int $accountid Id bank account. NOT USED. + * @param string $operation Code of payment mode (if Id bank account provided). Example: 'CB', ... NOT USED. + * @param string $label Label operation (if Id bank account provided). + * @param string $num_chq Numero cheque (if Id bank account provided) + * @param string $emetteur_nom Name of cheque writer + * @param string $emetteur_banque Name of bank of cheque + * @param int $datesubend Date end subscription + * @param int $fk_type Member type id + * @return int rowid of record added, <0 if KO + */ + public function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0, $fk_type = \null) + { + } + /** + * Do complementary actions after subscription recording. + * + * @param int $subscriptionid Id of created subscription + * @param string $option Which action ('bankdirect', 'bankviainvoice', 'invoiceonly', ...) + * @param int $accountid Id bank account + * @param int $datesubscription Date of subscription + * @param int $paymentdate Date of payment + * @param string $operation Code of type of operation (if Id bank account provided). Example 'CB', ... + * @param string $label Label operation (if Id bank account provided) + * @param double $amount Amount of subscription (0 accepted for some members) + * @param string $num_chq Numero cheque (if Id bank account provided) + * @param string $emetteur_nom Name of cheque writer + * @param string $emetteur_banque Name of bank of cheque + * @param int $autocreatethirdparty Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice. + * @param string $ext_payment_id External id of payment (for example Stripe charge id) + * @param string $ext_payment_site Name of external paymentmode (for example 'stripe') + * @return int Return integer <0 if KO, >0 if OK + */ + public function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom = '', $emetteur_banque = '', $autocreatethirdparty = 0, $ext_payment_id = '', $ext_payment_site = '') + { + } + /** + * Function that validate a member + * + * @param User $user user adherent qui valide + * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK + */ + public function validate($user) + { + } + /** + * Fonction qui resilie un adherent + * + * @param User $user User making change + * @return int Return integer <0 if KO, >0 if OK + */ + public function resiliate($user) + { + } + /** + * Functiun to exclude (set adherent.status to -2) a member + * TODO + * A private note should be added to know why the member has been excluded + * For historical purpose it add an "extra-subscription" type excluded + * + * @param User $user User making change + * @return int Return integer <0 if KO, >0 if OK + */ + public function exclude($user) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Function to add member into external tools mailing-list, spip, etc. + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function add_to_abo() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Function to delete a member from external tools like mailing-list, spip, etc. + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function del_to_abo() + { + } + /** + * Return civility label of a member + * + * @return string Translated name of civility (translated with transnoentitiesnoconv) + */ + public function getCivilityLabel() + { + } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array{picto:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} + */ + public function getTooltipContentArray($params) + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int $withpictoimg 0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small, -4=???) + * @param int $maxlen length max label + * @param string $option Page for link ('card', 'category', 'subscription', ...) + * @param string $mode ''=Show firstname+lastname as label (using default order), 'firstname'=Show only firstname, 'lastname'=Show only lastname, 'login'=Show login, 'ref'=Show ref + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $notooltip 1=Disable tooltip + * @param int $addlinktonotes 1=Add link to notes + * @return string Chaine avec URL + */ + public function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1, $notooltip = 0, $addlinktonotes = 0) + { + } + /** + * Retourne le libelle du statut d'un adherent (brouillon, valide, resilie, exclu) + * + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Label + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Renvoi le libelle d'un statut donne + * + * @param int $status Id status + * @param int $need_subscription 1 if member type need subscription, 0 otherwise + * @param int $date_end_subscription Date fin adhesion + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label + */ + public function LibStatut($status, $need_subscription, $date_end_subscription, $mode = 0) + { + } + /** + * Load indicators this->nb in state board + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function loadStateBoard() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @param string $mode "expired" for membership to renew, "shift" for member to validate + * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK + */ + public function load_board($user, $mode) + { + } + /** + * Create a document onto disk according to template module. + * + * @param string $modele Force template to use ('' to not force) + * @param Translate $outputlangs object lang a utiliser pour traduction + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param ?array $moreparams Array to provide more information + * @return int<0,1> 0 if KO, 1 if OK + */ + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = \null) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet + * + * @param array $info Info array loaded by _load_ldap_info + * @param int<0,2> $mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb) + * 1=Return DN without key inside (ou=xxx,dc=aaa,dc=bbb) + * 2=Return key only (uid=qqq) + * @return string DN + */ + public function _load_ldap_dn($info, $mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Initialise tableau info (tableau des attributes LDAP) + * + * @return array Tableau info des attributes + */ + public function _load_ldap_info() + { + } + /** + * Load type info information in the member object + * + * @param int $id Id of member to load + * @return void + */ + public function info($id) + { + } + /** + * Return number of mass Emailing received by this member with its email + * + * @return int Number of EMailings + */ + public function getNbOfEMailings() + { + } + /** + * Sets object to supplied categories. + * + * Deletes object from existing categories not supplied. + * Adds it to non existing supplied categories. + * Existing categories are left untouch. + * + * @param int[]|int $categories Category or categories IDs + * @return int Return integer <0 if KO, >0 if OK + */ + public function setCategories($categories) + { + } + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $db Database handler + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty($db, $origin_id, $dest_id) + { + } + /** + * Return if a member is late (subscription late) or not + * + * @return boolean True if late, False if not late + */ + public function hasDelay() + { + } + /** + * Send reminders by emails before subscription end + * CAN BE A CRON TASK + * + * @param string $daysbeforeendlist Nb of days before end of subscription (negative number = after subscription). Can be a list of delay, separated by a semicolon, for example '10;5;0;-5' + * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) + */ + public function sendReminderForExpiredSubscription($daysbeforeendlist = '10') + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (c) 2008-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 Marcos García + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/core/class/stats.class.php + * \ingroup core + * \brief Common class to manage statistics reports + */ + /** + * Parent class of statistics class + */ + abstract class Stats + { + /** + * @var DoliDB + */ + protected $db; + /** + * @var array Dates of cache file read by methods + */ + protected $lastfetchdate = array(); + public $cachefilesuffix = ''; + // Suffix to add to name of cache file (to avoid file name conflicts) + /** + * @var string To store the FROM part of the main table of the SQL request + */ + public $from; + /** + * @var string To store the WHERE part of the main table of the SQL request + */ + public $where; + /** + * @var string To store the FROM part of the line table of the SQL request + */ + public $from_line; + /** + * @var string To store the field of the date + */ + public $field_date; + /** + * @var string To store the field for total HT + */ + public $field; + /** + * @var string To store the FROM part of the line table of the SQL request + */ + public $field_line; + /** + * @var string error message + */ + public $error; + /** + * @var int year + */ + public $year; + /** + * @var int month + */ + public $month; + /** + * @param int $year number + * @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{0:int<1,12>,1:int}> Array of nb each month + */ + protected abstract function getNbByMonth($year, $format = 0); + /** + * Return nb of elements by month for several years + * + * @param int $endyear Start year + * @param int $startyear End year + * @param int $cachedelay Delay we accept for cache file (0=No read, no save of cache, -1=No read but save) + * @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 + * @param int $startmonth month of the fiscal year start min 1 max 12 ; if 1 = january + * @return array,array{0:int<1,12>,1:int}> Array of values + */ + public function getNbByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0, $startmonth = 1) + { + } + /** + * @param int $year year number + * @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{0:int<1,12>,1:int|float}> Array of values by month + */ + protected abstract function getAmountByMonth($year, $format = 0); + /** + * Return amount of elements by month for several years. + * Criteria used to build request are defined into the constructor of parent class into xxx/class/xxxstats.class.php + * The caller of class can add more filters into sql request by adding criteris into the $stats->where property just after + * calling constructor. + * + * @param int $endyear Start year + * @param int $startyear End year + * @param int $cachedelay Delay we accept for cache file (0=No read, no save of cache, -1=No read but save) + * @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 + * @param int $startmonth month of the fiscal year start min 1 max 12 ; if 1 = january + * @return array,array> Array of values + */ + public function getAmountByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0, $startmonth = 1) + { + } + /** + * @param int $year year number + * @return array,array{0:int<1,12>,1:int|float}> Array of values + */ + protected abstract function getAverageByMonth($year); + /** + * Return average of entity by month for several years + * + * @param int $endyear Start year + * @param int $startyear End year + * @return array> Array of values + */ + public function getAverageByMonthWithPrevYear($endyear, $startyear) + { + } + /** + * Return count, and sum of products + * + * @param int $year Year + * @param int $cachedelay Delay we accept for cache file (0=No read, no save of cache, -1=No read but save) + * @param int $limit Limit + * @return array,array{0:int<1,12>,1:int|float}> Array of values + */ + public function getAllByProductEntry($year, $cachedelay = 0, $limit = 10) + { + } + // Here we have low level of shared code called by XxxStats.class.php + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Return nb of elements by year + * + * @param string $sql SQL request + * @return array Array of nb each year + */ + protected function _getNbByYear($sql) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Return nb of elements, total amount and avg amount each year + * + * @param string $sql SQL request + * @return array Array with nb, total amount, average for each year + */ + protected function _getAllByYear($sql) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Renvoie le nombre de documents par mois pour une annee donnee + * Return number of documents per month for a given year + * + * @param int $year Year + * @param string $sql SQL + * @param int<0,2> $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{0:int<1,12>,1:int}> Array of nb each month + */ + protected function _getNbByMonth($year, $sql, $format = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Return the amount per month for a given year + * + * @param int $year Year + * @param string $sql SQL + * @param int<0,2> $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{0:int<1,12>,1:int|float}> Array of nb each month + */ + protected function _getAmountByMonth($year, $sql, $format = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Return the amount average par month for a given year + * + * @param int $year Year + * @param string $sql SQL + * @param int<0,2> $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{0:int<1,12>,1:int|float}> Array of average each month + */ + protected function _getAverageByMonth($year, $sql, $format = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Return number or total of product refs + * + * @param string $sql SQL + * @param int $limit Limit + * @return array,array{0:int<1,12>,1:int|float}> Array of total of product refs each month + */ + protected function _getAllByProduct($sql, $limit = 10) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Returns the summed amounts per year for a given number of past years ending now + * @param string $sql SQL + * @return array Array of sum of amounts + */ + protected function _getAmountByYear($sql) + { + } + /** + * Return nb, amount of predefined product for year + * + * @param int $year Year to scan + * @param int $limit Limit + * @return array,array{0:int<1,12>,1:int|float}> Array of values + */ + public function getAllByProduct($year, $limit = 0) + { + } + } + /** + * Class to manage statistics of members + */ + class AdherentStats extends \Stats + { + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; + /** + * @var int + */ + public $memberid; + /** + * @var int + */ + public $socid; + /** + * @var int + */ + public $userid; + /** + * @var string + */ + public $from; + /** + * @var string + */ + public $field; + /** + * @var string + */ + public $where; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param int $socid Id third party + * @param int $userid Id user for filter + */ + public function __construct($db, $socid = 0, $userid = 0) + { + } + /** + * Return the number of proposition by month for a given year + * + * @param int $year Year + * @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{0:int<1,12>,1:int}> Array of nb each month + */ + public function getNbByMonth($year, $format = 0) + { + } + /** + * Return the number of subscriptions by year + * + * @return array Array of nb each year + */ + public function getNbByYear() + { + } + /** + * Return the number of subscriptions by month for a given year + * + * @param int $year Year + * @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{0:int<1,12>,1:int|float}> Array of values by month + */ + public function getAmountByMonth($year, $format = 0) + { + } + /** + * Return average amount each month + * + * @param int $year Year + * @return array,array{0:int<1,12>,1:int|float}> Array of average each month + */ + public function getAverageByMonth($year) + { + } + /** + * Return nb, total and average + * + * @return array Array with nb, total amount, average for each year + */ + public function getAllByYear() + { + } + /** + * Return count of member by status group by adh type, total and average + * + * @param int $numberYears Number of years to scan (0 = all) + * @return array Array with total of draft, pending, uptodate, expired, resiliated for each member type + */ + public function countMembersByTypeAndStatus($numberYears = 0) + { + } + /** + * Return count of member by status group by adh type, total and average + * + * @param int $numberYears Number of years to scan (0 = all) + * @return array Array with total of draft, pending, uptodate, expired, resiliated for each member tag + */ + public function countMembersByTagAndStatus($numberYears = 0) + { + } + } + /** + * Class to manage members type + */ + class AdherentType extends \CommonObject + { + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'adherent_type'; + /** + * @var string ID to identify managed object + */ + public $element = 'adherent_type'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'members'; + /** + * @var string + * @deprecated Use label + * @see $label + */ + public $libelle; + /** + * @var string Adherent type label + */ + public $label; + /** + * @var string Adherent type nature + */ + public $morphy; + /** + * @var string + */ + public $duration; + /** + * @var int type expiration + */ + public $duration_value; + /** + * @var string Expiration unit + */ + public $duration_unit; + /** + * @var int<0,1> Subscription required (0 or 1) + */ + public $subscription; + /** + * @var float|string Amount for subscription (null or '' means not defined) + */ + public $amount; + /** + * @var int Amount can be chosen by the visitor during subscription (0 or 1) + */ + public $caneditamount; + /** + * @var string Public note + * @deprecated + */ + public $note; + /** @var string Public note */ + public $note_public; + /** @var integer Can vote */ + public $vote; + /** @var string Email sent during validation of member */ + public $mail_valid; + /** @var string Email sent after recording a new subscription */ + public $mail_subscription = ''; + /** @var string Email sent after resiliation */ + public $mail_resiliate = ''; + /** @var string Email sent after exclude */ + public $mail_exclude = ''; + /** @var Adherent[] Array of members */ + public $members = array(); + /** + * @var string description + */ + public $description; + /** + * @var string email + */ + public $email; + /** + * @var array multilangs + */ + public $multilangs = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Load array this->multilangs + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function getMultiLangs() + { + } + /** + * Update or add a translation for this member type + * + * @param User $user Object user making update + * @return int Return integer <0 if KO, >0 if OK + */ + public function setMultiLangs($user) + { + } + /** + * Delete a language for this member type + * + * @param string $langtodelete Language code to delete + * @param User $user Object user making delete + * @return int Return integer <0 if KO, >0 if OK + */ + public function delMultiLangs($langtodelete, $user) + { + } + /** + * Function to create the member type + * + * @param User $user User making creation + * @param int $notrigger 1=do not execute triggers, 0 otherwise + * @return int >0 if OK, < 0 if KO + */ + public function create($user, $notrigger = 0) + { + } + /** + * Updating the type in the database + * + * @param User $user Object user making change + * @param int $notrigger 1=do not execute triggers, 0 otherwise + * @return int >0 if OK, < 0 if KO + */ + public function update($user, $notrigger = 0) + { + } + /** + * Function to delete the member's status + * + * @param User $user User making the deletion + * @return int > 0 if OK, 0 if not found, < 0 if KO + */ + public function delete($user) + { + } + /** + * Function that retrieves the properties of a membership type + * + * @param int $rowid Id of member type to load + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($rowid) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of members' type + * + * @param int $status Filter on status of type + * @return array List of types of members + */ + public function liste_array($status = -1) + { + } + /** + * Return the array of all amounts per membership type id + * + * @param int $status Filter on status of type + * @return array Array of membership type + */ + public function amountByType($status = \null) + { + } + /** + * Return array of Member objects for member type this->id (or all if this->id not defined) + * + * @param string $excludefilter Filter to exclude. This value must not come from a user input. + * @param int<0,2> $mode 0=Return array of member instance + * 1=Return array of member instance without extra data + * 2=Return array of members id only + * @return Adherent[]|int<-1,-1> Array of members or -1 on error + */ + public function listMembersForMemberType($excludefilter = '', $mode = 0) + { + } + /** + * Return translated label by the nature of a adherent (physical or moral) + * + * @param string $morphy Nature of the adherent (physical or moral) + * @return string Label + */ + public function getmorphylib($morphy = '') + { + } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array{picto:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} + */ + public function getTooltipContentArray($params) + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int<0,2> $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $maxlen length max label + * @param int<0,1> $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int<-1,1> $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Return label of status (activity, closed) + * + * @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Status id + * @param int<0,6> $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Status label + */ + public function LibStatut($status, $mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet + * + * @param array $info Info array loaded by _load_ldap_info + * @param int<0,2> $mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb) + * 1=Return DN without key inside (ou=xxx,dc=aaa,dc=bbb) + * 2=Return key only (uid=qqq) + * @return string DN + */ + public function _load_ldap_dn($info, $mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Initialize the info array (array of LDAP values) that will be used to call LDAP functions + * + * @return array Info table with attributes + */ + public function _load_ldap_info() + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * getMailOnValid + * + * @return string Return mail content of type or empty + */ + public function getMailOnValid() + { + } + /** + * getMailOnSubscription + * + * @return string Return mail content of type or empty + */ + public function getMailOnSubscription() + { + } + /** + * getMailOnResiliate + * + * @return string Return mail model content of type or empty + */ + public function getMailOnResiliate() + { + } + /** + * getMailOnExclude + * + * @return string Return mail model content of type or empty + */ + public function getMailOnExclude() + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /** + * API class for members + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ + class Members extends \DolibarrApi + { + /** + * @var string[] $FIELDS Mandatory fields, checked when create and update object + */ + public static $FIELDS = array('morphy', 'typeid'); + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get properties of a member object + * + * Return an array with member information + * + * @param int $id ID of member + * @return Object Object with cleaned properties + * + * @throws RestException 403 Access denied + * @throws RestException 404 Member not found + */ + public function get($id) + { + } + /** + * Get properties of a member object by linked thirdparty + * + * Return an array with member information + * + * @param int $thirdparty ID of third party + * + * @return Object Data without useless information + * + * @url GET thirdparty/{thirdparty} + * + * @throws RestException 403 Access denied + * @throws RestException 404 Member not found + */ + public function getByThirdparty($thirdparty) + { + } + /** + * Get properties of a member object by linked thirdparty email + * + * Return an array with member information + * + * @param string $email Email of third party + * + * @return Object Data without useless information + * + * @url GET thirdparty/email/{email} + * + * @throws RestException 403 Access denied + * @throws RestException 404 Member or ThirdParty not found + */ + public function getByThirdpartyEmail($email) + { + } + /** + * Get properties of a member object by linked thirdparty barcode + * + * Return an array with member information + * + * @param string $barcode Barcode of third party + * + * @return Object Data without useless information + * + * @url GET thirdparty/barcode/{barcode} + * + * @throws RestException 403 Access denied + * @throws RestException 404 Member or ThirdParty not found + */ + public function getByThirdpartyBarcode($barcode) + { + } + /** + * List members + * + * Get a list of members + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $typeid ID of the type of member + * @param int $category Use this param to filter list by category + * @param string $sqlfilters Other criteria to filter answers separated by a comma. + * Example: "(t.ref:like:'SO-%') and ((t.date_creation:<:'20160101') or (t.nature:is:NULL))" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* + * @return array Array of member objects + * @phan-return array> + * @phpstan-return array> + * + * @throws RestException 400 Error on SQL filters + * @throws RestException 403 Access denied + * @throws RestException 404 No Member found + * @throws RestException 503 Error when retrieving Member list + */ + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $category = 0, $sqlfilters = '', $properties = '', $pagination_data = \false) + { + } + /** + * Create member object + * + * @param array $request_data Request data + * @return int ID of member + * + * @throws RestException 403 Access denied + * @throws RestException 500 Error when creating Member + */ + public function post($request_data = \null) + { + } + /** + * Update member + * + * @param int $id ID of member to update + * @param array $request_data Datas + * @phan-param ?array $request_data + * @phpstan-param ?array $request_data + * @return Object Updated object + * + * @throws RestException 403 Access denied + * @throws RestException 404 Member not found + * @throws RestException 500 Error when resiliating, validating, excluding, updating a Member + */ + public function put($id, $request_data = \null) + { + } + /** + * Delete member + * + * @param int $id member ID + * @return array + * @phan-return array + * @phpstan-return array + * + * @throws RestException 403 Access denied + * @throws RestException 404 Member not found + * @throws RestException 500 Error when deleting a Member + */ + public function delete($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensible object datas + * + * @param Object $object Object to clean + * @return Object Object with cleaned properties + */ + protected function _cleanObjectDatas($object) + { + } + /** + * List subscriptions of a member + * + * Get a list of subscriptions + * + * @param int $id ID of member + * @return array Array of subscription objects + * @phan-return Object[] + * @phpstan-return Object[] + * + * @url GET {id}/subscriptions + * + * @throws RestException 403 Access denied + * @throws RestException 404 Member not found + */ + public function getSubscriptions($id) + { + } + /** + * Add a subscription for a member + * + * @param int $id ID of member + * @param string $start_date Start date {@from body} {@type timestamp} + * @param string $end_date End date {@from body} {@type timestamp} + * @param float $amount Amount (may be 0) {@from body} + * @param string $label Label {@from body} + * @return int ID of subscription + * + * @url POST {id}/subscriptions + * + * @throws RestException 403 Access denied + * @throws RestException 404 Member not found + */ + public function createSubscription($id, $start_date, $end_date, $amount, $label = '') + { + } + /** + * Get categories for a member + * + * @param int $id ID of member + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * + * @return mixed + * + * @url GET {id}/categories + * + * @throws RestException 403 Access denied + * @throws RestException 404 Category not found + * @throws RestException 503 Error when retrieving Category list + */ + public function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) + { + } + /** + * Get properties of a member type object + * + * Return an array with member type information + * + * @param int $id ID of member type + * @return Object Object with cleaned properties + * + * @url GET /types/{id} + * + * @throws RestException 403 Access denied + * @throws RestException 404 No Member Type found + */ + public function getType($id) + { + } + /** + * List members types + * + * Get a list of members types + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.libelle:like:'SO-%') and (t.subscription:=:'1')" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* + * @return array Array of member type objects + * @phan-return array> + * @phpstan-return array> + * + * @url GET /types/ + * + * @throws RestException 403 Access denied + * @throws RestException 404 No Member Type found + * @throws RestException 503 Error when retrieving Member list + */ + public function indexType($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '', $pagination_data = \false) + { + } + /** + * Create member type object + * + * @param array $request_data Request data + * @phan-param ?array $request_data + * @phpstan-param ?array $request_data + * @return int ID of member type + * + * @url POST /types/ + * + * @throws RestException 403 Access denied + * @throws RestException 500 Error when creating Member Type + */ + public function postType($request_data = \null) + { + } + /** + * Update member type + * + * @param int $id ID of member type to update + * @param array $request_data Datas + * @phan-param ?array $request_data + * @phpstan-param ?array $request_data + * @return Object Updated object + * + * @url PUT /types/{id} + * + * @throws RestException 403 Access denied + * @throws RestException 404 No Member Type found + * @throws RestException 500 Error when updating Member Type + */ + public function putType($id, $request_data = \null) + { + } + /** + * Delete member type + * + * @param int $id member type ID + * @return array + * @phan-return array + * @phpstan-return array + * + * @url DELETE /types/{id} + * + * @throws RestException 403 Access denied + * @throws RestException 404 No Member Type found + * @throws RestException 500 Error when deleting Member Type + */ + public function deleteType($id) + { + } + } + /** + * API class for subscriptions + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ + class Subscriptions extends \DolibarrApi + { + /** + * @var string[] $FIELDS Mandatory fields, checked when create and update object + */ + public static $FIELDS = array('fk_adherent', 'dateh', 'datef', 'amount'); + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get properties of a subscription object + * + * Return an array with subscription information + * + * @param int $id ID of subscription + * @return Object Object with cleaned properties + * + * @throws RestException 403 Access denied + * @throws RestException 404 No Subscription found + */ + public function get($id) + { + } + /** + * List subscriptions + * + * Get a list of subscriptions + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* + * @return array Array of subscription objects + * @phan-return array{data:Subscription[],pagination:array{total:int,page:int,page_count:int,limit:int}}|array + * @phpstan-return array{data:Subscription[],pagination:array{total:int,page:int,page_count:int,limit:int}}|array + * + * @throws RestException 403 Access denied + * @throws RestException 404 No Subscription found + * @throws RestException 503 Error when retrieving Subscription list + */ + public function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '', $pagination_data = \false) + { + } + /** + * Create subscription object + * + * @param array $request_data Request data + * @phan-param array $request_data + * @phpstan-param array $request_data + * @return int ID of subscription + * + * @throws RestException 403 Access denied + * @throws RestException 500 Error when creating Subscription + */ + public function post($request_data = \null) + { + } + /** + * Update subscription + * + * @param int $id ID of subscription to update + * @param array $request_data Data + * @phan-param array $request_data + * @phpstan-param array $request_data + * @return Object Updated object + * + * @throws RestException 403 Access denied + * @throws RestException 404 No Subscription found + * @throws RestException 500 Error when updating Subscription + */ + public function put($id, $request_data = \null) + { + } + /** + * Delete subscription + * + * @param int $id ID of subscription to delete + * @return array + * @phan-return array + * @phpstan-return array + * + * @throws RestException 403 Access denied + * @throws RestException 404 No Subscription found + * @throws RestException 409 No Subscription deleted + * @throws RestException 500 Error when deleting Subscription + */ + public function delete($id) + { + } + } + /** + * Class to manage subscriptions of foundation members + */ + class Subscription extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'subscription'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'subscription'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'payment'; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + /** + * Date modification record (tms) + * + * @var integer + */ + public $datem; + /** + * Subscription start date (date subscription) + * + * @var integer + */ + public $dateh; + /** + * Subscription end date + * + * @var integer + */ + public $datef; + /** + * @var int ID + */ + public $fk_type; + /** + * @var int Member ID + */ + public $fk_adherent; + /** + * @var double amount subscription + */ + public $amount; + /** + * @var int ID of bank in llx_bank + */ + public $fk_bank; + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 15), 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 20), 'fk_adherent' => array('type' => 'integer', 'label' => 'Member', 'enabled' => 1, 'visible' => -1, 'position' => 25), 'dateadh' => array('type' => 'datetime', 'label' => 'DateSubscription', 'enabled' => 1, 'visible' => -1, 'position' => 30), 'datef' => array('type' => 'datetime', 'label' => 'DateEndSubscription', 'enabled' => 1, 'visible' => -1, 'position' => 35), 'subscription' => array('type' => 'double(24,8)', 'label' => 'Amount', 'enabled' => 1, 'visible' => -1, 'position' => 40, 'isameasure' => 1), 'fk_bank' => array('type' => 'integer', 'label' => 'BankId', 'enabled' => 1, 'visible' => -1, 'position' => 45), 'note' => array('type' => 'html', 'label' => 'Note', 'enabled' => 1, 'visible' => -1, 'position' => 50), 'fk_type' => array('type' => 'integer', 'label' => 'MemberType', 'enabled' => 1, 'visible' => -1, 'position' => 55), 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'position' => 60), 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 65)); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Function who permitted creation of the subscription + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id subscription created if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Method to load a subscription + * + * @param int $rowid Id subscription + * @return int Return integer <0 if KO, =0 if not found, >0 if OK + */ + public function fetch($rowid) + { + } + /** + * Update subscription + * + * @param User $user User who updated + * @param int $notrigger 0=Disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user, $notrigger = 0) + { + } + /** + * Delete a subscription + * + * @param User $user User that delete + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $notooltip 1=Disable tooltip + * @param string $option Page for link ('', 'nolink', ...) + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0, $notooltip = 0, $option = '', $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Load information of the subscription object + * + * @param int $id Id subscription + * @return void + */ + public function info($id) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{selected:?int,member:?Adherent,bank:?Account} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /** + * Class Dolistore + */ + class Dolistore + { + /** + * beginning of pagination + * @var int + */ + public $start; + /** + * end of pagination + * @var int + */ + public $end; + /** + * @var int Pagination: display per page + */ + public $per_page; + /** + * @var int The current categorie + */ + public $categorie; + /** + * @var ?SimpleXMLElement + */ + public $categories; + // an array of categories + /** + * @var string The search keywords + */ + public $search; + // setups + /** + * @var string + */ + public $url; + // the url of this page + /** + * @var string + */ + public $shop_url; + // the url of the shop + /** + * @var int + */ + public $lang; + // the integer representing the lang in the store + /** + * @var bool + */ + public $debug_api; + // useful if no dialog + /** + * @var PrestaShopWebservice + */ + public $api; + /** + * @var ?SimpleXMLElement + */ + public $products; + /** + * Constructor + * + * @param boolean $debug Enable debug of request on screen + */ + public function __construct($debug = \false) + { + } + /** + * Load data from remote Dolistore market place. + * This fills ->categories + * + * @return void + */ + public function getRemoteCategories() + { + } + /** + * Load data from remote Dolistore market place. + * This fills ->products + * + * @param array{start:int,end:int,per_page:int,categorie:int,search:string} $options Options. If 'categorie' is defined, we filter products on this category id + * @return void + */ + public function getRemoteProducts($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0, 'search' => '')) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return tree of Dolistore categories. $this->categories must have been loaded before. + * + * @param int $parent Id of parent category + * @return string + */ + public function get_categories($parent = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of product formatted for output + * + * @return string HTML output + */ + public function get_products() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * get previous link + * + * @param string $text symbol previous + * @return string html previous link + */ + public function get_previous_link($text = '<<') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * get next link + * + * @param string $text symbol next + * @return string html next link + */ + public function get_next_link($text = '>>') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * get previous url + * + * @return string previous url + */ + public function get_previous_url() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * get next url + * + * @return string next url + */ + public function get_next_url() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * version compare + * + * @param string $v1 version 1 + * @param string $v2 version 2 + * @return int result of compare + */ + public function version_compare($v1, $v2) + { + } + } + /* Copyright (C) 2024 MDW + */ + /* + * 2007-2022 PrestaShop SA and Contributors + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * https://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@prestashop.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to https://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2022 PrestaShop SA + * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * International Registered Trademark & Property of PrestaShop SA + * PrestaShop Webservice Library + * @package PrestaShopWebservice + */ + /** + * @package PrestaShopWebservice + */ + class PrestaShopWebservice + { + /** @var string Shop URL */ + protected $url; + /** @var string Authentication key */ + protected $key; + /** @var boolean is debug activated */ + protected $debug; + /** @var string PS version */ + protected $version; + /** @var string Minimal version of PrestaShop to use with this library */ + const PS_COMPATIBLE_VERSIONS_MIN = '1.4.0.0'; + /** @var string Maximal version of PrestaShop to use with this library */ + const PS_COMPATIBLE_VERSIONS_MAX = '8.1.1'; + /** + * PrestaShopWebservice constructor. Throw an exception when CURL is not installed/activated + * + * getMessage(); + * } + * ?> + * + * + * @param string $url Root URL for the shop + * @param string $key Authentication key + * @param bool $debug Debug mode Activated (true) or deactivated (false) + * + * @throws PrestaShopWebserviceException if curl is not loaded + */ + public function __construct($url, $key, $debug = \true) + { + } + /** + * Take the status code and throw an exception if the server didn't return 200 or 201 code + *

Unique parameter must take :

+ * 'status_code' => Status code of an HTTP return
+ * 'response' => CURL response + *

+ * + * @param array{status_code:int,response:string} $request Response elements of CURL request + * + * @return void + * @throws PrestaShopWebserviceException if HTTP status code is not 200 or 201 + */ + protected function checkStatusCode($request) + { + } + /** + * Provides default parameters for the curl connection(s) + * @return array> Default parameters for curl connection(s) + */ + protected function getCurlDefaultParams() + { + } + /** + * Handles a CURL request to PrestaShop Webservice. Can throw exception. + * + * @param string $url Resource name + * @param array $curl_params CURL parameters (sent to curl_set_opt) + * + * @return array{status_code:int,response:?string,header:string} + * + * @throws PrestaShopWebserviceException + */ + public function executeRequest($url, $curl_params = array()) + { + } + /** + * Output debug info + * + * @param string $title Title + * @param string $content Content + * @return void + */ + public function printDebug($title, $content) + { + } + /** + * Return version + * + * @return string Version + */ + public function getVersion() + { + } + /** + * Load XML from string. Can throw exception + * + * @param string $response String from a CURL response + * + * @return SimpleXMLElement status_code, response + * @throws PrestaShopWebserviceException + */ + protected function parseXML($response) + { + } + /** + * Add (POST) a resource + *

Unique parameter must take :

+ * 'resource' => Resource name
+ * 'postXml' => Full XML string to add resource

+ * Examples are given in the tutorial

+ * + * @param array{url?:string,resource?:string,id?:string,id_shop?:string,id_group_shop?:string,postXml:mixed} $options Array representing resource to add. + * + * @return SimpleXMLElement status_code, response + * @throws PrestaShopWebserviceException + */ + public function add($options) + { + } + /** + * Retrieve (GET) a resource + *

Unique parameter must take :

+ * 'url' => Full URL for a GET request of Webservice (ex: https://mystore.com/api/customers/1/)
+ * OR
+ * 'resource' => Resource name,
+ * 'id' => ID of a resource you want to get

+ *

+ * + * get(array('resource' => 'orders', 'id' => 1)); + * // Here in $xml, a SimpleXMLElement object you can parse + * foreach ($xml->children()->children() as $attName => $attValue) + * echo $attName.' = '.$attValue.'
'; + * } + * catch (PrestaShopWebserviceException $ex) + * { + * echo 'Error : '.$ex->getMessage(); + * } + * ?> + *
+ * + * @param array $options Array representing resource to get. + * + * @return SimpleXMLElement status_code, response + * @throws PrestaShopWebserviceException + */ + public function get($options) + { + } + /** + * Head method (HEAD) a resource + * + * @param array $options Array representing resource for head request. + * + * @return string + * @throws PrestaShopWebserviceException + */ + public function head($options) + { + } + /** + * Edit (PUT) a resource + *

Unique parameter must take :

+ * 'resource' => Resource name ,
+ * 'id' => ID of a resource you want to edit,
+ * 'putXml' => Modified XML string of a resource

+ * Examples are given in the tutorial

+ * + * @param array{url?:string,resource?:string,id?:string,id_shop?:string,id_group_shop?:string,putXml:mixed} $options Array representing resource to edit. + * + * @return SimpleXMLElement + * @throws PrestaShopWebserviceException + */ + public function edit($options) + { + } + /** + * Delete (DELETE) a resource. + * Unique parameter must take :

+ * 'resource' => Resource name
+ * 'id' => ID or array which contains IDs of a resource(s) you want to delete

+ * + * delete(array('resource' => 'orders', 'id' => 1)); + * // Following code will not be executed if an exception is thrown. + * echo 'Successfully deleted.'; + * } + * catch (PrestaShopWebserviceException $ex) + * { + * echo 'Error : '.$ex->getMessage(); + * } + * ?> + * + * + * @param array{url?:string,resource?:string,id?:string,id_shop?:string,id_group_shop?:string} $options Array representing resource to delete. + * + * @return bool + * @throws PrestaShopWebserviceException + */ + public function delete($options) + { + } + } + /** + * @package PrestaShopWebservice + */ + class PrestaShopWebserviceException extends \Exception + { + } + /** + * Class for AI + */ + class Ai + { + /** + * @var DoliDB $db Database object + */ + protected $db; + /** + * Constructor + * + * @param DoliDB $db Database handler + * + */ + public function __construct($db) + { + } + /** + * Generate response of instructions + * + * @param string $instructions Instruction to generate content + * @param string $model Model name ('gpt-3.5-turbo', 'gpt-4-turbo', 'dall-e-3', ...) + * @param string $function Code of the feature we want to use ('textgeneration', 'transcription', 'audiogeneration', 'imagegeneration', 'translation') + * @param string $format Format for output ('', 'html', ...) + * @return string|array{error:bool,message:string,code?:int,curl_error_no?:''|int,format?:string,service?:string,function?:string} $response Text or array if error + */ + public function generateContent($instructions, $model = 'auto', $function = 'textgeneration', $format = '') + { + } + } +} +namespace Luracast\Restler { + /** + * Interface for creating classes that perform authentication/access + * verification + * + * @category Framework + * @package Restler + * @subpackage auth + * @author R.Arul Kumaran + * @copyright 2010 Luracast + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link http://luracast.com/products/restler/ + * + */ + interface iFilter + { + /** + * Access verification method. + * + * API access will be denied when this method returns false + * + * @abstract + * @return boolean true when api access is allowed false otherwise + */ + public function __isAllowed(); + } + /** + * Interface for creating authentication classes + * + * @category Framework + * @package Restler + * @subpackage auth + * @author R.Arul Kumaran + * @copyright 2010 Luracast + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link http://luracast.com/products/restler/ + * + */ + interface iAuthenticate extends \Luracast\Restler\iFilter + { + /** + * @return string string to be used with WWW-Authenticate header + * @example Basic + * @example Digest + * @example OAuth + */ + public function __getWWWAuthenticateString(); + } +} +namespace { + /** + * Dolibarr API access class + * + */ + class DolibarrApiAccess implements \Luracast\Restler\iAuthenticate + { + const REALM = 'Restricted Dolibarr API'; + /** + * @var DoliDB Database handler + */ + public $db; + /** + * @var array $requires role required by API method user / external / admin + */ + public static $requires = array('user', 'external', 'admin'); + /** + * @var string $role user role + */ + public static $role = 'user'; + /** + * @var User $user Loggued user + */ + public static $user = \null; + /** + * Constructor + */ + public function __construct() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName + /** + * Check access + * + * @return bool + * + * @throws RestException 401 Forbidden + * @throws RestException 503 Technical error + */ + public function __isAllowed() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName + /** + * @return string string to be used with WWW-Authenticate header + */ + public function __getWWWAuthenticateString() + { + } + /** + * Verify access + * + * @param array $m Properties of method + * + * @access private + * @return bool + */ + public static function verifyAccess(array $m) + { + } + } + /** + * API class for receive files + * + * @access protected + * @class Documents {@requires user,external} + */ + class Documents extends \DolibarrApi + { + /** + * Constructor + */ + public function __construct() + { + } + /** + * Download a document. + * + * Note that, this API is similar to using the wrapper link "documents.php" to download a file (used for + * internal HTML links of documents into application), but with no need to have a session cookie (the token is used instead). + * + * @param string $modulepart Name of module or area concerned by file download ('facture', ...) + * @param string $original_file Relative path with filename, relative to modulepart (for example: IN201701-999/IN201701-999.pdf) + * @return array List of documents + * + * @url GET /download + * + * @throws RestException 400 Bad value for parameter modulepart or original_file + * @throws RestException 403 Access denied + * @throws RestException 404 File not found + */ + public function index($modulepart, $original_file = '') + { + } + /** + * Build a document. + * + * Test sample 1: { "modulepart": "invoice", "original_file": "FA1701-001/FA1701-001.pdf", "doctemplate": "crabe", "langcode": "fr_FR" }. + * + * Supported modules: invoice, order, proposal, contract, shipment + * + * @param string $modulepart Name of module or area concerned by file download ('thirdparty', 'member', 'proposal', 'supplier_proposal', 'order', 'supplier_order', 'invoice', 'supplier_invoice', 'shipment', 'project', ...) + * @param string $original_file Relative path with filename, relative to modulepart (for example: IN201701-999/IN201701-999.pdf). + * @param string $doctemplate Set here the doc template to use for document generation (If not set, use the default template). + * @param string $langcode Language code like 'en_US', 'fr_FR', 'es_ES', ... (If not set, use the default language). + * @return array List of documents + * + * @url PUT /builddoc + * + * @throws RestException 400 Bad value for parameter modulepart or original_file + * @throws RestException 403 Access denied + * @throws RestException 404 Invoice, Order, Proposal, Contract or Shipment not found + * @throws RestException 500 Error generating document + * @throws RestException 501 File not found + */ + public function builddoc($modulepart, $original_file = '', $doctemplate = '', $langcode = '') + { + } + /** + * Return the list of documents of a dedicated element (from its ID or Ref) + * + * Supported modules: thirdparty, user, member, proposal, order, supplier_order, shipment, invoice, supplier_invoice, product, event, expensereport, knowledgemanagement, category, contract + * + * @param string $modulepart Name of module or area concerned ('thirdparty', 'member', 'proposal', 'order', 'invoice', 'supplier_invoice', 'shipment', 'project', ...) + * @param int $id ID of element + * @param string $ref Ref of element + * @param string $sortfield Sort criteria ('','fullname','relativename','name','date','size') + * @param string $sortorder Sort order ('asc' or 'desc') + * @return array Array of documents with path + * + * @url GET / + * + * @throws RestException 400 Bad value for parameter modulepart, id or ref + * @throws RestException 403 Access denied + * @throws RestException 404 Thirdparty, User, Member, Order, Invoice or Proposal not found + * @throws RestException 500 Error while fetching object + * @throws RestException 503 Error when retrieve ecm list + */ + public function getDocumentsListByElement($modulepart, $id = 0, $ref = '', $sortfield = '', $sortorder = '') + { + } + /** + * Return a document. + * + * @param int $id ID of document + * @return array Array with data of file + * + * @throws RestException + */ + /* + public function get($id) { + return array('note'=>'xxx'); + }*/ + /** + * Upload a document. + * + * Test sample for invoice: { "filename": "mynewfile.txt", "modulepart": "invoice", "ref": "FA1701-001", "subdir": "", "filecontent": "content text", "fileencoding": "", "overwriteifexists": "0" }. + * Test sample for supplier invoice: { "filename": "mynewfile.txt", "modulepart": "supplier_invoice", "ref": "FA1701-001", "subdir": "", "filecontent": "content text", "fileencoding": "", "overwriteifexists": "0" }. + * Test sample for medias file: { "filename": "mynewfile.txt", "modulepart": "medias", "ref": "", "subdir": "image/mywebsite", "filecontent": "Y29udGVudCB0ZXh0Cg==", "fileencoding": "base64", "overwriteifexists": "0" }. + * + * Supported modules: invoice, order, supplier_order, task/project_task, product/service, expensereport, fichinter, member, propale, agenda, contact + * + * @param string $filename Name of file to create ('FA1705-0123.txt') + * @param string $modulepart Name of module or area concerned by file upload ('product', 'service', 'invoice', 'proposal', 'project', 'project_task', 'supplier_invoice', 'expensereport', 'member', ...) + * @param string $ref Reference of object (This will define subdir automatically and store submitted file into it) + * @param string $subdir Subdirectory (Only if ref not provided) + * @param string $filecontent File content (string with file content. An empty file will be created if this parameter is not provided) + * @param string $fileencoding File encoding (''=no encoding, 'base64'=Base 64) + * @param int $overwriteifexists Overwrite file if exists (1 by default) + * @param int $createdirifnotexists Create subdirectories if the doesn't exists (1 by default) + * @return string + * + * @url POST /upload + * + * @throws RestException 400 Bad Request + * @throws RestException 403 Access denied + * @throws RestException 404 Object not found + * @throws RestException 500 Error on file operationw + */ + public function post($filename, $modulepart, $ref = '', $subdir = '', $filecontent = '', $fileencoding = '', $overwriteifexists = 0, $createdirifnotexists = 1) + { + } + /** + * Delete a document. + * + * @param string $modulepart Name of module or area concerned by file download ('product', ...) + * @param string $original_file Relative path with filename, relative to modulepart (for example: PRODUCT-REF-999/IMAGE-999.jpg) + * @return array List of documents + * + * @url DELETE / + * + * @throws RestException 400 Bad value for parameter modulepart + * @throws RestException 400 Bad value for parameter original_file + * @throws RestException 403 Access denied + * @throws RestException 404 File not found + * @throws RestException 500 Error on file operation + */ + public function delete($modulepart, $original_file) + { + } + } + /** + * API that allows to log in with an user account. + */ + class Login + { + /** + * @var DoliDB Database handler + */ + public $db; + /** + * Constructor of the class + */ + public function __construct() + { + } + /** + * Login + * + * Request the API token for a couple username / password. + * WARNING: You should NEVER use this API, like you should never use the similar API that uses the POST method. This will expose your password. + * To use the APIs, you should instead set an API token to the user you want to allow to use API (This API token called DOLAPIKEY can be found/set on the user page) and use this token as credential for any API call. + * From the API explorer, you can enter directly the "DOLAPIKEY" into the field at the top right of the page to get access to any allowed APIs. + * + * @param string $login User login + * @param string $password User password + * @param string $entity Entity (when multicompany module is used). '' means 1=first company. + * @param int $reset Reset token (0=get current token, 1=ask a new token and canceled old token. This means access using current existing API token of user will fails: new token will be required for new access) + * @return array Response status and user token + * + * @throws RestException 403 Access denied + * @throws RestException 500 System error + * + * @url GET / + */ + public function loginUnsecured($login, $password, $entity = '', $reset = 0) + { + } + /** + * Login + * + * Request the API token for a couple username / password. + * WARNING: You should NEVER use this API, like you should never use the similar API that uses the POST method. This will expose your password. + * To use the APIs, you should instead set an API token to the user you want to allow to use API (This API token called DOLAPIKEY can be found/set on the user page) and use this token as credential for any API call. + * From the API explorer, you can enter directly the "DOLAPIKEY" into the field at the top right of the page to get access to any allowed APIs. + * + * @param string $login User login + * @param string $password User password + * @param string $entity Entity (when multicompany module is used). '' means 1=first company. + * @param int $reset Reset token (0=get current token, 1=ask a new token and canceled old token. This means access using current existing API token of user will fails: new token will be required for new access) + * @return array Response status and user token + * + * @throws RestException 403 Access denied + * @throws RestException 500 System error + * + * @url POST / + */ + public function index($login, $password, $entity = '', $reset = 0) + { + } + } + /** + * API class for dictionaries + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ + class Setup extends \DolibarrApi + { + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get the list of Action Triggers. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number {@min 0} + * @param string $elementtype Type of element ('adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...) + * @param string $lang Code of the language the label of the type must be translated to + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'SO-%')" + * @return array List of extra fields + * @phan-return Object[] List of extra fields + * + * @url GET actiontriggers + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of action triggers + */ + public function getListOfActionTriggers($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $elementtype = '', $lang = '', $sqlfilters = '') + { + } + /** + * Get the list of ordering methods. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number {@min 0} + * @param int $active Payment type is active or not {@min 0} {@max 1} + * @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'OrderByWWW')" + * + * @url GET dictionary/ordering_methods + * + * @return array [List of ordering methods] + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 403 Access denied + * @throws RestException 503 Error retrieving list of ordering methods + */ + public function getOrderingMethods($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + { + } + /** + * Get the list of ordering origins. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number {@min 0} + * @param int $active Payment type is active or not {@min 0} {@max 1} + * @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'OrderByWWW')" + * @return array [List of ordering reasons] + * + * @url GET dictionary/ordering_origins + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 403 Access denied + * @throws RestException 503 Error retrieving list of ordering origins + */ + public function getOrderingOrigins($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + { + } + /** + * Get the list of payments types. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number {@min 0} + * @param int $active Payment type is active or not {@min 0} {@max 1} + * @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'CHQ')" + * + * @url GET dictionary/payment_types + * + * @return array [List of payment types] + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 403 Access denied + * @throws RestException 503 Error retrieving list of payment types + */ + public function getPaymentTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + { + } + /** + * Get the list of regions. + * + * The returned list is sorted by region ID. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param int $country To filter on country + * @param string $filter To filter the regions by name + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of regions + * + * @url GET dictionary/regions + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error retrieving list of regions + */ + public function getListOfRegions($sortfield = "code_region", $sortorder = 'ASC', $limit = 100, $page = 0, $country = 0, $filter = '', $sqlfilters = '') + { + } + /** + * Get region by ID. + * + * @param int $id ID of region + * @return Object Object with cleaned properties + * + * @url GET dictionary/regions/{id} + * + * @throws RestException 404 Region not found + * @throws RestException 503 Error retrieving region + */ + public function getRegionByID($id) + { + } + /** + * Get region by Code. + * + * @param string $code Code of region + * @return Object Object with cleaned properties + * + * @url GET dictionary/regions/byCode/{code} + * + * @throws RestException 404 Region not found + * @throws RestException 503 Error when retrieving region + */ + public function getRegionByCode($code) + { + } + /** + * Get the list of states/provinces. + * + * The names of the states will be translated to the given language if + * the $lang parameter is provided. The value of $lang must be a language + * code supported by Dolibarr, for example 'en_US' or 'fr_FR'. + * The returned list is sorted by state ID. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param int $country To filter on country + * @param string $filter To filter the states by name + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of states + * + * @url GET dictionary/states + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error retrieving list of states + */ + public function getListOfStates($sortfield = "code_departement", $sortorder = 'ASC', $limit = 100, $page = 0, $country = 0, $filter = '', $sqlfilters = '') + { + } + /** + * Get state by ID. + * + * @param int $id ID of state + * @return Object Object with cleaned properties + * + * @url GET dictionary/states/{id} + * + * @throws RestException 404 State not found + * @throws RestException 503 Error retrieving state + */ + public function getStateByID($id) + { + } + /** + * Get state by Code. + * + * @param string $code Code of state + * @return Object Object with cleaned properties + * + * @url GET dictionary/states/byCode/{code} + * + * @throws RestException 404 State not found + * @throws RestException 503 Error retrieving state + */ + public function getStateByCode($code) + { + } + /** + * Get the list of countries. + * + * The names of the countries will be translated to the given language if + * the $lang parameter is provided. The value of $lang must be a language + * code supported by Dolibarr, for example 'en_US' or 'fr_FR'. + * The returned list is sorted by country ID. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param string $filter To filter the countries by name + * @param string $lang Code of the language the label of the countries must be translated to + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of countries + * + * @url GET dictionary/countries + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error retrieving list of countries + */ + public function getListOfCountries($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $filter = '', $lang = '', $sqlfilters = '') + { + } + /** + * Get country by ID. + * + * @param int $id ID of country + * @param string $lang Code of the language the name of the country must be translated to + * @return Object Object with cleaned properties + * + * @url GET dictionary/countries/{id} + * + * @throws RestException 404 Country not found + * @throws RestException 503 Error retrieving country + */ + public function getCountryByID($id, $lang = '') + { + } + /** + * Get country by Code. + * + * @param string $code Code of country (2 characters) + * @param string $lang Code of the language the name of the country must be translated to + * @return Object Object with cleaned properties + * + * @url GET dictionary/countries/byCode/{code} + * + * @throws RestException 404 Country not found + * @throws RestException 503 Error retrieving country + */ + public function getCountryByCode($code, $lang = '') + { + } + /** + * Get country by Iso. + * + * @param string $iso ISO of country (3 characters) + * @param string $lang Code of the language the name of the country must be translated to + * @return Object Object with cleaned properties + * + * @url GET dictionary/countries/byISO/{iso} + * + * @throws RestException 404 Country not found + * @throws RestException 503 Error retrieving country + */ + public function getCountryByISO($iso, $lang = '') + { + } + /** + * Get the list of delivery times. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number {@min 0} + * @param int $active Delivery times is active or not {@min 0} {@max 1} + * @param string $sqlfilters SQL criteria to filter with. + * + * @url GET dictionary/availability + * + * @return array [List of availability] + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 403 Access denied + * @throws RestException 503 Error when retrieving list of availabilities + */ + public function getAvailability($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensible object datas + * + * @param Object $object Object to clean + * @return Object Object with cleaned properties + */ + protected function _cleanObjectDatas($object) + { + } + /** + * Get the list of events types. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param string $type To filter on type of event + * @param string $module To filter on module events + * @param int $active Event's type is active or not {@min 0} {@max 1} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of events types + * + * @url GET dictionary/event_types + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of events types + */ + public function getListOfEventTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $sqlfilters = '') + { + } + /** + * Get the list of Expense Report types. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param string $module To filter on module + * @param int $active Event's type is active or not {@min 0} {@max 1} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of expense report types + * + * @url GET dictionary/expensereport_types + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of expense report types + */ + public function getListOfExpenseReportsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $sqlfilters = '') + { + } + /** + * Get the list of contacts types. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param string $type To filter on type of contact + * @param string $module To filter on module contacts + * @param int $active Contact's type is active or not {@min 0} {@max 1} + * @param string $lang Code of the language the label of the civility must be translated to + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of Contacts types + * + * @url GET dictionary/contact_types + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of contacts types + */ + public function getListOfContactTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $lang = '', $sqlfilters = '') + { + } + /** + * Get the list of civilities. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param string $module To filter on module events + * @param int $active Civility is active or not {@min 0} {@max 1} + * @param string $lang Code of the language the label of the civility must be translated to + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of civility types + * + * @url GET dictionary/civilities + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of civilities + */ + public function getListOfCivilities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $lang = '', $sqlfilters = '') + { + } + /** + * Get the list of currencies. + * + * @param int $multicurrency Multicurrency rates (0: no multicurrency, 1: last rate, 2: all rates) {@min 0} {@max 2} + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param int $active Payment term is active or not {@min 0} {@max 1} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of currencies + * + * @url GET dictionary/currencies + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of currencies + */ + public function getListOfCurrencies($multicurrency = 0, $sortfield = "code_iso", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + { + } + /** + * Get the list of extra fields. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param string $elementtype Type of element ('adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...) + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'SO-%')" + * @return array List of extra fields + * + * @url GET extrafields + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of extra fields + */ + public function getListOfExtrafields($sortfield = "t.pos", $sortorder = 'ASC', $elementtype = '', $sqlfilters = '') + { + } + /** + * Delete extrafield + * + * @param string $attrname extrafield attrname + * @param string $elementtype extrafield elementtype + * @return array + * + * @url DELETE extrafields/{elementtype}/{attrname} + * + */ + public function deleteExtrafieldsFromNames($attrname, $elementtype) + { + } + /** get Extrafield object + * + * @param string $attrname extrafield attrname + * @param string $elementtype extrafield elementtype + * @return array List of extra fields + * + * @url GET extrafields/{elementtype}/{attrname} + * + * @suppress PhanPluginUnknownArrayMethodParamType Luracast limitation + * + */ + public function getExtrafields($attrname, $elementtype) + { + } + /** + * Create Extrafield object + * + * @param string $attrname extrafield attrname + * @param string $elementtype extrafield elementtype + * @param array $request_data Request datas + * @return int ID of extrafield + * + * @url POST extrafields/{elementtype}/{attrname} + * + * @suppress PhanPluginUnknownArrayMethodParamType Luracast limitation + * + */ + public function postExtrafields($attrname, $elementtype, $request_data = \null) + { + } + /** + * Update Extrafield object + * + * @param string $attrname extrafield attrname + * @param string $elementtype extrafield elementtype + * @param array $request_data Request datas + * @return int ID of extrafield + * + * @url PUT extrafields/{elementtype}/{attrname} + * + * @suppress PhanPluginUnknownArrayMethodParamType Luracast limitation + * + */ + public function updateExtrafields($attrname, $elementtype, $request_data = \null) + { + } + /** + * Get the list of towns. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param string $zipcode To filter on zipcode + * @param string $town To filter on city name + * @param int $active Town is active or not {@min 0} {@max 1} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of towns + * + * @url GET dictionary/towns + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of towns + */ + public function getListOfTowns($sortfield = "zip,town", $sortorder = 'ASC', $limit = 100, $page = 0, $zipcode = '', $town = '', $active = 1, $sqlfilters = '') + { + } + /** + * Get the list of payments terms. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number {@min 0} + * @param int $active Payment term is active or not {@min 0} {@max 1} + * @param string $sqlfilters SQL criteria to filter. Syntax example "(t.code:=:'CHQ')" + * + * @url GET dictionary/payment_terms + * + * @return array List of payment terms + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 403 Access denied + * @throws RestException 503 Error when retrieving list of payments terms + */ + public function getPaymentTerms($sortfield = "sortorder", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + { + } + /** + * Get the list of shipping methods. + * + * @param int $limit Number of items per page + * @param int $page Page number {@min 0} + * @param int $active Shipping methodsm is active or not {@min 0} {@max 1} + * @param string $lang Code of the language the label of the method must be translated to + * @param string $sqlfilters SQL criteria to filter. Syntax example "(t.code:=:'CHQ')" + * + * @url GET dictionary/shipping_methods + * + * @return array List of shipping methods + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of shipping modes + */ + public function getShippingModes($limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '') + { + } + /** + * Get the list of measuring units. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param int $active Measuring unit is active or not {@min 0} {@max 1} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of measuring unit + * + * @url GET dictionary/units + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of measuring units + */ + public function getListOfMeasuringUnits($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + { + } + /** + * Get the list of legal form of business. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param int $country To filter on country + * @param int $active Lega form is active or not {@min 0} {@max 1} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of legal form + * + * @url GET dictionary/legal_form + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of legal form + */ + public function getListOfLegalForm($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $country = 0, $active = 1, $sqlfilters = '') + { + } + /** + * Get the list of staff. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param int $active Staff is active or not {@min 0} {@max 1} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of staff + * + * @url GET dictionary/staff + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of staff + */ + public function getListOfStaff($sortfield = "id", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + { + } + /** + * Get the list of social networks. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param int $active Social network is active or not {@min 0} {@max 1} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of social networks + * + * @url GET dictionary/socialnetworks + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of social networks + */ + public function getListOfsocialNetworks($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + { + } + /** + * Get the list of tickets categories. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param int $active Payment term is active or not {@min 0} {@max 1} + * @param string $lang Code of the language the label of the category must be translated to + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of ticket categories + * + * @url GET dictionary/ticket_categories + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of tickets categories + */ + public function getTicketsCategories($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '') + { + } + /** + * Get the list of tickets severity. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param int $active Payment term is active or not {@min 0} {@max 1} + * @param string $lang Code of the language the label of the severity must be translated to + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of ticket severities + * + * @url GET dictionary/ticket_severities + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of tickets severities + */ + public function getTicketsSeverities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '') + { + } + /** + * Get the list of tickets types. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param int $active Payment term is active or not {@min 0} {@max 1} + * @param string $lang Code of the language the label of the type must be translated to + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of ticket types + * + * @url GET dictionary/ticket_types + * + * @throws RestException 400 Bad value for sqlfilters + * @throws RestException 503 Error when retrieving list of tickets types + */ + public function getTicketsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '') + { + } + /** + * Get the list of incoterms. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param int $active Payment term is active or not {@min 0} {@max 1} + * @param string $lang Code of the language the label of the type must be translated to + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of incoterm types + * + * @url GET dictionary/incoterms + * + * @throws RestException 503 Error when retrieving list of incoterms types + */ + public function getListOfIncoterms($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '') + { + } + /** + * Get properties of company + * + * @url GET /company + * + * @return array|mixed Mysoc object + * + * @throws RestException 403 Forbidden + */ + public function getCompany() + { + } + /** + * Get the list of establishments. + * + * @return array List of establishments + * + * @url GET /establishments + * + * @throws RestException 503 Error when retrieving list of establishments + */ + public function getEstablishments() + { + } + /** + * Get establishment by ID. + * + * @param int $id ID of establishment + * @return Object Object with cleaned properties + * + * @url GET establishments/{id} + * + * @throws RestException 404 Establishment not found + * @throws RestException 503 Error when retrieving establishment + */ + public function getEtablishmentByID($id) + { + } + /** + * Get value of a setup variables + * + * Note that conf variables that stores security key or password hashes can't be loaded with API. + * + * @param string $constantname Name of conf variable to get + * @return string Data without useless information + * + * @url GET conf/{constantname} + * + * @throws RestException 400 Error Bad or unknown value for constantname + * @throws RestException 403 Forbidden + */ + public function getConf($constantname) + { + } + /** + * Do a test of integrity for files and setup. + * + * @param string $target Can be 'local' or 'default' or Url of the signatures file to use for the test. Must be reachable by the tested Dolibarr. + * @return array Result of file and setup integrity check + * + * @url GET checkintegrity + * + * @throws RestException 403 Forbidden + * @throws RestException 404 Signature file not found + * @throws RestException 500 Technical error + */ + public function getCheckIntegrity($target) + { + } + /** + * Get list of enabled modules + * + * @url GET /modules + * + * @return array|mixed Data without useless information + * + * @throws RestException 403 Forbidden + */ + public function getModules() + { + } + } + /** + * API that gives the status of the Dolibarr instance. + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ + class Status extends \DolibarrApi + { + /** + * Constructor of the class + */ + public function __construct() + { + } + /** + * Get status (Dolibarr version) + * + * @return array + */ + public function index() + { + } + } + /** + * Class for Asset + */ + class Asset extends \CommonObject + { + /** + * @var string ID of module. + */ + public $module = 'asset'; + /** + * @var string ID to identify a managed object. + */ + public $element = 'asset'; + /** + * @var string Name of table without prefix where an object is stored. This is also the key used for extrafields management. + */ + public $table_element = 'asset'; + /** + * @var string String with name of icon for asset. Must be the part after the 'object_' into object_asset.png + */ + public $picto = 'asset'; + const STATUS_DRAFT = 0; + // In progress + const STATUS_DISPOSED = 9; + // Disposed + /** + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")' + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwritten by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and the field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into a list (for example for percentage) + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example, 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if the value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set a list of values if a type is a list of predefined values. For example, array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a creation form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'validate' is 1 if you need to validate with $this->validateField() + * 'copytoclipboard' is 1 or 2 to allow adding a picto to copy value into clipboard (1=picto after label, 2=picto after value) + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'noteditable' => 0, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => "Reference of object"), 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => '2', 'validate' => 1), 'fk_asset_model' => array('type' => 'integer:AssetModel:asset/class/assetmodel.class.php:1:((status:=:1) and (entity:IN:__SHARED_ENTITIES__))', 'label' => 'AssetModel', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => 1), 'qty' => array('type' => 'real', 'label' => 'Qty', 'enabled' => 1, 'position' => 50, 'notnull' => 1, 'visible' => 0, 'default' => '1', 'isameasure' => 1, 'css' => 'maxwidth75imp', 'validate' => 1), 'acquisition_type' => array('type' => 'smallint', 'label' => 'AssetAcquisitionType', 'enabled' => 1, 'position' => 60, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array('0' => 'AssetAcquisitionTypeNew', '1' => 'AssetAcquisitionTypeOccasion'), 'validate' => 1), 'asset_type' => array('type' => 'smallint', 'label' => 'AssetType', 'enabled' => 1, 'position' => 70, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array('0' => 'AssetTypeIntangible', '1' => 'AssetTypeTangible', '2' => 'AssetTypeInProgress', '3' => 'AssetTypeFinancial'), 'validate' => 1), 'not_depreciated' => array('type' => 'boolean', 'label' => 'AssetNotDepreciated', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'default' => '0', 'visible' => 1, 'validate' => 1), 'date_acquisition' => array('type' => 'date', 'label' => 'AssetDateAcquisition', 'enabled' => 1, 'position' => 90, 'notnull' => 1, 'visible' => 1), 'date_start' => array('type' => 'date', 'label' => 'AssetDateStart', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => -1), 'acquisition_value_ht' => array('type' => 'price', 'label' => 'AssetAcquisitionValueHT', 'enabled' => 1, 'position' => 110, 'notnull' => 1, 'visible' => 1, 'isameasure' => 1, 'validate' => 1), 'recovered_vat' => array('type' => 'price', 'label' => 'AssetRecoveredVAT', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'isameasure' => 1, 'validate' => 1), 'reversal_date' => array('type' => 'date', 'label' => 'AssetReversalDate', 'enabled' => 1, 'position' => 130, 'notnull' => 0, 'visible' => 1), 'reversal_amount_ht' => array('type' => 'price', 'label' => 'AssetReversalAmountHT', 'enabled' => 1, 'position' => 140, 'notnull' => 0, 'visible' => 1, 'isameasure' => 1, 'validate' => 1), 'disposal_date' => array('type' => 'date', 'label' => 'AssetDisposalDate', 'enabled' => 1, 'position' => 200, 'notnull' => 0, 'visible' => -2), 'disposal_amount_ht' => array('type' => 'price', 'label' => 'AssetDisposalAmount', 'enabled' => 1, 'position' => 210, 'notnull' => 0, 'visible' => -2, 'default' => '0', 'isameasure' => 1, 'validate' => 1), 'fk_disposal_type' => array('type' => 'sellist:c_asset_disposal_type:label:rowid::active=1', 'label' => 'AssetDisposalType', 'enabled' => 1, 'position' => 220, 'notnull' => 0, 'visible' => -2, 'index' => 1, 'validate' => 1), 'disposal_depreciated' => array('type' => 'boolean', 'label' => 'AssetDisposalDepreciated', 'enabled' => 1, 'position' => 230, 'notnull' => 0, 'default' => '0', 'visible' => -2, 'validate' => 1), 'disposal_subject_to_vat' => array('type' => 'boolean', 'label' => 'AssetDisposalSubjectToVat', 'enabled' => 1, 'position' => 240, 'notnull' => 0, 'default' => '0', 'visible' => -2, 'validate' => 1), 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 300, 'notnull' => 0, 'visible' => 0, 'validate' => 1), 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 301, 'notnull' => 0, 'visible' => 0, 'validate' => 1), 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2), 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid'), 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2), 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => 0), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'position' => 1010, 'notnull' => -1, 'visible' => 0), 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '0', 'visible' => 2, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '9' => 'Canceled'), 'validate' => 1)); + /** + * @var int + */ + public $rowid; + /** + * @var string + */ + public $ref; + /** + * @var string + */ + public $label; + /** + * @var int + */ + public $fk_asset_model; + /** + * @var string + */ + public $reversal_amount_ht; + /** + * @var string + */ + public $acquisition_value_ht; + /** + * @var string + */ + public $recovered_vat; + /** + * @var string + */ + public $reversal_date; + /** + * @var string + */ + public $date_acquisition; + /** + * @var string + */ + public $date_start; + /** + * @var float + */ + public $qty; + /** + * @var int + */ + public $acquisition_type; + /** + * @var int + */ + public $asset_type; + /** + * @var int<0,1> + */ + public $not_depreciated; + /** + * @var ?string + */ + public $disposal_date; + /** + * @var null|string|int Is string, but asset/Card.php assigns int. + */ + public $disposal_amount_ht; + /** + * @var ?int + */ + public $fk_disposal_type; + /** + * @var int<0,1> + */ + public $disposal_depreciated; + /** + * @var int<0,1> + */ + public $disposal_subject_to_vat; + /** + * @var int + */ + public $supplier_invoice_id; + /** + * @var string + */ + public $note_public; + /** + * @var string + */ + public $note_private; + /** + * @var int + */ + public $fk_user_creat; + /** + * @var int + */ + public $fk_user_modif; + /** + * @var string + */ + public $last_main_doc; + /** + * @var string + */ + public $import_key; + /** + * @var string + */ + public $model_pdf; + /** + * @var int + */ + public $status; + /** + * @var static object oldcopy + */ + public $oldcopy; + /** + * @var AssetDepreciationOptions Used for computed fields of depreciation options class. + */ + public $asset_depreciation_options; + /** + * @var AssetAccountancyCodes + */ + public $asset_accountancy_codes; + /** + * @var array> List of depreciation lines for each mode (sort by depreciation date). + */ + public $depreciation_lines = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int<-1,max> Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Clone an object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @return Object|int<-1,-1> New object created, <0 if KO + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int<-1,max> Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = \null) + { + } + /** + * Load object lines in memory from the database + * + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + } + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset Offset + * @param string $filter Filter as an Universal Search string. + * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')' + * @param string $filtermode No more used + * @return self[]|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Set asset model + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function setDataFromAssetModel(\User $user, $notrigger = 0) + { + } + /** + * Fetch depreciation lines for each mode in $this->depreciation_lines (sort by depreciation date) + * + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function fetchDepreciationLines() + { + } + /** + * If has depreciation lines in bookkeeping + * + * @return int Return integer <0 if KO, 0 if NO, 1 if Yes + */ + public function hasDepreciationLinesInBookkeeping() + { + } + /** + * Add depreciation line for a mode + * + * @param string $mode Depreciation mode (economic, accelerated_depreciation, ...) + * @param string $ref Ref line + * @param int $depreciation_date Depreciation date + * @param float $depreciation_ht Depreciation amount HT + * @param float $cumulative_depreciation_ht Depreciation cumulative amount HT + * @param string $accountancy_code_debit Accountancy code Debit + * @param string $accountancy_code_credit Accountancy code Credit + * @return int Return integer <0 if KO, Id of created line if OK + */ + public function addDepreciationLine($mode, $ref, $depreciation_date, $depreciation_ht, $cumulative_depreciation_ht, $accountancy_code_debit, $accountancy_code_credit) + { + } + /** + * Calculation depreciation lines (reversal and future) for each mode + * + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function calculationDepreciation() + { + } + /** + * Set last cumulative depreciation for each mode + * + * @param int $asset_depreciation_id Asset depreciation line ID + * @return int Return integer <0 if KO, >0 if OK + */ + public function setLastCumulativeDepreciation($asset_depreciation_id) + { + } + /** + * Set dispose status + * + * @param User $user Object user that dispose + * @param int $disposal_invoice_id Disposal invoice ID + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK + */ + public function dispose($user, $disposal_invoice_id, $notrigger = 0) + { + } + /** + * Set back to validated status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK + */ + public function reopen($user, $notrigger = 0) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $maxlen Max length of name + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLabelStatus($mode = 0) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Load the info information in the object + * + * @param int $id Id of object + * @return void + */ + public function info($id) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Create an array of lines + * + * @return array|int array of lines if OK, <0 if KO + */ + public function getLinesArray() + { + } + /** + * Returns the reference to the following non used object depending on the active numbering module. + * + * @return string Object free reference + */ + public function getNextNumRef() + { + } + } + /** + * Class for AssetAccountancyCodes + */ + class AssetAccountancyCodes extends \CommonObject + { + /** + * @var array Array with all accountancy codes info by mode. + * Note : 'economic' mode is mandatory and is the primary accountancy codes + * 'depreciation_asset' and 'depreciation_expense' is mandatory and is used for write depreciation in bookkeeping + */ + public $accountancy_codes_fields = array('economic' => array('label' => 'AssetAccountancyCodeDepreciationEconomic', 'table' => 'asset_accountancy_codes_economic', 'depreciation_debit' => 'depreciation_asset', 'depreciation_credit' => 'depreciation_expense', 'fields' => array('asset' => array('label' => 'AssetAccountancyCodeAsset'), 'depreciation_asset' => array('label' => 'AssetAccountancyCodeDepreciationAsset'), 'depreciation_expense' => array('label' => 'AssetAccountancyCodeDepreciationExpense'), 'value_asset_sold' => array('label' => 'AssetAccountancyCodeValueAssetSold'), 'receivable_on_assignment' => array('label' => 'AssetAccountancyCodeReceivableOnAssignment'), 'proceeds_from_sales' => array('label' => 'AssetAccountancyCodeProceedsFromSales'), 'vat_collected' => array('label' => 'AssetAccountancyCodeVatCollected'), 'vat_deductible' => array('label' => 'AssetAccountancyCodeVatDeductible', 'column_break' => \true))), 'accelerated_depreciation' => array('label' => 'AssetAccountancyCodeDepreciationAcceleratedDepreciation', 'table' => 'asset_accountancy_codes_fiscal', 'depreciation_debit' => 'accelerated_depreciation', 'depreciation_credit' => 'endowment_accelerated_depreciation', 'fields' => array('accelerated_depreciation' => array('label' => 'AssetAccountancyCodeAcceleratedDepreciation'), 'endowment_accelerated_depreciation' => array('label' => 'AssetAccountancyCodeEndowmentAcceleratedDepreciation'), 'provision_accelerated_depreciation' => array('label' => 'AssetAccountancyCodeProvisionAcceleratedDepreciation')))); + /** + * @var array Array with all accountancy codes by mode. + */ + public $accountancy_codes = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Fill accountancy_codes property of object (using for data sent by forms) + * + * @return array Array of values + */ + public function setAccountancyCodesFromPost() + { + } + /** + * Load accountancy codes of a asset or a asset model + * + * @param int $asset_id Asset ID to set + * @param int $asset_model_id Asset model ID to set + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetchAccountancyCodes($asset_id = 0, $asset_model_id = 0) + { + } + /** + * Update accountancy codes of a asset or a asset model + * + * @param User $user User making update + * @param int $asset_id Asset ID to set + * @param int $asset_model_id Asset model ID to set + * @param int $notrigger 1=disable trigger UPDATE (when called by create) + * @return int Return integer <0 if KO, >0 if OK + */ + public function updateAccountancyCodes($user, $asset_id = 0, $asset_model_id = 0, $notrigger = 0) + { + } + } + /** + * Class for AssetDepreciationOptions + */ + class AssetDepreciationOptions extends \CommonObject + { + /** + * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. + */ + public $table_element = ''; + /** + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")' + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage) + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'validate' is 1 if need to validate with $this->validateField() + * 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value) + * 'enabled_field' if the mode block or a field is enabled if another field equal a value (="mode_key:field_key:value") + * 'only_on_asset' is 1 if only a field on a asset + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array(); + /** + * @var array Array with all deprecation options info by mode. + * Note : economic mode is mandatory and is the primary options + */ + public $deprecation_options_fields = array('economic' => array('label' => 'AssetDepreciationOptionEconomic', 'table' => 'asset_depreciation_options_economic', 'fields' => array('depreciation_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDepreciationType', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDepreciationTypeLinear', 1 => 'AssetDepreciationOptionDepreciationTypeDegressive', 2 => 'AssetDepreciationOptionDepreciationTypeExceptional'), 'validate' => 1), 'degressive_coefficient' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionDegressiveRate', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1, 'enabled_field' => 'economic:depreciation_type:1'), 'duration' => array('type' => 'integer', 'label' => 'AssetDepreciationOptionDuration', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1), 'duration_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDurationType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDurationTypeAnnual', 1 => 'AssetDepreciationOptionDurationTypeMonthly'), 'validate' => 1), 'rate' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionRate', 'enabled' => 1, 'position' => 50, 'visible' => 3, 'default' => '0', 'isameasure' => 1, 'validate' => 1, 'computed' => '$object->asset_depreciation_options->getRate("economic")'), 'accelerated_depreciation_option' => array('type' => 'boolean', 'label' => 'AssetDepreciationOptionAcceleratedDepreciation', 'enabled' => 1, 'position' => 60, 'column_break' => \true, 'notnull' => 0, 'default' => '0', 'visible' => 1, 'validate' => 1), 'amount_base_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDepreciationHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 90, 'notnull' => 0, 'required' => 1, 'visible' => 1, 'default' => '$object->reversal_amount_ht > 0 ? $object->reversal_amount_ht : $object->acquisition_value_ht', 'isameasure' => 1, 'validate' => 1), 'amount_base_deductible_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDeductibleHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1), 'total_amount_last_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionTotalAmountLastDepreciationHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 110, 'noteditable' => 1, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1))), 'accelerated_depreciation' => array('label' => 'AssetDepreciationOptionAcceleratedDepreciation', 'table' => 'asset_depreciation_options_fiscal', 'enabled_field' => 'economic:accelerated_depreciation_option:1', 'fields' => array('depreciation_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDepreciationType', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDepreciationTypeLinear', 1 => 'AssetDepreciationOptionDepreciationTypeDegressive', 2 => 'AssetDepreciationOptionDepreciationTypeExceptional'), 'validate' => 1), 'degressive_coefficient' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionDegressiveRate', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1, 'enabled_field' => 'accelerated_depreciation:depreciation_type:1'), 'duration' => array('type' => 'integer', 'label' => 'AssetDepreciationOptionDuration', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1), 'duration_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDurationType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDurationTypeAnnual', 1 => 'AssetDepreciationOptionDurationTypeMonthly'), 'validate' => 1), 'rate' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionRate', 'enabled' => 1, 'position' => 50, 'visible' => 3, 'default' => '0', 'isameasure' => 1, 'validate' => 1, 'computed' => '$object->asset_depreciation_options->getRate("accelerated_depreciation")'), 'amount_base_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDepreciationHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 80, 'column_break' => \true, 'notnull' => 0, 'required' => 1, 'visible' => 1, 'default' => '$object->reversal_amount_ht > 0 ? $object->reversal_amount_ht : $object->acquisition_value_ht', 'isameasure' => 1, 'validate' => 1), 'amount_base_deductible_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDeductibleHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 90, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1), 'total_amount_last_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionTotalAmountLastDepreciationHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 100, 'noteditable' => 1, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1)))); + /** + * @var int + */ + public $fk_asset; + /** + * @var int + */ + public $fk_asset_model; + /** + * @var int + */ + public $fk_user_modif; + /** + * @var array Array with all deprecation options by mode. + */ + public $deprecation_options = array(); + /** + * @var int + */ + public $depreciation_type; + /** + * @var float + */ + public $degressive_coefficient; + /** + * @var int + */ + public $duration; + /** + * @var int + */ + public $duration_type; + /** + * @var int<0,1> + */ + public $accelerated_depreciation_option; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Set object infos for a mode + * + * @param string $mode Depreciation mode (economic, accelerated_depreciation, ...) + * @param int $class_type Type (0:asset, 1:asset model) + * @param bool $all_field Get all fields + * @return int Return integer <0 if KO, >0 if OK + */ + public function setInfosForMode($mode, $class_type = 0, $all_field = \false) + { + } + /** + * Fill deprecation_options property of object (using for data sent by forms) + * + * @param int<0,1> $class_type Type (0:asset, 1:asset model) + * @return int<-1,-1>|int<1,1> Return integer <0 if KO, >0 if OK + */ + public function setDeprecationOptionsFromPost($class_type = 0) + { + } + /** + * Load deprecation options of a asset or a asset model + * + * @param int $asset_id Asset ID to set + * @param int $asset_model_id Asset model ID to set + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetchDeprecationOptions($asset_id = 0, $asset_model_id = 0) + { + } + /** + * get general depreciation info for a mode (used in depreciation card) + * + * @param string $mode Depreciation mode (economic, accelerated_depreciation, ...) + * @return array{base_depreciation_ht:string,duration:string,duration_type:string,rate:string}|int<-1,-1> Return integer <0 if KO otherwise array with general depreciation info + */ + public function getGeneralDepreciationInfoForMode($mode) + { + } + /** + * Update deprecation options of a asset or a asset model + * + * @param User $user User making update + * @param int $asset_id Asset ID to set + * @param int $asset_model_id Asset model ID to set + * @param int $notrigger 1=disable trigger UPDATE (when called by create) + * @return int Return integer <0 if KO, >0 if OK + */ + public function updateDeprecationOptions($user, $asset_id = 0, $asset_model_id = 0, $notrigger = 0) + { + } + /** + * Get rate + * + * @param string $mode Depreciation mode (economic, accelerated_depreciation, ...) + * @return string Rate of the provided mode option + */ + public function getRate($mode) + { + } + } + //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** + * Class for AssetModel + */ + class AssetModel extends \CommonObject + { + /** + * @var string ID of module. + */ + public $module = 'asset'; + /** + * @var string ID to identify managed object. + */ + public $element = 'assetmodel'; + /** + * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. + */ + public $table_element = 'asset_model'; + /** + * @var string String with name of icon for assetmodel. Must be the part after the 'object_' into object_assetmodel.png + */ + public $picto = 'asset'; + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_CANCELED = 9; + /** + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")' + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage) + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'validate' is 1 if need to validate with $this->validateField() + * 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value) + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1), 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => '2', 'validate' => 1), 'asset_type' => array('type' => 'smallint', 'label' => 'AssetType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetTypeIntangible', 1 => 'AssetTypeTangible', 2 => 'AssetTypeInProgress', 3 => 'AssetTypeFinancial'), 'validate' => 1), 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 300, 'notnull' => 0, 'visible' => 0, 'validate' => 1), 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 301, 'notnull' => 0, 'visible' => 0, 'validate' => 1), 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2), 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid'), 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2), 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '1', 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Enabled', 9 => 'Disabled'), 'validate' => 1)); + /** + * @var int + */ + public $rowid; + /** + * @var string + */ + public $ref; + /** + * @var string + */ + public $label; + /** + * @var string + */ + public $asset_type; + /** + * @var string + */ + public $note_public; + /** + * @var string + */ + public $note_private; + /** + * @var int + */ + public $fk_user_creat; + /** + * @var int + */ + public $fk_user_modif; + /** + * @var string + */ + public $last_main_doc; + /** + * @var string + */ + public $import_key; + /** + * @var string + */ + public $model_pdf; + /** + * @var int + */ + public $status; + /** + * @var AssetDepreciationOptions + */ + public $asset_depreciation_options; + /** + * @var AssetAccountancyCodes + */ + public $asset_accountancy_codes; + // /** + // * @var string Field with ID of parent key if this object has a parent + // */ + // public $fk_element = 'fk_assetmodel'; + // /** + // * @var array List of child tables. To test if we can delete object. + // */ + // protected $childtables = array(); + // /** + // * @var array List of child tables. To know object to delete on cascade. + // * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will + // * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object + // */ + // protected $childtablesoncascade = array('asset_assetmodeldet'); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger false=launch triggers after, true=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Clone an object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @return mixed New object created, <0 if KO + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = \null) + { + } + /** + * Load object lines in memory from the database + * + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + } + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset Offset + * @param string $filter Filter as an Universal Search string. + * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')' + * @param string $filtermode No more used + * @return array|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Validate object + * + * @param User $user User making status change + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO + */ + public function validate($user, $notrigger = 0) + { + } + /** + * Set draft status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function setDraft($user, $notrigger = 0) + { + } + /** + * Set cancel status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK + */ + public function cancel($user, $notrigger = 0) + { + } + /** + * Set back to validated status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK + */ + public function reopen($user, $notrigger = 0) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLabelStatus($mode = 0) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Load the info information in the object + * + * @param int $id Id of object + * @return void + */ + public function info($id) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Create an array of lines + * + * @return array|int array of lines if OK, <0 if KO + */ + public function getLinesArray() + { + } + /** + * Action executed by scheduler + * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' + * Use public function doScheduledJob($param1, $param2, ...) to get parameters + * + * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) + */ + public function doScheduledJob() + { + } + } + /* Copyright (C) 2017 ATM Consulting + * + * 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 . + */ + /** + * Class to manage certif authority + */ + class BlockedLogAuthority + { + /** + * DoliDB + * @var DoliDB + */ + public $db; + /** + * Id of the authority + * @var int + */ + public $id; + /** + * @var string Ref of the authority + */ + public $ref; + /** + * Unique fingerprint of the blockchain to store + * @var string + */ + public $signature = ''; + /** + * Entire fingerprints blockchain + * @var string + */ + public $blockchain = ''; + /** + * timestamp + * @var int + */ + public $tms = 0; + /** + * Error message + * @var string + */ + public $error; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Get the blockchain + * + * @return string blockchain + */ + public function getLocalBlockChain() + { + } + /** + * Get hash of the block chain to check + * + * @return string hash md5 of blockchain + */ + public function getBlockchainHash() + { + } + /** + * Get hash of the block chain to check + * + * @param string $hash hash md5 of blockchain to test + * @return boolean + */ + public function checkBlockchain($hash) + { + } + /** + * Add a new block to the chain + * + * @param string $block new block to chain + * @return void + */ + public function addBlock($block) + { + } + /** + * hash already exist into chain ? + * + * @param string $block new block to chain + * @return boolean + */ + public function checkBlock($block) + { + } + /** + * Get object from database + * + * @param int $id Id of object to load + * @param string $signature Signature of object to load + * @return int >0 if OK, <0 if KO, 0 if not found + */ + public function fetch($id, $signature = '') + { + } + /** + * Create authority in database. + * + * @param User $user Object user that create + * @return int Return integer <0 if KO, >0 if OK + */ + public function create($user) + { + } + /** + * Create authority in database. + * + * @param User $user Object user that create + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user) + { + } + /** + * For cron to sync to authority. + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function syncSignatureWithAuthority() + { + } + } + /* Copyright (C) 2017 ATM Consulting + * Copyright (C) 2017-2020 Laurent Destailleur + * Copyright (C) 2022 charlene benke + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * + * 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 . + * + * See https://medium.com/@lhartikk/a-blockchain-in-200-lines-of-code-963cc1cc0e54 + */ + /** + * Class to manage Blocked Log + */ + class BlockedLog + { + /** + * @var DoliDB Database handler + */ + public $db; + /** + * Id of the log + * @var int + */ + public $id; + /** + * Entity + * @var int + */ + public $entity; + /** + * @var string Error message + */ + public $error = ''; + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + /** + * Unique fingerprint of the log + * @var string + */ + public $signature = ''; + /** + * Unique fingerprint of the line log content + * @var string + */ + public $signature_line = ''; + /** + * @var float|string|null + */ + public $amounts = \null; + /** + * trigger action + * @var string + */ + public $action = ''; + /** + * Object element + * @var string + */ + public $element = ''; + /** + * Object id + * @var int + */ + public $fk_object = 0; + /** + * Log certified by remote authority or not + * @var boolean + */ + public $certified = \false; + /** + * Author + * @var int + */ + public $fk_user = 0; + /** + * @var int|string date_creation + */ + public $date_creation; + /** + * @var int|string $date_modification; + */ + public $date_modification; + /** + * @var int + */ + public $date_object = 0; + /** + * @var string + */ + public $ref_object = ''; + /** + * @var ?stdClass + */ + public $object_data = \null; + /** + * @var string + */ + public $object_version = ''; + /** + * @var string + */ + public $user_fullname = ''; + /** + * Array of tracked event codes + * @var string[] + */ + public $trackedevents = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Load list of tracked events into $this->trackedevents. + * + * @return int<1,1> Always 1 + */ + public function loadTrackedEvents() + { + } + /** + * Try to retrieve source object (it it still exists). + * + * @return string URL string of source object + */ + public function getObjectLink() + { + } + /** + * Try to retrieve user author + * + * @return string + */ + public function getUser() + { + } + /** + * Populate properties of log from object data + * + * @param CommonObject $object object to store + * @param string $action action + * @param float|int $amounts amounts + * @param ?User $fuser User object (forced) + * @return int<-1,-1>|int<1,1> >0 if OK, <0 if KO + */ + public function setObjectData(&$object, $action, $amounts, $fuser = \null) + { + } + /** + * Get object from database + * + * @param int $id Id of object to load + * @return int<-1,1> >0 if OK, <0 if KO, 0 if not found + */ + public function fetch($id) + { + } + /** + * Encode data + * + * @param ?stdClass $data Data to serialize + * @param int<0,1> $mode 0=serialize, 1=json_encode + * @return string Value serialized, an object (stdClass) + */ + public function dolEncodeBlockedData($data, $mode = 0) + { + } + /** + * Decode data + * + * @param string $data Data to unserialize + * @param int $mode 0=unserialize, 1=json_decode + * @return Object Value unserialized, an object (stdClass) + */ + public function dolDecodeBlockedData($data, $mode = 0) + { + } + /** + * Set block certified by authority + * + * @return boolean + */ + public function setCertified() + { + } + /** + * Create blocked log in database. + * + * @param User $user Object user that create + * @param string $forcesignature Force signature (for example '0000000000' when we disabled the module) + * @return int<-3,-1>|int<1,1> Return integer <0 if KO, >0 if OK + */ + public function create($user, $forcesignature = '') + { + } + /** + * Check if current signature still correct compared to the value in chain + * + * @param string $previoushash If previous signature hash is known, we can provide it to avoid to make a search of it in database. + * @param int<0,2> $returnarray 1=Return array of details, 2=Return array of details including keyforsignature, 0=Boolean + * @return boolean|array{checkresult:bool,calculatedsignature:string,previoushash:string,keyforsignature?:string} True if OK, False if KO + */ + public function checkSignature($previoushash = '', $returnarray = 0) + { + } + /** + * Get previous signature/hash in chain + * + * @param int<0,1> $withlock 1=With a lock + * @param int $beforeid ID of a record + * @return string Hash of previous record (if beforeid is defined) or hash of last record (if beforeid is 0) + */ + public function getPreviousHash($withlock = 0, $beforeid = 0) + { + } + /** + * Return array of log objects (with criteria) + * + * @param string $element element to search + * @param int $fk_object id of object to search + * @param int<0,max> $limit max number of element, 0 for all + * @param string $sortfield sort field + * @param string $sortorder sort order + * @param int $search_fk_user id of user(s) + * @param int $search_start start time limit + * @param int $search_end end time limit + * @param string $search_ref search ref + * @param string $search_amount search amount + * @param string $search_code search code + * @return BlockedLog[]|int<-2,-1> Array of object log or <0 if error + */ + public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_fk_user = -1, $search_start = -1, $search_end = -1, $search_ref = '', $search_amount = '', $search_code = '') + { + } + /** + * Return the signature (hash) of the "genesis-block" (Block 0). + * + * @return string Signature of genesis-block for current conf->entity + */ + public function getSignature() + { + } + /** + * Check if module was already used or not for at least one recording. + * + * @param int<0,1> $ignoresystem Ignore system events for the test + * @return bool + */ + public function alreadyUsed($ignoresystem = 0) + { + } + } + /** + * \file htdocs/bom/class/api_boms.class.php + * \ingroup bom + * \brief File for API management of BOM. + */ + /** + * API class for BOM + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ + class Boms extends \DolibarrApi + { + /** + * @var BOM $bom {@type BOM} + */ + public $bom; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get properties of a bom object + * + * Return an array with bom information + * + * @param int $id ID of bom + * @return Object Object with cleaned properties + * + * @url GET {id} + * + * @throws RestException 403 Access denied + * @throws RestException 404 BOM not found + */ + public function get($id) + { + } + /** + * List boms + * + * Get a list of boms + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @return array Array of order objects + * + * @throws RestException 400 Bad sqlfilters + * @throws RestException 403 Access denied + * @throws RestException 503 Error retrieving list of boms + */ + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '') + { + } + /** + * Create bom object + * + * @param array $request_data Request datas + * @return int ID of bom + * + * @throws RestException 403 Access denied + * @throws RestException 500 Error retrieving list of boms + */ + public function post($request_data = \null) + { + } + /** + * Update bom + * + * @param int $id Id of bom to update + * @param array $request_data Datas + * @return Object Object after update + * + * @throws RestException 403 Access denied + * @throws RestException 404 BOM not found + * @throws RestException 500 Error updating bom + */ + public function put($id, $request_data = \null) + { + } + /** + * Delete bom + * + * @param int $id BOM ID + * @return array + * + * @throws RestException 403 Access denied + * @throws RestException 404 BOM not found + * @throws RestException 500 Error deleting bom + */ + public function delete($id) + { + } + /** + * Get lines of an BOM + * + * @param int $id Id of BOM + * + * @url GET {id}/lines + * + * @return array + * + * @throws RestException 403 Access denied + * @throws RestException 404 BOM not found + */ + public function getLines($id) + { + } + /** + * Add a line to given BOM + * + * @param int $id Id of BOM to update + * @param array $request_data BOMLine data + * + * @url POST {id}/lines + * + * @return int + * + * @throws RestException 403 Access denied + * @throws RestException 404 BOM not found + * @throws RestException 500 Error adding bom line + */ + public function postLine($id, $request_data = \null) + { + } + /** + * Update a line to given BOM + * + * @param int $id Id of BOM to update + * @param int $lineid Id of line to update + * @param array $request_data BOMLine data + * + * @url PUT {id}/lines/{lineid} + * + * @return object|bool + * + * @throws RestException 403 Access denied + * @throws RestException 404 BOM not found + */ + public function putLine($id, $lineid, $request_data = \null) + { + } + /** + * Delete a line to given BOM + * + * + * @param int $id Id of BOM to update + * @param int $lineid Id of line to delete + * + * @url DELETE {id}/lines/{lineid} + * + * @return array + * + * @throws RestException 403 Access denied + * @throws RestException 404 BOM not found + * @throws RestException 500 Error deleting bom line + */ + public function deleteLine($id, $lineid) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensible object datas + * + * @param Object $object Object to clean + * @return Object Object with cleaned properties + */ + protected function _cleanObjectDatas($object) + { + } + } + //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** + * Class for BOM + */ + class BOM extends \CommonObject + { + /** + * @var string ID of module. + */ + public $module = 'bom'; + /** + * @var string ID to identify managed object + */ + public $element = 'bom'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'bom_bom'; + /** + * @var string String with name of icon for bom. Must be the part after the 'object_' into object_bom.png + */ + public $picto = 'bom'; + /** + * @var Product Object product of the BOM + */ + public $product; + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_CANCELED = 9; + /** + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")' + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array( + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id"), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'default' => 1, 'index' => 1, 'position' => 5), + 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'noteditable' => 1, 'visible' => 4, 'position' => 10, 'notnull' => 1, 'default' => '(PROV)', 'index' => 1, 'searchall' => 1, 'comment' => "Reference of BOM", 'showoncombobox' => 1, 'csslist' => 'nowraponall'), + 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'notnull' => 1, 'searchall' => 1, 'showoncombobox' => '2', 'autofocusoncreate' => 1, 'css' => 'minwidth300 maxwidth400', 'csslist' => 'tdoverflowmax200'), + 'bomtype' => array('type' => 'integer', 'label' => 'Type', 'enabled' => 1, 'visible' => 1, 'position' => 33, 'notnull' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'Manufacturing', 1 => 'Disassemble'), 'css' => 'minwidth175', 'csslist' => 'minwidth175 center'), + //'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')), + 'fk_product' => array('type' => 'integer:Product:product/class/product.class.php:1:((finished:is:null) or (finished:!=:0))', 'label' => 'Product', 'picto' => 'product', 'enabled' => 1, 'visible' => 1, 'position' => 35, 'notnull' => 1, 'index' => 1, 'help' => 'ProductBOMHelp', 'css' => 'maxwidth500', 'csslist' => 'tdoverflowmax100'), + 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => -1, 'position' => 60, 'notnull' => -1), + 'qty' => array('type' => 'real', 'label' => 'Quantity', 'enabled' => 1, 'visible' => 1, 'default' => 1, 'position' => 55, 'notnull' => 1, 'isameasure' => 1, 'css' => 'maxwidth50imp right'), + //'efficiency' => array('type'=>'real', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>-1, 'default'=>1, 'position'=>100, 'notnull'=>0, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLossForProductProduced'), + 'duration' => array('type' => 'duration', 'label' => 'EstimatedDuration', 'enabled' => 1, 'visible' => -1, 'position' => 101, 'notnull' => -1, 'css' => 'maxwidth50imp', 'help' => 'EstimatedDurationDesc'), + 'fk_warehouse' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label' => 'WarehouseForProduction', 'picto' => 'stock', 'enabled' => 1, 'visible' => -1, 'position' => 102, 'css' => 'maxwidth500', 'csslist' => 'tdoverflowmax100'), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => -2, 'position' => 161, 'notnull' => -1), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => -2, 'position' => 162, 'notnull' => -1), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'position' => 300, 'notnull' => 1), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'position' => 501, 'notnull' => 1), + 'date_valid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -2, 'position' => 502, 'notnull' => 0), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserCreation', 'picto' => 'user', 'enabled' => 1, 'visible' => -2, 'position' => 510, 'notnull' => 1, 'foreignkey' => 'user.rowid', 'csslist' => 'tdoverflowmax100'), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'picto' => 'user', 'enabled' => 1, 'visible' => -2, 'position' => 511, 'notnull' => -1, 'csslist' => 'tdoverflowmax100'), + 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'picto' => 'user', 'enabled' => 1, 'visible' => -2, 'position' => 512, 'notnull' => 0, 'csslist' => 'tdoverflowmax100'), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 1000, 'notnull' => -1), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 1010), + 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 2, 'position' => 1000, 'notnull' => 1, 'default' => 0, 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Enabled', 9 => 'Disabled')), + ); + /** + * @var int rowid + */ + public $rowid; + /** + * @var string ref + */ + public $ref; + /** + * @var string label + */ + public $label; + /** + * @var int bomtype + */ + public $bomtype; + /** + * @var string description + */ + public $description; + /** + * @var int|string date_valid + */ + public $date_valid; + /** + * @var int Id User creator + */ + public $fk_user_creat; + /** + * @var int Id User modifying + */ + public $fk_user_modif; + /** + * @var int Id User modifying + */ + public $fk_user_valid; + /** + * @var int Id User modifying + */ + public $fk_warehouse; + /** + * @var string import key + */ + public $import_key; + /** + * @var int status + */ + public $status; + /** + * @var int product Id + */ + public $fk_product; + /** + * @var float + */ + public $qty; + /** + * @var float + */ + public $duration; + /** + * @var float + */ + public $efficiency; + // END MODULEBUILDER PROPERTIES + // If this object has a subtable with lines + /** + * @var string Name of subtable line + */ + public $table_element_line = 'bom_bomline'; + /** + * @var string Fieldname with ID of parent key if this field has a parent + */ + public $fk_element = 'fk_bom'; + /** + * @var string Name of subtable class that manage subtable lines + */ + public $class_element_line = 'BOMLine'; + // /** + // * @var array List of child tables. To test if we can delete object. + // */ + // protected $childtables=array(); + /** + * @var string[] List of child tables. To know object to delete on cascade. + */ + protected $childtablesoncascade = array('bom_bomline'); + /** + * @var BOMLine[] Array of subtable lines + */ + public $lines = array(); + /** + * @var float Calculated cost for the BOM + */ + public $total_cost = 0; + /** + * @var float Calculated cost for 1 unit of the product in BOM + */ + public $unit_cost = 0; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger false=launch triggers after, true=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 1) + { + } + /** + * Clone an object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @return BOM|int<-1,-1> New object created, <0 if KO + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int<-1,1> Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = \null) + { + } + /** + * Load object lines in memory from the database + * + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + } + /** + * Load object lines in memory from the database by type of product + * + * @param int<0,1> $typeproduct 0 type product, 1 type service + * @return int<-1,1> Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLinesbytypeproduct($typeproduct = 0) + { + } + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int<0,max> $limit Limit + * @param int<0,max> $offset Offset + * @param string $filter Filter USF + * @param string $filtermode Filter mode (AND or OR) + * @return BOM[]|int<-1,-1> int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int<-1,-1>|int<1,1> Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 1) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int<-1,-1>|int<1,1> Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 1) + { + } + /** + * Add an BOM line into database (linked to BOM) + * + * @param int $fk_product Id of product + * @param float $qty Quantity + * @param int<0,1> $qty_frozen If the qty is Frozen + * @param int $disable_stock_change Disable stock change on using in MO + * @param float $efficiency Efficiency in MO + * @param int<-1,max> $position Position of BOM-Line in BOM-Lines + * @param ?int $fk_bom_child Id of BOM Child + * @param ?string $import_key Import Key + * @param int $fk_unit Unit + * @param array $array_options extrafields array + * @param ?int $fk_default_workstation Default workstation + * @return int<-3,max> Return integer <0 if KO, Id of created object if OK + */ + public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = \null, $import_key = \null, $fk_unit = 0, $array_options = array(), $fk_default_workstation = \null) + { + } + /** + * Update an BOM line into database + * + * @param int $rowid Id of line to update + * @param float $qty Quantity + * @param float $qty_frozen Frozen quantity + * @param int $disable_stock_change Disable stock change on using in MO + * @param float $efficiency Efficiency in MO + * @param int<-1,max> $position Position of BOM-Line in BOM-Lines + * @param ?string $import_key Import Key + * @param int $fk_unit Unit of line + * @param array $array_options extrafields array + * @param ?int $fk_default_workstation Default workstation + * @return int<-3,max> Return integer <0 if KO, Id of updated BOM-Line if OK + */ + public function updateLine($rowid, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $import_key = \null, $fk_unit = 0, $array_options = array(), $fk_default_workstation = \null) + { + } + /** + * Delete a line of object in database + * + * @param User $user User that delete + * @param int $idline Id of line to delete + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int<-2,-1>|int<1,1> >0 if OK, <0 if KO + */ + public function deleteLine(\User $user, $idline, $notrigger = 0) + { + } + /** + * Returns the reference to the following non used BOM depending on the active numbering module + * defined into BOM_ADDON + * + * @param Product $prod Object product + * @return string BOM free reference + */ + public function getNextNumRef($prod) + { + } + /** + * Validate bom + * + * @param User $user User making status change + * @param int<0,1> $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int<-1,1> Return integer <=0 if OK, 0=Nothing done, >0 if KO + */ + public function validate($user, $notrigger = 0) + { + } + /** + * Set draft status + * + * @param User $user Object user that modify + * @param int<0,1> $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int<-1,1> Return integer <0 if KO, 0=Nothing done, >0 if OK + */ + public function setDraft($user, $notrigger = 0) + { + } + /** + * Set cancel status + * + * @param User $user Object user that modify + * @param int<0,1> $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int<-1,1> Return integer <0 if KO, 0=Nothing done, >0 if OK + */ + public function cancel($user, $notrigger = 0) + { + } + /** + * Reopen if canceled + * + * @param User $user Object user that modify + * @param int<0,1> $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int<-1,1> Return integer <0 if KO, 0=Nothing done, >0 if OK + */ + public function reopen($user, $notrigger = 0) + { + } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array{picto:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} + */ + public function getTooltipContentArray($params) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int<0,2> $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int<0,1> $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int<-1,1> $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Return label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the status + * + * @param int $status Id status + * @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Load the info information in the object + * + * @param int $id Id of object + * @return void + */ + public function info($id) + { + } + /** + * Create an array of lines + * + * @return BOMLine[]|int array of lines if OK, <0 if KO + */ + public function getLinesArray() + { + } + /** + * Create a document onto disk according to template module. + * + * @param string $modele Force template to use ('' to not force) + * @param Translate $outputlangs object lang a utiliser pour traduction + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param null|array $moreparams Array to provide more information + * @return int<0,1> 0 if KO, 1 if OK + */ + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = \null) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return if at least one photo is available + * + * @param string $sdir Directory to scan + * @return boolean True if at least one photo is available, False if not + */ + public function is_photo_available($sdir) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int<1,1> + */ + public function initAsSpecimen() + { + } + /** + * Action executed by scheduler + * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' + * + * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) + */ + public function doScheduledJob() + { + } + /** + * BOM costs calculation based on cost_price or pmp of each BOM line. + * Set the property ->total_cost and ->unit_cost of BOM. + * + * @return int|string Return integer <0 if KO, >0 if OK, or printable error result from hook + */ + public function calculateCosts() + { + } + /** + * Function used to replace a product id with another one. + * + * @param DoliDB $db Database handler + * @param int $origin_id Old product id + * @param int $dest_id New product id + * @return bool + */ + public static function replaceProduct(\DoliDB $db, $origin_id, $dest_id) + { + } + /** + * Get Net needs by product + * + * @param array $TNetNeeds Array of ChildBom and infos linked to + * @param float $qty qty needed (used as a factor to produce 1 unit) + * @return void + */ + public function getNetNeeds(&$TNetNeeds = array(), $qty = 0) + { + } + /** + * Get/add Net needs Tree by product or bom + * + * @param array $TNetNeeds Array of ChildBom and infos linked to + * @param float $qty qty needed (used as a factor to produce 1 unit) + * @param int<0,1000> $level level of recursivity + * @return void + */ + public function getNetNeedsTree(&$TNetNeeds = array(), $qty = 0, $level = 0) + { + } + /** + * Recursively retrieves all parent bom in the tree that leads to the $bom_id bom + * + * @param BOM[] $TParentBom We put all found parent bom in $TParentBom + * @param int $bom_id ID of bom from which we want to get parent bom ids + * @param int<0,1000> $level Protection against infinite loop + * @return void + */ + public function getParentBomTreeRecursive(&$TParentBom, $bom_id = 0, $level = 1) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{prod:?Product,selected:int<-1,1>} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /** + * Class for BOMLine + */ + class BOMLine extends \CommonObjectLine + { + /** + * @var string ID to identify managed object + */ + public $element = 'bomline'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'bom_bomline'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'bom'; + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_bom'; + /** + * @var string String with name of icon for bomline. Must be the part after the 'object_' into object_bomline.png + */ + public $picto = 'bomline'; + /** + * 'type' if the field format. + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'default' is a default value for creation (can still be replaced by the global setup of default values) + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'position' is the sort order of field. + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'LineID', 'enabled' => 1, 'visible' => -1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id"), 'fk_bom' => array('type' => 'integer:BillOfMaterials:societe/class/bom.class.php', 'label' => 'BillOfMaterials', 'enabled' => 1, 'visible' => 1, 'position' => 10, 'notnull' => 1, 'index' => 1), 'fk_product' => array('type' => 'integer:Product:product/class/product.class.php', 'label' => 'Product', 'enabled' => 1, 'visible' => 1, 'position' => 20, 'notnull' => 1, 'index' => 1), 'fk_bom_child' => array('type' => 'integer:BOM:bom/class/bom.class.php', 'label' => 'BillOfMaterials', 'enabled' => 1, 'visible' => -1, 'position' => 40, 'notnull' => -1), 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => -1, 'position' => 60, 'notnull' => -1), 'qty' => array('type' => 'double(24,8)', 'label' => 'Quantity', 'enabled' => 1, 'visible' => 1, 'position' => 100, 'notnull' => 1, 'isameasure' => 1), 'qty_frozen' => array('type' => 'smallint', 'label' => 'QuantityFrozen', 'enabled' => 1, 'visible' => 1, 'default' => '0', 'position' => 105, 'css' => 'maxwidth50imp', 'help' => 'QuantityConsumedInvariable'), 'disable_stock_change' => array('type' => 'smallint', 'label' => 'DisableStockChange', 'enabled' => 1, 'visible' => 1, 'default' => '0', 'position' => 108, 'css' => 'maxwidth50imp', 'help' => 'DisableStockChangeHelp'), 'efficiency' => array('type' => 'double(24,8)', 'label' => 'ManufacturingEfficiency', 'enabled' => 1, 'visible' => 0, 'default' => '1', 'position' => 110, 'notnull' => 1, 'css' => 'maxwidth50imp', 'help' => 'ValueOfEfficiencyConsumedMeans'), 'fk_unit' => array('type' => 'integer', 'label' => 'Unit', 'enabled' => 1, 'visible' => 1, 'position' => 120, 'notnull' => -1), 'position' => array('type' => 'integer', 'label' => 'Rank', 'enabled' => 1, 'visible' => 0, 'default' => '0', 'position' => 200, 'notnull' => 1), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 1000, 'notnull' => -1), 'fk_default_workstation' => array('type' => 'integer', 'label' => 'DefaultWorkstation', 'enabled' => 1, 'visible' => 1, 'notnull' => 0, 'position' => 1050)); + /** + * @var int rowid + */ + public $rowid; + /** + * @var int fk_bom + */ + public $fk_bom; + /** + * @var int Id of product + */ + public $fk_product; + /** + * @var ?int Id of parent bom + */ + public $fk_bom_child; + /** + * @var string description + */ + public $description; + /** + * @var double qty + */ + public $qty; + /** + * @var float qty frozen + */ + public $qty_frozen; + /** + * @var int disable stock change + */ + public $disable_stock_change; + /** + * @var double efficiency + */ + public $efficiency; + /** + * @var int|null ID of the unit of measurement (rowid in llx_c_units table) + * @see measuringUnitString() + * @see getLabelOfUnit() + */ + public $fk_unit; + /** + * @var ?int Service Workstation + */ + public $fk_default_workstation; + /** + * @var int position of line + */ + public $position; + /** + * @var string import key + */ + public $import_key; + // END MODULEBUILDER PROPERTIES + /** + * @var int|float Calculated cost for the BOM line + */ + public $total_cost = 0; + /** + * @var int|float Line unit cost based on product cost price or pmp + */ + public $unit_cost = 0; + /** + * @var BOM[] array of Bom in line + */ + public $childBom = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = \null) + { + } + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset Offset + * @param string $filter Filter as an Universal Search string. + * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')' + * @param string $filtermode No more used + * @return BOMLine[]|int<-1,-1> int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int<0,2> $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int<0,1> $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int<-1,1> $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Return label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the status + * + * @param int $status Id status + * @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Load the info information in the object + * + * @param int $id Id of object + * @return void + */ + public function info($id) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimen() + { + } + } + //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** + * Class for Availabilities + */ + class Availabilities extends \CommonObject + { + /** + * @var string ID of module. + */ + public $module = 'bookcal'; + /** + * @var string ID to identify managed object. + */ + public $element = 'availabilities'; + /** + * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. + */ + public $table_element = 'bookcal_availabilities'; + /** + * @var string String with name of icon for availabilities. Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'availabilities@bookcal' if picto is file 'img/object_availabilities.png'. + */ + public $picto = 'fa-calendar-check'; + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_CANCELED = 9; + /** + * 'type' field format: + * 'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', + * 'select' (list of values are in 'options'), + * 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]', + * 'chkbxlst:...', + * 'varchar(x)', + * 'text', 'text:none', 'html', + * 'double(24,8)', 'real', 'price', + * 'date', 'datetime', 'timestamp', 'duration', + * 'boolean', 'checkbox', 'radio', 'array', + * 'mail', 'phone', 'url', 'password', 'ip' + * Note: Filter must be a Dolibarr Universal Filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalInt('MY_SETUP_PARAM') or 'isModEnabled("multicurrency")' ...) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0') + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage) + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' + * 'help' and 'helplist' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'validate' is 1 if need to validate with $this->validateField() + * 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value) + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 2, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 20, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'csslist' => 'tdoverflowmax150', 'cssview' => 'wordbreak', 'help' => "BookcalLabelAvailabilityHelp", 'showoncombobox' => 2, 'validate' => 1), 'fk_bookcal_calendar' => array('type' => 'integer:Calendar:bookcal/class/calendar.class.php:1', 'label' => 'Calendar', 'enabled' => 1, 'position' => 25, 'notnull' => 1, 'visible' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax100'), 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 3, 'validate' => 1), 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 61, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => 1), 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 62, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => 1), 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2), 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'picto' => 'user', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'picto' => 'user', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => 0), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'position' => 1010, 'notnull' => -1, 'visible' => 0), 'start' => array('type' => 'date', 'label' => 'Start Date', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'searchall' => 1), 'end' => array('type' => 'date', 'label' => 'End Date', 'enabled' => 1, 'position' => 45, 'notnull' => 1, 'visible' => 1, 'searchall' => 1), 'duration' => array('type' => 'integer', 'label' => 'DurationOfRange', 'enabled' => 1, 'position' => 47, 'notnull' => 1, 'visible' => 1, 'default' => '30', 'css' => 'width50 right'), 'startHour' => array('type' => 'integer', 'label' => 'Start Hour', 'enabled' => 1, 'position' => 46, 'notnull' => 1, 'visible' => 1), 'endHour' => array('type' => 'integer', 'label' => 'End Hour', 'enabled' => 1, 'position' => 46.5, 'notnull' => 1, 'visible' => 1), 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '9' => 'Closed'), 'default' => '1', 'validate' => 1)); + /** + * @var int + */ + public $rowid; + /** + * @var string + */ + public $label; + /** + * @var string + */ + public $description; + /** + * @var string + */ + public $note_public; + /** + * @var string + */ + public $note_private; + /** + * @var int + */ + public $fk_user_creat; + /** + * @var int + */ + public $fk_user_modif; + /** + * @var string + */ + public $last_main_doc; + /** + * @var string + */ + public $import_key; + /** + * @var string + */ + public $model_pdf; + /** + * @var int + */ + public $status; + /** + * @var string + */ + public $start; + /** + * @var string + */ + public $end; + /** + * @var int + */ + public $duration; + /** + * @var int + */ + public $startHour; + /** + * @var int + */ + public $endHour; + /** + * @var int + */ + public $fk_bookcal_calendar; + // END MODULEBUILDER PROPERTIES + // If this object has a subtable with lines + // /** + // * @var string Name of subtable line + // */ + // public $table_element_line = 'bookcal_availabilitiesline'; + // /** + // * @var string Field with ID of parent key if this object has a parent + // */ + // public $fk_element = 'fk_availabilities'; + // /** + // * @var string Name of subtable class that manage subtable lines + // */ + // public $class_element_line = 'Availabilitiesline'; + // /** + // * @var array List of child tables. To test if we can delete object. + // */ + // protected $childtables = array(); + // /** + // * @var array List of child tables. To know object to delete on cascade. + // * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will + // * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object + // */ + // protected $childtablesoncascade = array('bookcal_availabilitiesdet'); + // /** + // * @var AvailabilitiesLine[] Array of subtable lines + // */ + // public $lines = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Clone an object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @return mixed New object created, <0 if KO + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = \null) + { + } + /** + * Load object lines in memory from the database + * + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + } + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset Offset + * @param string $filter Filter as an Universal Search string. + * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')' + * @param string $filtermode No more used + * @return array|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger false=launch triggers after, true=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Delete a line of object in database + * + * @param User $user User that delete + * @param int $idline Id of line to delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int >0 if OK, <0 if KO + */ + public function deleteLine(\User $user, $idline, $notrigger = 0) + { + } + /** + * Validate object + * + * @param User $user User making status change + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO + */ + public function validate($user, $notrigger = 0) + { + } + /** + * Set draft status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function setDraft($user, $notrigger = 0) + { + } + /** + * Set cancel status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK + */ + public function cancel($user, $notrigger = 0) + { + } + /** + * Set back to validated status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK + */ + public function reopen($user, $notrigger = 0) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Return a thumb for kanban views + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLabelStatus($mode = 0) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Load the info information in the object + * + * @param int $id Id of object + * @return void + */ + public function info($id) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Create an array of lines + * + * @return array|int array of lines if OK, <0 if KO + */ + public function getLinesArray() + { + } + /** + * Returns the reference to the following non used object depending on the active numbering module. + * + * @return string Object free reference + */ + public function getNextNumRef() + { + } + /** + * Create a document onto disk according to template module. + * + * @param string $modele Force template to use ('' to not force) + * @param Translate $outputlangs object lang a utiliser pour traduction + * @param int $hidedetails Hide details of lines + * @param int $hidedesc Hide description + * @param int $hideref Hide ref + * @param ?array $moreparams Array to provide more information + * @return int 0 if KO, 1 if OK + */ + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = \null) + { + } + /** + * Action executed by scheduler + * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' + * Use public function doScheduledJob($param1, $param2, ...) to get parameters + * + * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) + */ + public function doScheduledJob() + { + } + } + /** + * Class AvailabilitiesLine. You can also remove this and generate a CRUD class for lines objects. + */ + class AvailabilitiesLine extends \CommonObjectLine + { + // To complete with content of an object AvailabilitiesLine + // We should have a field rowid, fk_availabilities and position + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + } + //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** + * Class for Calendar + */ + class Calendar extends \CommonObject + { + /** + * @var string ID of module. + */ + public $module = 'bookcal'; + /** + * @var string ID to identify managed object. + */ + public $element = 'calendar'; + /** + * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. + */ + public $table_element = 'bookcal_calendar'; + /** + * @var string String with name of icon for calendar. Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'calendar@bookcal' if picto is file 'img/object_calendar.png'. + */ + public $picto = 'fa-calendar-check'; + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_CANCELED = 9; + /** + * 'type' field format: + * 'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', + * 'select' (list of values are in 'options'), + * 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]', + * 'chkbxlst:...', + * 'varchar(x)', + * 'text', 'text:none', 'html', + * 'double(24,8)', 'real', 'price', + * 'date', 'datetime', 'timestamp', 'duration', + * 'boolean', 'checkbox', 'radio', 'array', + * 'mail', 'phone', 'url', 'password', 'ip' + * Note: Filter must be a Dolibarr Universal Filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalInt('MY_SETUP_PARAM') or 'isModEnabled("multicurrency")' ...) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0') + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage) + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' + * 'help' and 'helplist' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'validate' is 1 if need to validate with $this->validateField() + * 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value) + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'right', 'comment' => "Id"), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 40, 'index' => 1), 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => "Reference of object", 'css' => 'width100'), 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 1, 'alwayseditable' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1), 'visibility' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Owner', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'picto' => 'user', 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), 'type' => array('type' => 'integer', 'label' => 'Type', 'enabled' => 1, 'position' => 42, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array('0' => 'Customer', '1' => 'Supplier', '3' => 'Other')), 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label' => 'ThirdParty', 'picto' => 'company', 'enabled' => 'isModEnabled("societe")', 'position' => 50, 'notnull' => -1, 'visible' => 1, 'index' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150', 'help' => "ThirdPartyBookCalHelp", 'validate' => 1), 'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1', 'label' => 'Project', 'picto' => 'project', 'enabled' => 'isModEnabled("project")', 'position' => 52, 'notnull' => -1, 'visible' => -1, 'index' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150', 'validate' => 1), 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 3, 'validate' => 1), 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 61, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => 1), 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 62, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => 1), 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2), 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'picto' => 'user', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid', 'csslist' => 'tdoverflowmax150'), 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'picto' => 'user', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2, 'csslist' => 'tdoverflowmax150'), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2), 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'default' => '0', 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '9' => 'Closed'), 'validate' => 1)); + /** + * @var int + */ + public $rowid; + /** + * @var int + */ + public $entity; + /** + * @var string + */ + public $ref; + /** + * @var string + */ + public $label; + /** + * @var int + */ + public $type; + /** + * @var int + */ + public $visibility; + /** + * @var int + */ + public $fk_soc; + /** + * @var int + */ + public $fk_project; + /** + * @var string + */ + public $description; + /** + * @var string + */ + public $note_public; + /** + * @var string + */ + public $note_private; + /** + * @var int + */ + public $fk_user_creat; + /** + * @var int + */ + public $fk_user_modif; + /** + * @var string + */ + public $import_key; + /** + * @var int + */ + public $status; + // END MODULEBUILDER PROPERTIES + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Clone an object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @return self|int<-1,-1> New object created, <0 if KO + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = \null) + { + } + /** + * Load object lines in memory from the database + * + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + } + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset Offset + * @param string $filter Filter as an Universal Search string. + * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')' + * @param string $filtermode No more used + * @return self[]|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Delete a line of object in database + * + * @param User $user User that delete + * @param int $idline Id of line to delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int >0 if OK, <0 if KO + */ + public function deleteLine(\User $user, $idline, $notrigger = 0) + { + } + /** + * Validate object + * + * @param User $user User making status change + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO + */ + public function validate($user, $notrigger = 0) + { + } + /** + * Set draft status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function setDraft($user, $notrigger = 0) + { + } + /** + * Set cancel status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK + */ + public function cancel($user, $notrigger = 0) + { + } + /** + * Set back to validated status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK + */ + public function reopen($user, $notrigger = 0) + { + } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array{picto:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} + */ + public function getTooltipContentArray($params) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Return a thumb for kanban views + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLabelStatus($mode = 0) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Load the info information in the object + * + * @param int $id Id of object + * @return void + */ + public function info($id) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Create an array of lines + * + * @return CalendarLine[]|int array of lines if OK, <0 if KO + */ + public function getLinesArray() + { + } + /** + * Returns the reference to the following non used object depending on the active numbering module. + * + * @return string Object free reference + */ + public function getNextNumRef() + { + } + /** + * Create a document onto disk according to template module. + * + * @param string $modele Force template to use ('' to not force) + * @param Translate $outputlangs object lang a utiliser pour traduction + * @param int $hidedetails Hide details of lines + * @param int $hidedesc Hide description + * @param int $hideref Hide ref + * @param ?array $moreparams Array to provide more information + * @return int 0 if KO, 1 if OK + */ + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = \null) + { + } + /** + * Action executed by scheduler + * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' + * Use public function doScheduledJob($param1, $param2, ...) to get parameters + * + * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) + */ + public function doScheduledJob() + { + } + } + /** + * Class CalendarLine. You can also remove this and generate a CRUD class for lines objects. + */ + class CalendarLine extends \CommonObjectLine + { + // To complete with content of an object CalendarLine + // We should have a field rowid, fk_calendar and position + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + } + /* Copyright (C) 2005 Laurent Destailleur + * Copyright (C) 2015 Marcos García + * Copyright (C) 2024 Frédéric France + * + * 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 . + */ + /** + * \file htdocs/bookmarks/class/bookmark.class.php + * \ingroup bookmark + * \brief File of class to manage bookmarks + */ + /** + * Class to manage bookmarks + */ + class Bookmark extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'bookmark'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'bookmark'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'bookmark'; + /** + * @var string Last error number. For example: 'DB_ERROR_RECORD_ALREADY_EXISTS', '12345', ... + */ + public $errno; + /** + * @var int ID + */ + public $id; + /** + * @var int User ID. If > 0, bookmark of one user. If == 0, bookmark public (for everybody) + */ + public $fk_user; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + /** + * @var string url + */ + public $url; + public $target; + // 0=replace, 1=new window + /** + * @var string title + */ + public $title; + /** + * @var int position of bookmark + */ + public $position; + /** + * @var string favicon + */ + public $favicon; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Directs the bookmark + * + * @param int $id Bookmark Id Loader + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id) + { + } + /** + * Insert bookmark into database + * + * @return int Return integer <0 si ko, rowid du bookmark cree si ok + */ + public function create() + { + } + /** + * Update bookmark record + * + * @return int Return integer <0 if KO, > if OK + */ + public function update() + { + } + /** + * Removes the bookmark + * + * @param User $user User deleting + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user) + { + } + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty(\DoliDB $dbs, $origin_id, $dest_id) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + } + /** + * API class for categories + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ + class Categories extends \DolibarrApi + { + /** + * @var array $FIELDS Mandatory fields, checked when create and update object + */ + public static $FIELDS = array('label', 'type'); + public static $TYPES = array(0 => 'product', 1 => 'supplier', 2 => 'customer', 3 => 'member', 4 => 'contact', 5 => 'account', 6 => 'project', 7 => 'user', 8 => 'bank_line', 9 => 'warehouse', 10 => 'actioncomm', 11 => 'website_page', 12 => 'ticket', 13 => 'knowledgemanagement'); + /** + * @var Categorie $category {@type Categorie} + */ + public $category; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get properties of a category object + * + * Return an array with category information + * + * @param int $id ID of category + * @param bool $include_childs Include child categories list (true or false) + * @return array|mixed data without useless information + * + * @throws RestException + */ + public function get($id, $include_childs = \false) + { + } + /** + * List categories + * + * Get a list of categories + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact', 'actioncomm') + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @return array Array of category objects + * + * @throws RestException + */ + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $sqlfilters = '', $properties = '') + { + } + /** + * Create category object + * + * @param array $request_data Request data + * @return int ID of category + */ + public function post($request_data = \null) + { + } + /** + * Update category + * + * @param int $id Id of category to update + * @param array $request_data Datas + * @return Object Updated object + */ + public function put($id, $request_data = \null) + { + } + /** + * Delete category + * + * @param int $id Category ID + * @return array + */ + public function delete($id) + { + } + /** + * List categories of an object + * + * Get the list of categories linked to an object + * + * @param int $id Object ID + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact', 'project', 'actioncomm') + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @return array Array of category objects + * + * @throws RestException + * + * @url GET /object/{type}/{id} + */ + public function getListForObject($id, $type, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) + { + } + /** + * Link an object to a category by id + * + * @param int $id ID of category + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact', 'actioncomm') + * @param int $object_id ID of object + * + * @return array + * @throws RestException + * + * @url POST {id}/objects/{type}/{object_id} + */ + public function linkObjectById($id, $type, $object_id) + { + } + /** + * Link an object to a category by ref + * + * @param int $id ID of category + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact') + * @param string $object_ref Reference of object + * + * @return array + * @throws RestException + * + * @url POST {id}/objects/{type}/ref/{object_ref} + */ + public function linkObjectByRef($id, $type, $object_ref) + { + } + /** + * Unlink an object from a category by id + * + * @param int $id ID of category + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact', 'actioncomm') + * @param int $object_id ID of the object + * + * @return array + * @throws RestException + * + * @url DELETE {id}/objects/{type}/{object_id} + */ + public function unlinkObjectById($id, $type, $object_id) + { + } + /** + * Unlink an object from a category by ref + * + * @param int $id ID of category + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact', 'actioncomm') + * @param string $object_ref Reference of the object + * + * @return array + * @throws RestException + * + * @url DELETE {id}/objects/{type}/ref/{object_ref} + */ + public function unlinkObjectByRef($id, $type, $object_ref) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensible object datas + * + * @param Categorie $object Object to clean + * @return Object Object with cleaned properties + */ + protected function _cleanObjectDatas($object) + { + } + /** + * Get the list of objects in a category. + * + * @param int $id ID of category + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact', 'project') + * @param int $onlyids Return only ids of objects (consume less memory) + * + * @return mixed + * + * @url GET {id}/objects + */ + public function getObjects($id, $type, $onlyids = 0) + { + } + } + /** + * Class to manage categories + */ + class Categorie extends \CommonObject + { + // Categories types (we use string because we want to accept any modules/types in a future) + const TYPE_PRODUCT = 'product'; + const TYPE_SUPPLIER = 'supplier'; + const TYPE_CUSTOMER = 'customer'; + const TYPE_MEMBER = 'member'; + const TYPE_CONTACT = 'contact'; + const TYPE_USER = 'user'; + const TYPE_PROJECT = 'project'; + const TYPE_ACCOUNT = 'bank_account'; + const TYPE_BANK_LINE = 'bank_line'; + const TYPE_WAREHOUSE = 'warehouse'; + const TYPE_ACTIONCOMM = 'actioncomm'; + const TYPE_WEBSITE_PAGE = 'website_page'; + const TYPE_TICKET = 'ticket'; + const TYPE_KNOWLEDGEMANAGEMENT = 'knowledgemanagement'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'category'; + /** + * @var array Table of mapping between type string and ID used for field 'type' in table llx_categories + */ + protected $MAP_ID = array('product' => 0, 'supplier' => 1, 'customer' => 2, 'member' => 3, 'contact' => 4, 'bank_account' => 5, 'project' => 6, 'user' => 7, 'bank_line' => 8, 'warehouse' => 9, 'actioncomm' => 10, 'website_page' => 11, 'ticket' => 12, 'knowledgemanagement' => 13); + /** + * @var array Code mapping from ID + * + * @note This array should be removed in future, once previous constants are moved to the string value. Deprecated + */ + public static $MAP_ID_TO_CODE = array(0 => 'product', 1 => 'supplier', 2 => 'customer', 3 => 'member', 4 => 'contact', 5 => 'bank_account', 6 => 'project', 7 => 'user', 8 => 'bank_line', 9 => 'warehouse', 10 => 'actioncomm', 11 => 'website_page', 12 => 'ticket', 13 => 'knowledgemanagement'); + /** + * @var array Foreign keys mapping from type string when value does not match + * + * @todo Move to const array when PHP 5.6 will be our minimum target + */ + public $MAP_CAT_FK = array('customer' => 'soc', 'supplier' => 'soc', 'contact' => 'socpeople', 'bank_account' => 'account'); + /** + * @var array Category tables mapping from type string (llx_categorie_...) when value does not match + * + * @note Move to const array when PHP 5.6 will be our minimum target + */ + public $MAP_CAT_TABLE = array('customer' => 'societe', 'supplier' => 'fournisseur', 'bank_account' => 'account'); + /** + * @var array Object class mapping from type string + * + * @note Move to const array when PHP 5.6 will be our minimum target + */ + public $MAP_OBJ_CLASS = array( + 'product' => 'Product', + 'customer' => 'Societe', + 'supplier' => 'Fournisseur', + 'member' => 'Adherent', + 'contact' => 'Contact', + 'user' => 'User', + 'account' => 'Account', + // old for bank account + 'bank_account' => 'Account', + 'project' => 'Project', + 'warehouse' => 'Entrepot', + 'actioncomm' => 'ActionComm', + 'website_page' => 'WebsitePage', + 'ticket' => 'Ticket', + 'knowledgemanagement' => 'KnowledgeRecord', + ); + /** + * @var array Title Area mapping from type string + * + * @note Move to const array when PHP 5.6 will be our minimum target + */ + public static $MAP_TYPE_TITLE_AREA = array( + 'product' => 'ProductsCategoriesArea', + 'customer' => 'CustomersCategoriesArea', + 'supplier' => 'SuppliersCategoriesArea', + 'member' => 'MembersCategoriesArea', + 'contact' => 'ContactsCategoriesArea', + 'user' => 'UsersCategoriesArea', + 'account' => 'AccountsCategoriesArea', + // old for bank account + 'bank_account' => 'AccountsCategoriesArea', + 'project' => 'ProjectsCategoriesArea', + 'warehouse' => 'StocksCategoriesArea', + 'actioncomm' => 'ActioncommCategoriesArea', + 'website_page' => 'WebsitePageCategoriesArea', + 'ticket' => 'TicketCategoriesArea', + 'knowledgemanagement' => 'KnowledgemanagementCategoriesArea', + ); + /** + * @var array Object table mapping from type string (table llx_...) when value of key does not match table name. + * This array may be completed by external modules with hook "constructCategory" + */ + public $MAP_OBJ_TABLE = array( + 'customer' => 'societe', + 'supplier' => 'societe', + 'member' => 'adherent', + 'contact' => 'socpeople', + 'account' => 'bank_account', + // old for bank account + 'project' => 'projet', + 'warehouse' => 'entrepot', + 'knowledgemanagement' => 'knowledgemanagement_knowledgerecord', + ); + /** + * @var string ID to identify managed object + */ + public $element = 'category'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'categorie'; + /** + * @var int ID + */ + public $fk_parent; + /** + * @var string Category label + */ + public $label; + /** + * @var string description + */ + public $description; + /** + * @var string Color + */ + public $color; + /** + * @var int Position + */ + public $position; + /** + * @var int Visible + */ + public $visible; + /** + * @var int Id of thirdparty when CATEGORY_ASSIGNED_TO_A_CUSTOMER is set + */ + public $socid; + /** + * @var string Category type + * + * @see Categorie::TYPE_PRODUCT + * @see Categorie::TYPE_SUPPLIER + * @see Categorie::TYPE_CUSTOMER + * @see Categorie::TYPE_MEMBER + * @see Categorie::TYPE_CONTACT + * @see Categorie::TYPE_USER + * @see Categorie::TYPE_PROJECT + * @see Categorie::TYPE_ACCOUNT + * @see Categorie::TYPE_BANK_LINE + * @see Categorie::TYPE_WAREHOUSE + * @see Categorie::TYPE_ACTIONCOMM + * @see Categorie::TYPE_WEBSITE_PAGE + * @see Categorie::TYPE_TICKET + */ + public $type; + /** + * @var array Categories table in memory + */ + public $cats = array(); + /** + * @var array Mother of table + */ + public $motherof = array(); + /** + * @var array children + */ + public $childs = array(); + /** + * @var ?array{string,array{label:string,description:string,note?:string}} multilangs + */ + public $multilangs; + /** + * @var int imgWidth + */ + public $imgWidth; + /** + * @var int imgHeight + */ + public $imgHeight; + public $fields = array("rowid" => array("type" => "integer", "label" => "TechnicalID", "enabled" => "1", 'position' => 10, 'notnull' => 1, "visible" => "-1"), "fk_parent" => array("type" => "integer", "label" => "Fkparent", "enabled" => "1", 'position' => 20, 'notnull' => 1, "visible" => "-1", "css" => "maxwidth500 widthcentpercentminusxx"), "label" => array("type" => "varchar(180)", "label" => "Label", "enabled" => "1", 'position' => 25, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1", "css" => "minwidth300", "cssview" => "wordbreak", "csslist" => "tdoverflowmax150"), "ref_ext" => array("type" => "varchar(255)", "label" => "Refext", "enabled" => "1", 'position' => 30, 'notnull' => 0, "visible" => "0", "alwayseditable" => "1"), "type" => array("type" => "integer", "label" => "Type", "enabled" => "1", 'position' => 35, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1"), "description" => array("type" => "text", "label" => "Description", "enabled" => "1", 'position' => 40, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1"), "color" => array("type" => "varchar(8)", "label" => "Color", "enabled" => "1", 'position' => 45, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1"), "position" => array("type" => "integer", "label" => "Position", "enabled" => "1", 'position' => 50, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1"), "fk_soc" => array("type" => "integer:Societe:societe/class/societe.class.php", "label" => "ThirdParty", "picto" => "company", "enabled" => "1", 'position' => 55, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1", "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150"), "visible" => array("type" => "integer", "label" => "Visible", "enabled" => "1", 'position' => 60, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1"), "import_key" => array("type" => "varchar(14)", "label" => "ImportId", "enabled" => "1", 'position' => 900, 'notnull' => 0, "visible" => "-2", "alwayseditable" => "1"), "date_creation" => array("type" => "datetime", "label" => "Datecreation", "enabled" => "1", 'position' => 70, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1"), "tms" => array("type" => "timestamp", "label" => "DateModification", "enabled" => "1", 'position' => 75, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1"), "fk_user_creat" => array("type" => "integer:User:user/class/user.class.php", "label" => "UserAuthor", "enabled" => "1", 'position' => 80, 'notnull' => 0, "visible" => "-2", "alwayseditable" => "1", "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150"), "fk_user_modif" => array("type" => "integer:User:user/class/user.class.php", "label" => "UserModif", "enabled" => "1", 'position' => 85, 'notnull' => -1, "visible" => "-2", "alwayseditable" => "1", "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150")); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Get map list + * + * @return array + */ + public function getMapList() + { + } + /** + * Load category into memory from database + * + * @param int $id Id of category + * @param string $label Label of category + * @param string $type Type of category ('product', '...') or (0, 1, ...) + * @param string $ref_ext External reference of object + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $label = '', $type = \null, $ref_ext = '') + { + } + /** + * Add category into database + * + * @param User $user Object user + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int -1 : SQL error + * -2 : new ID unknown + * -3 : Invalid category + * -4 : category already exists + */ + public function create($user, $notrigger = 0) + { + } + /** + * Update category + * + * @param User $user Object user + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int 1 : OK + * -1 : SQL error + * -2 : invalid category + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete a category from database + * + * @param User $user Object user that ask to delete + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 KO >0 OK + */ + public function delete($user, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Link an object to the category + * + * @param CommonObject $obj Object to link to category + * @param string $type Type of category ('product', ...). Use '' to take $obj->element. + * @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked + * @see del_type() + */ + public function add_type($obj, $type = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Delete object from category + * + * @param CommonObject $obj Object + * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') + * @return int 1 if OK, -1 if KO + * @see add_type() + */ + public function del_type($obj, $type) + { + } + /** + * Return list of fetched instance of elements having this category + * + * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member', 'knowledge_management', ...) + * @param int $onlyids Return only ids of objects (consume less memory) + * @param int $limit Limit + * @param int $offset Offset + * @param string $sortfield Sort fields + * @param string $sortorder Sort order ('ASC' or 'DESC'); + * @param string $filter Filter as an Universal Search string. + * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')' + * @param string $filtermode No more used + * @return CommonObject[]|int[]|int Return -1 if KO, array of instance of object if OK + * @see containsObject() + */ + public function getObjectsInCateg($type, $onlyids = 0, $limit = 0, $offset = 0, $sortfield = '', $sortorder = 'ASC', $filter = '', $filtermode = 'AND') + { + } + /** + * Check for the presence of an object in a category + * + * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') + * @param int $object_id Id of the object to search + * @return int Number of occurrences + * @see getObjectsInCateg() + */ + public function containsObject($type, $object_id) + { + } + /** + * List categories of an element id + * + * @param int $id Id of element + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact') + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @return int<-1,0>|array,visible:int,ref_ext:string,multilangs?:array{string,array{label:string,description:string,note?:string}}}> Array of categories, 0 if no cat, -1 on error + */ + public function getListForItem($id, $type = 'customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return direct children ids of a category into an array + * + * @return array|int Return integer <0 KO, array ok + */ + public function get_filles() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load the array this->motherof that is array(id_son=>id_parent, ...) + * + * @return int Return integer <0 if KO, >0 if OK + */ + protected function load_motherof() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Rebuilding the category tree as an array + * Return an array of table('id','id_mere',...) sorted to have a human readable tree, with + * id = id of category + * id_mere = id of parent category + * id_children = array of child ids + * label = name of category + * fulllabel = Name with full path for the category + * fullpath = Full path built with the id's + * + * @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member', ...) + * @param int|string|array $fromid Keep only or Exclude (depending on $include parameter) all categories (including the leaf $fromid) into the tree after this id $fromid. + * $fromid can be an : + * - int (id of category) + * - string (categories ids separated by comma) + * - array (list of categories ids) + * @param int $include [=0] Removed or 1=Keep only + * @return int<-1,-1>|array Array of categories. this->cats and this->motherof are set, -1 on error + */ + public function get_full_arbo($type, $fromid = 0, $include = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns all categories + * + * @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 + */ + public function get_all_categories($type = \null, $parent = \false) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns the top level categories (which are not child) + * + * @param int $type Type of category (0, 1, ...) + * @return array + */ + public function get_main_categories($type = \null) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Check if a category with same label already exists for this cat's parent or root and for this cat's type + * + * @return integer 1 if record already exist, 0 otherwise, -1 if error + */ + public function already_exists() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns the path of the category, with the names of the categories + * separated by $sep (" >> " by default) + * + * @param string $sep Separator + * @param string $url Url ('', 'none' or 'urltouse') + * @param int $nocolor 0 + * @param int $addpicto Add picto into link + * @return array + */ + public function print_all_ways($sep = '>>', $url = '', $nocolor = 0, $addpicto = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns an array containing the list of parent categories + * + * @return int|Categorie[] Return integer <0 KO, array OK + */ + public function get_meres() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns in a table all possible paths to get to the category + * starting with the major categories represented by Tables of categories + * + * @return Categorie[][] + */ + public function get_all_ways() + { + } + /** + * Return list of categories (object instances or labels) linked to element of id $id and type $type + * Should be named getListOfCategForObject + * + * @param int $id Id of element + * @param string|int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...) + * @param string $mode 'id'=Get array of category ids, 'object'=Get array of fetched category instances, 'label'=Get array of category + * labels, 'id'= Get array of category IDs + * @return Categorie[]|int[]|string[]|int Array of category objects, labels or IDs or < 0 if KO + */ + public function containing($id, $type, $mode = 'object') + { + } + /** + * Returns categories whose id or name match + * add wildcards in the name unless $exact = true + * + * @param int $id Id + * @param string $nom Name + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact'). Old mode (0, 1, 2, ...) is deprecated. + * @param boolean $exact Exact string search (true/false) + * @param boolean $case Case sensitive (true/false) + * @return Categorie[]|int Array of Categorie, -1 if error + */ + public function rechercher($id, $nom, $type, $exact = \false, $case = \false) + { + } + /** + * Return if at least one photo is available + * + * @param string $sdir Directory to scan + * @return boolean True if at least one photo is available, False if not + */ + public function isAnyPhotoAvailable($sdir) + { + } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + } + /** + * Return name and link of category (with picto) + * Use ->id, ->ref, ->label, ->color + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param string $option On what the link point to ('nolink', ...) + * @param int $maxlength Max length of text + * @param string $moreparam More param on URL link + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $moreparam = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Add the image uploaded as $file to the directory $sdir/-/photos/ + * + * @param string $sdir Root destination directory + * @param array $file Uploaded file name + * @return void + */ + public function add_photo($sdir, $file) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * 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 + */ + public function liste_photos($dir, $nbmax = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Efface la photo de la categorie et sa vignette + * + * @param string $file Path to file + * @return void + */ + public function delete_photo($file) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load size of image file + * + * @param string $file Path to file + * @return void + */ + public function get_image_size($file) + { + } + /** + * Update ou cree les traductions des infos produits + * + * @param User $user Object user + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function setMultiLangs(\User $user, $notrigger = 0) + { + } + /** + * Load array this->multilangs + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function getMultiLangs() + { + } + /** + * Return label of contact status + * + * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of contact status + */ + public function getLibStatut($mode) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty(\DoliDB $dbs, $origin_id, $dest_id) + { + } + /** + * Return the additional SQL JOIN query for filtering a list by a category + * + * @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") + * @return string A additional SQL JOIN query + * @deprecated search on some categories must be done using a WHERE EXISTS or NOT EXISTS and not a LEFT JOIN. @TODO Replace with getWhereQuery($type, $searchCategoryList) + */ + public static function getFilterJoinQuery($type, $rowIdName) + { + } + /** + * Return the additional SQL SELECT query for filtering a list by a category + * + * @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 + * @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 + */ + public static function getFilterSelectQuery($type, $rowIdName, $searchList) + { + } + /** + * Count all categories + * + * @return int Number of categories, -1 on error + */ + public function countNbOfCategories() + { + } + } + /** + * Class to manage agenda events (actions) + */ + class ActionComm extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'action'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'actioncomm'; + /** + * @var string Name of id column + */ + public $table_rowid = 'id'; + /** + * @var string Name of icon for actioncomm object. Filename of icon is object_action.png + */ + public $picto = 'action'; + /** + * @var int<0,2> 0=Default + * 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user + * 2=Same than 1 but accept record if fksoc is empty + */ + public $restrictiononfksoc = 2; + /** + * @var int Id of the event + */ + public $id; + /** + * @var string Id of the event. Use $id as possible + */ + public $ref; + /** + * @var int Id into parent table llx_c_actioncomm (used only if option to use type is set) + * This field is stored info fk_action. It contains the id into table llx_ac_actioncomm. + */ + public $type_id; + /** + * @var string Calendar of event (Type of type of event). 'system'=Default calendar, 'systemauto'=Auto calendar, 'birthdate', 'holiday', 'module'=Calendar specific to a module + * This field contains the type into table llx_ac_actioncomm ('system', 'systemauto', ...). It should be named 'type_type'. + */ + public $type; + /** + * @var string Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH. + * This field contains the code into table llx_ac_actioncomm. + */ + public $type_code; + /** + * @var string Type label + */ + public $type_label; + /** + * @var string Color into parent table llx_c_actioncomm (used only if option to use type is set) + */ + public $type_color; + /** + * @var string Picto for type of event (used only if option to use type is set) + */ + public $type_picto; + /** + * @var string Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...) + * This field is stored into field 'code' into llx_actioncomm. + */ + public $code; + /** + * @var string Agenda event label + */ + public $label; + /** + * @var int Date creation record (datec) + */ + public $datec; + /** + * @var int Duration (duree) + */ + public $duree; + /** + * @var int Date modification record (tms) + */ + public $datem; + /** + * @var User Object user that create action + * @deprecated + * @see $authorid + */ + public $author; + /** + * @var User Object user that modified action + * @deprecated + * @see $usermodid + */ + public $usermod; + /** + * @var int Id user that create action + */ + public $authorid; + /** + * @var int Id user that modified action + */ + public $usermodid; + /** + * @var int Date action start (datep) + */ + public $datep; + /** + * @var int Date action end (datef) + */ + public $datef; + /** + * @var int This is date start action (datep) but modified to not be outside calendar view. + */ + public $date_start_in_calendar; + /** + * @var int This is date end action (datef) but modified to not be outside calendar view. + */ + public $date_end_in_calendar; + /** + * @var int Date action end (datep2) + */ + public $datep2; + /** + * @var int -1=Unknown duration + * @deprecated Use ($datef - $datep) + */ + public $durationp = -1; + /** + * @var int 1=Event on full day + */ + public $fulldayevent = 0; + /** + * @var int 1=??? + */ + public $ponctuel; + /** + * @var int<-1,100> Percentage + */ + public $percentage; + /** + * @var string Location + */ + public $location; + /** + * @var int Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events) + */ + public $transparency; + /** + * @var int (0 By default) + */ + public $priority; + /** + * @var array}> Array of users + */ + public $userassigned = array(); + /** + * @var int Id of user owner = fk_user_action into table + */ + public $userownerid; + /** + * @var array,answer_status:int,transparency:int<0,1>}> Array of contact ids + */ + public $socpeopleassigned = array(); + /** + * @var int[] Array of other contact emails (not user, not contact) + */ + public $otherassigned = array(); + /** + * @var array Array of reminders + */ + public $reminders = array(); + /** + * @var int thirdparty id linked to action + */ + public $socid; + /** + * @var int socpeople id linked to action + */ + public $contact_id; + /** + * @var ?Societe Company linked to action (optional) + * @deprecated + * @see $socid + */ + public $societe; + /** + * @var ?Contact Contact linked to action (optional) + * @deprecated + * @see $contact_id + */ + public $contact; + // Properties for links to other objects + /** + * @var int Id of linked object + */ + public $fk_element; + // Id of record + /** + * @var int Id of linked object, alternative for API or other + */ + public $elementid; + /** + * @var string Type of record. This if property ->element of object linked to. + */ + public $elementtype; + /** + * @var int id of calendar + */ + public $fk_bookcal_calendar; + /** + * @var string Ical name + */ + public $icalname; + /** + * @var string Ical color (Hex value for color on 6 nibles) + */ + public $icalcolor; + /** + * @var string Extraparam + */ + public $extraparams; + /** + * @var array Actions + */ + public $actions = array(); + /** + * @var string Email msgid + */ + public $email_msgid; + /** + * @var string Email from + */ + public $email_from; + /** + * @var string Email sender + */ + public $email_sender; + /** + * @var string Email to + */ + public $email_to; + /** + * @var string Email tocc + */ + public $email_tocc; + /** + * @var string Email tobcc + */ + public $email_tobcc; + /** + * @var string Email subject + */ + public $email_subject; + /** + * @var string Email errors to + */ + public $errors_to; + /** + * @var int number of vote for an event + */ + public $num_vote; + /** + * @var int if event is paid + */ + public $event_paid; + /** + * @var int status use but Event organisation module + */ + public $status; + /** + * @var string IP address + */ + public $ip; + /* + * Properties to manage the recurring events + */ + /** @var string A string YYYYMMDDHHMMSS shared by allevent of same series */ + public $recurid; + /** @var string Rule of recurring */ + public $recurrule; + /** @var string Repeat until this date */ + public $recurdateend; + /** @var int Duration of phone call when the event is a phone call */ + public $calling_duration; + /** + * Typical value for a event that is in a todo state + */ + const EVENT_TODO = 0; + /** + * Typical value for a event that is in a progress state + */ + const EVENT_IN_PROGRESS = 50; + /** + * Typical value for a event that is in a finished state + */ + const EVENT_FINISHED = 100; + public $fields = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Add an action/event into database. + * $this->type_id OR $this->type_code must be set. + * + * @param User $user Object user making action + * @param int<0,1> $notrigger 1 = disable triggers, 0 = enable triggers + * @return int Id of created event, < 0 if KO + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $fuser Object user making action + * @param int $socid Id of thirdparty + * @return int New id of clone + */ + public function createFromClone(\User $fuser, $socid) + { + } + /** + * Load object from database + * + * @param int $id Id of action to get + * @param string $ref Ref of action to get + * @param string $ref_ext Ref ext to get + * @param string $email_msgid Email msgid + * @param int<0,1> $loadresources 1=Load also resources + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '', $loadresources = 1) + { + } + /** + * Initialize $this->userassigned & this->socpeopleassigned array with list of id of user and contact assigned to event + * + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function fetchResources() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Initialize this->userassigned array with list of id of user assigned to event + * + * @param bool $override Override $this->userownerid when empty. TODO This should be false by default. True is here to fix corrupted data. + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function fetch_userassigned($override = \true) + { + } + /** + * Delete event from database + * + * @param User $user User making the delete + * @param int<0,1> $notrigger 1 = disable triggers, 0 = enable triggers + * @return int<-2,1> Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Update action into database + * If percentage = 100, on met a jour date 100% + * + * @param User $user Object user making change + * @param int<0,1> $notrigger 1 = disable triggers, 0 = enable triggers + * @return int<-2,1> Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Load all objects with filters. + * @TODO WARNING: This make a fetch on all records instead of making one request with a join, like done into show_actions_done. + * + * @param int $socid Filter by thirdparty + * @param int $fk_element Id of element action is linked to + * @param string $elementtype Type of element action is linked to + * @param string $filter Other filter + * @param string $sortfield Sort on this field + * @param string $sortorder ASC or DESC + * @param int $limit Limit number of answers + * @return ActionComm[]|string Error string if KO, array with actions if OK + */ + public function getActions($socid = 0, $fk_element = 0, $elementtype = '', $filter = '', $sortfield = 'a.datep', $sortorder = 'DESC', $limit = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @param int $load_state_board Load indicator array this->nb + * @return WorkboardResponse|int<-1,1> Return integer <0 if KO, WorkboardResponse if OK + */ + public function load_board($user, $load_state_board = 0) + { + } + /** + * Charge les information d'ordre info dans l'objet facture + * + * @param int $id Id de la facture a charger + * @return void + */ + public function info($id) + { + } + /** + * Return the label of the status + * + * @param int<0,7> $mode 0=Long label, 1=Short label, 2=Picto+Short label, 3=Picto, 4=Picto+Short label, 5=Short label+Picto, 6=Picto+Long label, 7=Very short label+Picto + * @param int<0,1> $hidenastatus 1=Show nothing if status is "Not applicable" + * @return string String with status + */ + public function getLibStatut($mode, $hidenastatus = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return label of action status + * + * @param int<0,100> $percent Percent + * @param int<0,7> $mode 0=Long label, 1=Short label, 2=Picto+Short label, 3=Picto, 4=Picto+Short label, 5=Short label+Picto, 6=Picto+Long label, 7=Very short label+Picto + * @param int<0,1> $hidenastatus 1=Show nothing if status is "Not applicable" + * @param int|string $datestart Date start of event + * @return string Label + */ + public function LibStatut($percent, $mode, $hidenastatus = 0, $datestart = '') + { + } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array{picto:string,ref?:string,title?:string,labeltype?:string,location?:string,transparency?:string,space?:string,mailtopic?:string,mailfrom?:string,mailto?:string,mailcc?:string,description?:string,note?:string,categories?:string} + */ + public function getTooltipContentArray($params) + { + } + /** + * Return URL of event + * Use $this->id, $this->type_code, $this->label and $this->type_label + * + * @param int<0,2> $withpicto 0 = No picto, 1 = Include picto into link, 2 = Only picto + * @param int $maxlength Max number of characters into label. If negative, use the ref as label. + * @param string $classname Force style class on a link + * @param string $option '' = Link to action, 'birthday'= Link to contact, 'holiday' = Link to leave + * @param int<0,1> $overwritepicto 1 = Overwrite picto with this one + * @param int<0,1> $notooltip 1 = Disable tooltip + * @param int<-1,1> $save_lastsearch_value -1 = Auto, 0 = No save of lastsearch_values when clicking, 1 = Save lastsearch_values whenclicking + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0, $maxlength = 0, $classname = '', $option = '', $overwritepicto = 0, $notooltip = 0, $save_lastsearch_value = -1) + { + } + /** + * Return Picto of type of event + * + * @param string $morecss More CSS + * @param string $titlealt Title alt + * @return string HTML String + */ + public function getTypePicto($morecss = 'pictofixedwidth paddingright valignmiddle', $titlealt = '') + { + } + /** + * Return label of type of event + * + * @param int $mode 0=Mode short, 1=Mode long + * @return string HTML String + */ + public function getTypeLabel($mode = 0) + { + } + /** + * Sets object to supplied categories. + * + * Deletes object from existing categories not supplied. + * Adds it to non existing supplied categories. + * Existing categories are left untouch. + * + * @param int[]|int $categories Category or categories IDs + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function setCategories($categories) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Export events from database into a cal file. + * + * @param string $format The format of the export 'vcal', 'ical/ics' or 'rss' + * @param string $type The type of the export 'event' or 'journal' + * @param integer $cachedelay Do not rebuild file if date older than cachedelay seconds + * @param string $filename The name for the exported file. + * @param array $filters Array of filters. Example array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'actiontype'=>'systemauto', 'actioncode'=>'AC_PRODUCT_MODIFY', 'project'=>123, ...) + * @param int<0,1> $exportholiday 0 = don't integrate holidays into the export, 1 = integrate holidays into the export + * @return int<-1,1> -1 = error on build export file, 0 = export okay + */ + public function build_exportfile($format, $type, $cachedelay, $filename, $filters, $exportholiday = 0) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int<1,1> >0 if ok + */ + public function initAsSpecimen() + { + } + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty(\DoliDB $dbs, $origin_id, $dest_id) + { + } + /** + * Function used to replace a product id with another one. + * + * @param DoliDB $dbs Database handler + * @param int $origin_id Old product id + * @param int $dest_id New product id + * @return bool + */ + public static function replaceProduct(\DoliDB $dbs, $origin_id, $dest_id) + { + } + /** + * Is the action delayed? + * + * @return bool + */ + public function hasDelay() + { + } + /** + * Load event reminder of events + * + * @param string $type Type of reminder 'browser' or 'email' + * @param int $fk_user Id of user + * @param bool $onlypast true = get only past reminder, false = get all reminders linked to this + * @return int<-1,max> < if OK, else count of number of reminders + */ + public function loadReminders($type = '', $fk_user = 0, $onlypast = \true) + { + } + /** + * Send reminders by emails + * CAN BE A CRON TASK + * + * @return int<-1,1>|string 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) + */ + public function sendEmailsReminder() + { + } + /** + * Update the percent value of a event with the given id + * + * @param int $id The id of the event + * @param int<0,100> $percent The new percent value for the event + * @param int $usermodid The user who modified the percent + * @return int<-1,1> 1 when update of the event was successful, otherwise -1 + */ + public function updatePercent($id, $percent, $usermodid = 0) + { + } + } + /** + * Class for ActionCommReminder + */ + class ActionCommReminder extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'actioncomm_reminder'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'actioncomm_reminder'; + /** + * @var string String with name of icon for actioncommreminder. Must be the part after the 'object_' into object_actioncommreminder.png + */ + public $picto = 'generic'; + const STATUS_TODO = 0; + const STATUS_DONE = 1; + const STATUS_ERROR = -1; + /** + * 'type' if the field format. + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'position' is the sort order of field. + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'help' is a string visible as a tooltip on field + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'default' is a default value for creation (can still be replaced by the global setup of default values) + * 'showoncombobox' if field must be shown into the label of combobox + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id"), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'visible' => 0, 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'index' => 1), 'dateremind' => array('type' => 'datetime', 'label' => 'DateRemind', 'visible' => 1, 'enabled' => 1, 'position' => 60, 'notnull' => 1, 'index' => 1), 'typeremind' => array('type' => 'varchar(32)', 'label' => 'TypeRemind', 'visible' => -1, 'enabled' => 1, 'position' => 55, 'notnull' => 1, 'comment' => "email, browser, sms"), 'fk_user' => array('type' => 'integer', 'label' => 'User', 'visible' => -1, 'enabled' => 1, 'position' => 65, 'notnull' => 1, 'index' => 1), 'offsetvalue' => array('type' => 'integer', 'label' => 'OffsetValue', 'visible' => 1, 'enabled' => 1, 'position' => 56, 'notnull' => 1), 'offsetunit' => array('type' => 'varchar(1)', 'label' => 'OffsetUnit', 'visible' => 1, 'enabled' => 1, 'position' => 57, 'notnull' => 1, 'comment' => "y, m, d, w, h, i"), 'status' => array('type' => 'integer', 'label' => 'Status', 'visible' => 1, 'enabled' => 1, 'position' => 58, 'notnull' => 1, 'default' => '0', 'index' => 0, 'arrayofkeyval' => array('0' => 'ToDo', '1' => 'Done')), 'lasterror' => array('type' => 'varchar(128)', 'label' => 'LastError', 'visible' => -1, 'enabled' => 1, 'position' => 59, 'index' => 0), 'fk_actioncomm' => array('type' => 'integer', 'label' => 'Project', 'visible' => 1, 'enabled' => 1, 'position' => 70, 'notnull' => 1, 'index' => 1), 'fk_email_template' => array('type' => 'integer', 'label' => 'EmailTemplate', 'visible' => 1, 'enabled' => 1, 'position' => 80, 'notnull' => 0)); + /** + * @var int ID + */ + public $rowid; + /** + * @var int Entity + */ + public $entity; + public $dateremind; + /** + * @var string reminder type email, browser, sms + */ + public $typeremind; + /** + * @var int User ID + */ + public $fk_user; + /** + * @var int offset value + */ + public $offsetvalue; + /** + * @var string y, m, d, w, h, i + */ + public $offsetunit; + /** + * @var int Status + */ + public $status; + /** + * @var string Last error message + */ + public $lasterror; + /** + * @var int Project + */ + public $fk_actioncomm; + /** + * @var int Template Mail + */ + public $fk_email_template; + // END MODULEBUILDER PROPERTIES + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = \null) + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Return label of the status of a reminder + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public static function LibStatut($status, $mode = 0) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimen() + { + } + } + /** + * API class for Agenda Events + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ + class AgendaEvents extends \DolibarrApi + { + /** + * @var array $FIELDS Mandatory fields, checked when create and update object + */ + public static $FIELDS = array(); + /** + * @var ActionComm $actioncomm {@type ActionComm} + */ + public $actioncomm; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get properties of a Agenda Events object + * + * Return an array with Agenda Events information + * + * @param int $id ID of Agenda Events + * @return Object Object with cleaned properties + * + * @throws RestException + */ + public function get($id) + { + } + /** + * List Agenda Events + * + * Get a list of Agenda Events + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $user_ids User ids filter field (owners of event). Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'%dol%') and (t.datec:<:'20160101')" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* + * @return array Array of order objects + */ + public function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = '', $sqlfilters = '', $properties = '', $pagination_data = \false) + { + } + /** + * Create Agenda Event object + * + * @param array $request_data Request data + * @return int ID of Agenda Event + */ + public function post($request_data = \null) + { + } + /** + * Update Agenda Event general fields + * + * @param int $id Id of Agenda Event to update + * @param array $request_data Datas + * @return Object|false Object with cleaned properties + */ + public function put($id, $request_data = \null) + { + } + /** + * Delete Agenda Event + * + * @param int $id Agenda Event ID + * + * @return array + */ + public function delete($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensible object datas + * + * @param Object $object Object to clean + * @return Object Object with cleaned properties + */ + protected function _cleanObjectDatas($object) + { + } + } + /* Copyright (C) 2002-2003 Rodolphe Quiedeville + * Copyright (C) 2004-2014 Laurent Destailleur + * + * 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 . + */ + /** + * \file htdocs/comm/action/class/cactioncomm.class.php + * \ingroup agenda + * \brief File of class to manage type of agenda events + */ + /** + * Class to manage different types of events + */ + class CActionComm + { + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var int ID + */ + public $id; + /** + * @var string code + */ + public $code; + /** + * @var string type + */ + public $type; + /** + * @var string label + * @deprecated + * @see $label + */ + public $libelle; + /** + * @var string Type of agenda event label + */ + public $label; + /** + * @var int active + */ + public $active; + /** + * @var string color hex + */ + public $color; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto; + /** + * @var array array of type_actions + */ + public $type_actions = array(); + /** + * @var array Used to return value by some methods + */ + public $liste_array; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Load action type from database + * + * @param int|string $id id or code of action type to read + * @return int 1=ok, 0=not found, -1=error + */ + public function fetch($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of event types: array(id=>label) or array(code=>label) + * + * @param string|int $active 1 or 0 to filter on event state active or not ('' by default = no filter) + * @param string $idorcode 'id' or 'code' or 'all' + * @param string $excludetype Type to exclude ('system' or 'systemauto') + * @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1 or -2=Keep details and add a combined line per calendar (Default, Auto, BoothConf, ...) + * @param string $morefilter Add more SQL filter + * @param int $shortlabel 1=Get short label instead of long label + * @return array|int Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode. + */ + public function liste_array($active = '', $idorcode = 'id', $excludetype = '', $onlyautoornot = 0, $morefilter = '', $shortlabel = 0) + { + } + /** + * Return name of action type as a label translated + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Picto only + * @return string|-1 Label of action type, or -1 if error + */ + public function getNomUrl($withpicto = 0) + { + } + } + /** + * Class to read/parse ICal calendars + */ + class ICal + { + /** + * @var string Name of remote HTTP file to read + */ + public $file; + /** + * @var string Text in file + */ + public $file_text; + /** + * @var array Array to save iCalendar parse data + */ + public $cal; + /** + * @var int Number of Events + */ + public $event_count; + /** + * @var int Number of Todos + */ + public $todo_count; + /** + * @var int Number of Freebusy + */ + public $freebusy_count; + /** + * @var string Help variable save last key (multiline string) + */ + public $last_key; + /** + * @var string error message + */ + public $error; + /** + * Constructor + */ + public function __construct() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Read text file, icalender text file + * + * @param string $file File + * @return string|null Content of remote file read or null if error + */ + public function read_file($file) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns the number of calendar events + * + * @return int + */ + public function get_event_count() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns the number of to do + * + * @return int + */ + public function get_todo_count() + { + } + /** + * Translate Calendar + * + * @param string $uri Url + * @param string $usecachefile Full path of a cache file to use a cache file + * @param int $delaycache Delay in seconds for cache (by default 3600 secondes) + * @return array|string + */ + public function parse($uri, $usecachefile = '', $delaycache = 3600) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Add to $this->ical array one value and key. + * + * @param string $type Type ('VTODO', 'VEVENT', 'VFREEBUSY', 'VCALENDAR'...) + * @param string $key Key ('DTSTART', ...). Note: Field is never 'DTSTART;TZID=...' because ';...' was before removed and added as another property + * @param string $value Value + * @return void + */ + public function add_to_array($type, $key, $value) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value"); + * + * @param string $text Text + * @return array + */ + public function retun_key_value($text) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Parse RRULE return array + * + * @param string $value string + * @return array + */ + public function ical_rrule($value) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return Unix time from ical date time format (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS) + * + * @param string $ical_date String date + * @return int + */ + public function ical_date_to_unix($ical_date) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return unix date from iCal date format + * + * @param string $key Key. Example: 'DTSTART', 'DTSTART;TZID=US-Eastern' + * @param string $value Value. Example: '19970714T133000', '19970714T173000Z', '19970714T133000' + * @return array{0:string,1:int}|array{0:string,1:array} + */ + public function ical_dt_date($key, $value) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return sorted eventlist as array or false if calendar is empty + * + * @return array|false + */ + public function get_sort_event_list() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Compare two unix timestamp + * + * @param array $a Operand a + * @param array $b Operand b + * @return integer + */ + public function ical_dtstart_compare($a, $b) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return eventlist array (not sorted eventlist array) + * + * @return array + */ + public function get_event_list() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return freebusy array (not sort eventlist array) + * + * @return array + */ + public function get_freebusy_list() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return to do array (not sorted todo array) + * + * @return array + */ + public function get_todo_list() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return base calendar data + * + * @return array + */ + public function get_calender_data() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return array with all data + * + * @return array + */ + public function get_all_data() + { + } + } + /* Advance Targeting Emailing for mass emailing module + * Copyright (C) 2013 Florian Henry + * + * 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 . + */ + /** + * \file comm/mailing/class/advtargetemailing.class.php + * \ingroup mailing + * \brief This file is an example CRUD class file (Create/Read/Update/Delete) + */ + /** + * Class to manage advanced emailing target selector + */ + class AdvanceTargetingMailing extends \CommonObject + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string ID to identify managed object + */ + public $element = 'advtargetemailing'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'mailing_advtarget'; + /** + * @var int ID + */ + public $id; + /** + * @var string name + */ + public $name; + /** + * @var int element id (it's not the name of a field) + */ + public $fk_element; + /** + * @var string type element + */ + public $type_element; + /** + * @var string filter value + */ + public $filtervalue; + /** + * @var int user author id + */ + public $fk_user_author; + /** + * @var int|string datec + */ + public $datec = ''; + /** + * @var int user mod id + */ + public $fk_user_mod; + /** + * @var array select target type + */ + public $select_target_type = array(); + /** + * @var array type status comm prospect + */ + public $type_statuscommprospect = array(); + public $thirdparty_lines; + public $contact_lines; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load object in memory from the database + * + * @param int $id Id object + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch_by_mailing($id = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $type_element Type target + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch_by_element($id = 0, $type_element = 'mailing') + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Save query in database to retrieve it + * + * @param User $user User that deletes + * @param array $arrayquery All element to Query + * @return int Return integer <0 if KO, >0 if OK + */ + public function savequery($user, $arrayquery) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load object in memory from database + * + * @param array $arrayquery All element to Query + * @return int Return integer <0 if KO, >0 if OK + */ + public function query_thirdparty($arrayquery) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load object in memory from database + * + * @param array $arrayquery All element to Query + * @param int $withThirdpartyFilter add contact with tridparty filter + * @return int Return integer <0 if KO, >0 if OK + */ + public function query_contact($arrayquery, $withThirdpartyFilter = 0) + { + } + /** + * Parse criteria to return a SQL query formatted + * + * @param string $column_to_test column to test + * @param string $criteria Use %% as magic characters. For example to find all item like jean, joe, jim, you can input j%%, you can also use ; as separator for value, + * and use ! for except this value. + * For example jean;joe;jim%%;!jimo;!jima%> will target all jean, joe, start with jim but not jimo and not everythnig that start by jima + * @return string Sql to use for the where condition + */ + public function transformToSQL($column_to_test, $criteria) + { + } + } + /* Copyright (c) 2002-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2006 Marc Barilley/Ocebo + * Copyright (C) 2007 Franky Van Liedekerke + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2010-2021 Philippe Grand + * Copyright (C) 2011 Herve Prot + * Copyright (C) 2012-2016 Marcos García + * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2012-2015 Raphaël Doursenaud + * Copyright (C) 2014-2023 Alexandre Spangaro + * Copyright (C) 2018-2022 Ferran Marcet + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Christophe Battarel + * Copyright (C) 2018 Josep Lluis Amador + * Copyright (C) 2023 Joachim Kueter + * Copyright (C) 2023 Nick Fragoulis + * Copyright (C) 2024 MDW + * Copyright (C) 2024 William Mead + * + * 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 . + */ + /** + * \file htdocs/core/class/html.form.class.php + * \ingroup core + * \brief File of class with all html predefined components + */ + /** + * Class to manage generation of HTML components + * Only common components must be here. + * + * TODO Merge all function load_cache_* and loadCache* (except load_cache_vatrates) into one generic function loadCacheTable + */ + class Form + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Array of error strings + */ + public $errors = array(); + // Some properties used to return data by some methods + /** @var array */ + public $result; + /** @var int */ + public $num; + // Cache arrays + public $cache_types_paiements = array(); + public $cache_conditions_paiements = array(); + public $cache_transport_mode = array(); + public $cache_availability = array(); + public $cache_demand_reason = array(); + public $cache_types_fees = array(); + public $cache_vatrates = array(); + public $cache_invoice_subtype = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Output key field for an editable field + * + * @param string $text Text of label or key to translate + * @param string $htmlname Name of select field ('edit' prefix will be added) + * @param string $preselected Value to show/edit (not used in this function) + * @param object $object Object (on the page we show) + * @param boolean $perm Permission to allow button to edit parameter. Set it to 0 to have a not edited field. + * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datehourpicker' 'checkbox:ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...) + * @param string $moreparam More param to add on a href URL. + * @param int $fieldrequired 1 if we want to show field as mandatory using the "fieldrequired" CSS. + * @param int $notabletag 1=Do not output table tags but output a ':', 2=Do not output table tags and no ':', 3=Do not output table tags but output a ' ' + * @param string $paramid Key of parameter for id ('id', 'socid') + * @param string $help Tooltip help + * @return string HTML edit field + */ + public function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata = 'string', $moreparam = '', $fieldrequired = 0, $notabletag = 0, $paramid = 'id', $help = '') + { + } + /** + * Output value of a field for an editable field + * + * @param string $text Text of label (not used in this function) + * @param string $htmlname Name of select field + * @param string $value Value to show/edit + * @param CommonObject $object Object (that we want to show) + * @param boolean $perm Permission to allow button to edit parameter + * @param string $typeofdata Type of data ('string' by default, 'checkbox', 'email', 'phone', 'amount:99', 'numeric:99', + * 'text' or 'textarea:rows:cols%', 'safehtmlstring', 'restricthtml', + * 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datehourpicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...') + * @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formatted price instead of numeric value, or a select combo). Use '' to use same than $value + * @param ?CommonObject $extObject External object ??? + * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') + * @param string $moreparam More param to add on the form on action href URL parameter + * @param int $notabletag Do no output table tags + * @param string $formatfunc Call a specific method of $object->$formatfunc to output field in view mode (For example: 'dol_print_email') + * @param string $paramid Key of parameter for id ('id', 'socid') + * @param string $gm 'auto' or 'tzuser' or 'tzuserrel' or 'tzserver' (when $typeofdata is a date) + * @param array $moreoptions Array with more options. For example array('addnowlink'=>1), array('valuealreadyhtmlescaped'=>1) + * @param string $editaction [=''] use GETPOST default action or set action to edit mode + * @return string HTML edit field + */ + public function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata = 'string', $editvalue = '', $extObject = \null, $custommsg = \null, $moreparam = '', $notabletag = 1, $formatfunc = '', $paramid = 'id', $gm = 'auto', $moreoptions = array(), $editaction = '') + { + } + /** + * Output edit in place form + * + * @param string $fieldname Name of the field + * @param CommonObject $object Object + * @param boolean $perm Permission to allow button to edit parameter. Set it to 0 to have a not edited field. + * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...) + * @param string $check Same coe than $check parameter of GETPOST() + * @param string $morecss More CSS + * @return string HTML code for the edit of alternative language + */ + public function widgetForTranslation($fieldname, $object, $perm, $typeofdata = 'string', $check = '', $morecss = '') + { + } + /** + * Output edit in place form + * + * @param CommonObject $object Object + * @param string $value Value to show/edit + * @param string $htmlname DIV ID (field name) + * @param int $condition Condition to edit + * @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:loadmethod:savemethod:buttononly') + * @param string $editvalue When in edit mode, use this value as $value instead of value + * @param ?CommonObject $extObject External object + * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') + * @return string HTML edit in place + */ + protected function editInPlace($object, $value, $htmlname, $condition, $inputType = 'textarea', $editvalue = \null, $extObject = \null, $custommsg = \null) + { + } + /** + * Show a text and picto with tooltip on text or picto. + * Can be called by an instancied $form->textwithtooltip or by a static call Form::textwithtooltip + * + * @param string $text Text to show + * @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded. + * @param int $tooltipon 1=tooltip on text, 2=tooltip on image, 3=tooltip on both + * @param int $direction -1=image is before, 0=no image, 1=image is after + * @param string $img Html code for image (use img_xxx() function to get it) + * @param string $extracss Add a CSS style to td tags + * @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span + * @param string $incbefore Include code before the text + * @param int $noencodehtmltext Do not encode into html entity the htmltext + * @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key) + * @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only) + * @return string Code html du tooltip (texte+picto) + * @see textwithpicto() Use textwithpicto() instead of textwithtooltip if you can. + */ + public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) + { + } + /** + * Show a text with a picto and a tooltip on picto + * + * @param string $text Text to show + * @param string $htmltext Content of tooltip + * @param int $direction 1=Icon is after text, -1=Icon is before text, 0=no icon + * @param string $type Type of picto ('info', 'infoclickable', 'help', 'helpclickable', 'warning', 'superadmin', 'mypicto@mymodule', ...) or image filepath or 'none' + * @param string $extracss Add a CSS style to td, div or span tag + * @param int $noencodehtmltext Do not encode into html entity the htmltext + * @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span + * @param string $tooltiptrigger ''=Tooltip on hover and hidden on smartphone, 'abconsmartphone'=Tooltip on hover and on click on smartphone, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none' or on both if $type='xxxclickable') + * @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only) + * @return string HTML code of text, picto, tooltip + */ + public function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 3, $tooltiptrigger = '', $forcenowrap = 0) + { + } + /** + * Generate select HTML to choose massaction + * + * @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default. + * @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action. + * @param int $alwaysvisible 1=select button always visible + * @param string $name Name for massaction + * @param string $cssclass CSS class used to check for select + * @return string|void Select list + */ + public function selectMassAction($selected, $arrayofaction, $alwaysvisible = 0, $name = 'massaction', $cssclass = 'checkforselect') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return combo list of activated countries, into language of user + * + * @param string $selected Id or Code or Label of preselected country + * @param string $htmlname Name of html select object + * @param string $htmloption More html options on select object + * @param integer $maxlength Max length for labels (0=no limit) + * @param string $morecss More css class + * @param string $usecodeaskey ''=Use id as key (default), 'code3'=Use code on 3 alpha as key, 'code2"=Use code on 2 alpha as key + * @param int<0,1>|string $showempty Show empty choice + * @param int<0,1> $disablefavorites 1=Disable favorites, + * @param int<0,1> $addspecialentries 1=Add dedicated entries for group of countries (like 'European Economic Community', ...) + * @param string[] $exclude_country_code Array of country code (iso2) to exclude + * @param int<0,1> $hideflags Hide flags + * @return string HTML string with select + */ + public function select_country($selected = '', $htmlname = 'country_id', $htmloption = '', $maxlength = 0, $morecss = 'minwidth300', $usecodeaskey = '', $showempty = 1, $disablefavorites = 0, $addspecialentries = 0, $exclude_country_code = array(), $hideflags = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return select list of incoterms + * + * @param string $selected Id or Code of preselected incoterm + * @param string $location_incoterms Value of input location + * @param string $page Defined the form action + * @param string $htmlname Name of html select object + * @param string $htmloption Options html on select object + * @param int<0,1> $forcecombo Force to load all values and output a standard combobox (with no beautification) + * @param array}> $events Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @param int<0,1> $disableautocomplete Disable autocomplete + * @return string HTML string with select and input + */ + public function select_incoterms($selected = '', $location_incoterms = '', $page = '', $htmlname = 'incoterm_id', $htmloption = '', $forcecombo = 1, $events = array(), $disableautocomplete = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of types of lines (product or service) + * Example: 0=product, 1=service, 9=other (for external module) + * + * @param string $selected Preselected type + * @param string $htmlname Name of field in html form + * @param int<0,1>|string $showempty Add an empty field + * @param int $hidetext Do not show label 'Type' before combo box (used only if there is at least 2 choices to select) + * @param integer $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, 2=Force to show only Products, 3=Force to show only services, -1=Force none (and set hidden field to 'service') + * @param string $morecss More css + * @return void + */ + public function select_type_of_lines($selected = '', $htmlname = 'type', $showempty = 0, $hidetext = 0, $forceall = 0, $morecss = "") + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load into cache cache_types_fees, array of types of fees + * + * @return int Nb of lines loaded, <0 if KO + */ + public function load_cache_types_fees() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of types of notes + * + * @param string $selected Preselected type + * @param string $htmlname Name of field in form + * @param int $showempty Add an empty field + * @return void + */ + public function select_type_fees($selected = '', $htmlname = 'type', $showempty = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Output html form to select a third party + * This call select_thirdparty_list() or ajax depending on setup. This component is not able to support multiple select. + * + * @param int|string $selected Preselected ID + * @param string $htmlname Name of field in form + * @param string $filter Optional filters criteras. WARNING: To avoid SQL injection, only few chars [.a-z0-9 =<>()] are allowed here. Example: ((s.client:IN:1,3) AND (s.status:=:1)). Do not use a filter coming from input of users. + * @param string|int<1,1> $showempty Add an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty') + * @param int<0,1> $showtype Show third party type in combolist (customer, prospect or supplier) + * @param int<0,1> $forcecombo Force to load all values and output a standard combobox (with no beautification) + * @param array}> $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @param int $limit Maximum number of elements + * @param string $morecss Add more css styles to the SELECT component + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container + * @param string $selected_input_value Value of preselected input text (for use with ajax) + * @param int<0,3> $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) + * @param array $ajaxoptions Options for ajax_autocompleter + * @param bool $multiple add [] in the name of element and add 'multiple' attribute (not working with ajax_autocompleter) + * @param string[] $excludeids Exclude IDs from the select combo + * @param int<0,1> $showcode Show code + * @return string HTML string with select box for thirdparty. + */ + public function select_company($selected = '', $htmlname = 'socid', $filter = '', $showempty = '', $showtype = 0, $forcecombo = 0, $events = array(), $limit = 0, $morecss = 'minwidth100', $moreparam = '', $selected_input_value = '', $hidelabel = 1, $ajaxoptions = array(), $multiple = \false, $excludeids = array(), $showcode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Output html form to select a contact + * This call select_contacts() or ajax depending on setup. This component is not able to support multiple select. + * + * Return HTML code of the SELECT of list of all contacts (for a third party or all). + * This also set the number of contacts found into $this->num + * + * @param int $socid Id of third party or 0 for all or -1 for empty list + * @param int|string $selected ID of preselected contact id + * @param string $htmlname Name of HTML field ('none' for a not editable field) + * @param int<0,3>|string $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list + * @param string $exclude List of contacts id to exclude + * @param string $limitto Not used + * @param integer $showfunction Add function into label + * @param string $morecss Add more class to class style + * @param bool $nokeyifsocid When 1, we force the option "Press a key to show list" to 0 if there is a value for $socid + * @param integer $showsoc Add company into label + * @param int $forcecombo 1=Force to use combo box (so no ajax beautify effect) + * @param array}> $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container + * @param string $htmlid Html id to use instead of htmlname + * @param string $selected_input_value Value of preselected input text (for use with ajax) + * @param string $filter Optional filters criteras. WARNING: To avoid SQL injection, only few chars [.a-z0-9 =<>()] are allowed here. Example: ((s.client:IN:1,3) AND (s.status:=:1)). Do not use a filter coming from input of users. + * @return int|string Return integer <0 if KO, HTML with select string if OK. + */ + public function select_contact($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $morecss = '', $nokeyifsocid = \true, $showsoc = 0, $forcecombo = 0, $events = array(), $moreparam = '', $htmlid = '', $selected_input_value = '', $filter = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Output html form to select a third party. + * Note: you must use the select_company() to get the component to select a third party. This function must only be called by select_company. + * + * @param string $selected Preselected type + * @param string $htmlname Name of field in form + * @param string $filter Optional filters criteras. WARNING: To avoid SQL injection, only few chars [.a-z0-9 =<>] are allowed here, example: 's.rowid <> x' + * If you need parenthesis, use the Universal Filter Syntax, example: '(s.client:in:1,3)' + * Do not use a filter coming from input of users. + * @param string|int<0,1> $showempty Add an empty field (Can be '1' or text to use on empty line like 'SelectThirdParty') + * @param int<0,1> $showtype Show third party type in combolist (customer, prospect or supplier) + * @param int $forcecombo Force to use standard HTML select component without beautification + * @param array}> $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @param string $filterkey Filter on key value + * @param int<0,1> $outputmode 0=HTML select string, 1=Array + * @param int $limit Limit number of answers + * @param string $morecss Add more css styles to the SELECT component + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container + * @param bool $multiple add [] in the name of element and add 'multiple' attribute + * @param string[] $excludeids Exclude IDs from the select combo + * @param int<0,1> $showcode Show code in list + * @return array|string HTML string with + * @see select_company() + */ + public function select_thirdparty_list($selected = '', $htmlname = 'socid', $filter = '', $showempty = '', $showtype = 0, $forcecombo = 0, $events = array(), $filterkey = '', $outputmode = 0, $limit = 0, $morecss = 'minwidth100', $moreparam = '', $multiple = \false, $excludeids = array(), $showcode = 0) + { + } + /** + * Return HTML code of the SELECT of list of all contacts (for a third party or all). + * This also set the number of contacts found into $this->num + * Note: you must use the select_contact() to get the component to select a contact. This function must only be called by select_contact. + * + * @param int $socid Id of third party or 0 for all or -1 for empty list + * @param array|int|string $selected Array of ID of preselected contact id + * @param string $htmlname Name of HTML field ('none' for a not editable field) + * @param int<0,3>|string $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list + * @param string $exclude List of contacts id to exclude + * @param string $limitto Disable answers that are not id in this array list + * @param integer $showfunction Add function into label + * @param string $morecss Add more class to class style + * @param int $options_only 1=Return options only (for ajax treatment), 2=Return array + * @param integer $showsoc Add company into label + * @param int $forcecombo Force to use combo box (so no ajax beautify effect) + * @param array}> $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container + * @param string $htmlid Html id to use instead of htmlname + * @param bool $multiple add [] in the name of element and add 'multiple' attribute + * @param integer $disableifempty Set tag 'disabled' on select if there is no choice + * @param string $filter Optional filters criteras. You must use the USF (Universal Search Filter) syntax, example: '(s.client:in:1,3)' + * Do not use a filter coming from input of users. + * @return int|string|array Return integer <0 if KO, HTML with select string if OK. + */ + public function selectcontacts($socid, $selected = array(), $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $morecss = '', $options_only = 0, $showsoc = 0, $forcecombo = 0, $events = array(), $moreparam = '', $htmlid = '', $multiple = \false, $disableifempty = 0, $filter = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return HTML combo list of absolute discounts + * + * @param string $selected Id Fixed reduction preselected + * @param string $htmlname Name of the form field + * @param string $filter Optional filter critreria + * @param int $socid Id of thirdparty + * @param int $maxvalue Max value for lines that can be selected + * @return int Return number of qualifed lines in list + */ + public function select_remises($selected, $htmlname, $filter, $socid, $maxvalue = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the HTML select list of users + * + * @param string $selected Id user preselected + * @param string $htmlname Field name in form + * @param int<0,1> $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue + * @param int[] $exclude Array list of users id to exclude + * @param int<0,1> $disabled If select list must be disabled + * @param int[]|string $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me + * @param int[]|int $enableonly Array list of users id to be enabled. All other must be disabled + * @param string $force_entity '0' or Ids of environment to force + * @return void + * @deprecated Use select_dolusers instead + * @see select_dolusers() + */ + public function select_users($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = \null, $disabled = 0, $include = '', $enableonly = array(), $force_entity = '0') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return select list of users + * + * @param string|int|User $selected User id or user object of user preselected. If 0 or < -2, we use id of current user. If -1 or '', keep unselected (if empty is allowed) + * @param string $htmlname Field name in form + * @param int<0,1>|string $show_empty 0=list with no empty value, 1=add also an empty value into list + * @param int[]|null $exclude Array list of users id to exclude + * @param int $disabled If select list must be disabled + * @param int[]|string $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me + * @param array|string $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled + * @param string $force_entity '0' or list of Ids of environment to force, separated by a coma, or 'default' = do no extend to all entities allowed to superadmin. + * @param int $maxlength Maximum length of string into list (0=no limit) + * @param int<-1,1> $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status + * @param string $morefilter Add more filters into sql request (Example: '(employee:=:1)'). This value must not come from user input. + * @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list + * @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. + * @param string $morecss More css + * @param int<0,1> $notdisabled Show only active users (note: this will also happen, whatever is this option, if USER_HIDE_INACTIVE_IN_COMBOBOX is on). + * @param int<0,2> $outputmode 0=HTML select string, 1=Array, 2=Detailed array + * @param bool $multiple add [] in the name of element and add 'multiple' attribute + * @param int<0,1> $forcecombo Force the component to be a simple combo box without ajax + * @return string|array HTML select string + * @see select_dolgroups() + */ + public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = \null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $notdisabled = 0, $outputmode = 0, $multiple = \false, $forcecombo = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return select list of users. Selected users are stored into session. + * List of users are provided into $_SESSION['assignedtouser']. + * + * @param string $action Value for $action + * @param string $htmlname Field name in form + * @param int<0,1> $show_empty 0=list without the empty value, 1=add empty value + * @param int[] $exclude Array list of users id to exclude + * @param int<0,1> $disabled If select list must be disabled + * @param int[]|string $include Array list of users id to include or 'hierarchy' to have only supervised users + * @param int[]|int $enableonly Array list of users id to be enabled. All other must be disabled + * @param string $force_entity '0' or Ids of environment to force + * @param int $maxlength Maximum length of string into list (0=no limit) + * @param int<0,1> $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status + * @param string $morefilter Add more filters into sql request + * @param int $showproperties Show properties of each attendees + * @param int[] $listofuserid Array with properties of each user + * @param int[] $listofcontactid Array with properties of each contact + * @param int[] $listofotherid Array with properties of each other contact + * @return string HTML select string + * @see select_dolgroups() + */ + public function select_dolusers_forevent($action = '', $htmlname = 'userid', $show_empty = 0, $exclude = \null, $disabled = 0, $include = array(), $enableonly = array(), $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $showproperties = 0, $listofuserid = array(), $listofcontactid = array(), $listofotherid = array()) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return select list of resources. Selected resources are stored into session. + * List of resources are provided into $_SESSION['assignedtoresource']. + * + * @param string $action Value for $action + * @param string $htmlname Field name in form + * @param int $show_empty 0=list without the empty value, 1=add empty value + * @param int[] $exclude Array list of users id to exclude + * @param int<0,1> $disabled If select list must be disabled + * @param int[]|string $include Array list of users id to include or 'hierarchy' to have only supervised users + * @param int[] $enableonly Array list of users id to be enabled. All other must be disabled + * @param string $force_entity '0' or Ids of environment to force + * @param int $maxlength Maximum length of string into list (0=no limit) + * @param int<-1,1> $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status + * @param string $morefilter Add more filters into sql request + * @param int $showproperties Show properties of each attendees + * @param array}> $listofresourceid Array with properties of each resource + * @return string HTML select string + */ + public function select_dolresources_forevent($action = '', $htmlname = 'userid', $show_empty = 0, $exclude = \null, $disabled = 0, $include = array(), $enableonly = array(), $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $showproperties = 0, $listofresourceid = array()) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of products for customer. + * Use Ajax if Ajax activated or go to select_produits_list + * + * @param int $selected Preselected products + * @param string $htmlname Name of HTML select field (must be unique in page). + * @param int|string $filtertype Filter on product type (''=nofilter, 0=product, 1=service) + * @param int $limit Limit on number of returned lines + * @param int $price_level Level of price to show + * @param int $status Sell status: -1=No filter on sell status, 0=Products not on sell, 1=Products on sell + * @param int $finished 2=all, 1=finished, 0=raw material + * @param string $selected_input_value Value of preselected input text (for use with ajax) + * @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) + * @param array $ajaxoptions Options for ajax_autocompleter + * @param int $socid Thirdparty Id (to get also price dedicated to this customer) + * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @param int<0,1> $hidepriceinlabel 1=Hide prices in label + * @param string $warehouseStatus Warehouse status filter to count the quantity in stock. Following comma separated filter options can be used + * 'warehouseopen' = count products from open warehouses, + * 'warehouseclosed' = count products from closed warehouses, + * 'warehouseinternal' = count products from warehouses for internal correct/transfer only + * @param ?mixed[] $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) + * @param int<0,1> $nooutput No print if 1, return the output into a string + * @param int<-1,1> $status_purchase Purchase status: -1=No filter on purchase status, 0=Products not on purchase, 1=Products on purchase + * @param int $warehouseId Filter by Warehouses Id where there is real stock + * + * @return void|string + */ + public function select_produits($selected = 0, $htmlname = 'productid', $filtertype = '', $limit = 0, $price_level = 0, $status = 1, $finished = 2, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $hidepriceinlabel = 0, $warehouseStatus = '', $selected_combinations = \null, $nooutput = 0, $status_purchase = -1, $warehouseId = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of BOM for customer in Ajax if Ajax activated or go to select_produits_list + * + * @param string $selected Preselected BOM id + * @param string $htmlname Name of HTML select field (must be unique in page). + * @param int $limit Limit on number of returned lines + * @param int $status Sell status -1=Return all bom, 0=Draft BOM, 1=Validated BOM + * @param int $type type of the BOM (-1=Return all BOM, 0=Return disassemble BOM, 1=Return manufacturing BOM) + * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param string $morecss Add more css on select + * @param string $nooutput No print, return the output into a string + * @param int $forcecombo Force to use combo box + * @param string[] $TProducts Add filter on a defined product + * @return void|string + */ + public function select_bom($selected = '', $htmlname = 'bom_id', $limit = 0, $status = 1, $type = 0, $showempty = '1', $morecss = '', $nooutput = '', $forcecombo = 0, $TProducts = []) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of products for a customer. + * Called by select_produits. + * + * @param int $selected Preselected product + * @param string $htmlname Name of select html + * @param string $filtertype Filter on product type (''=nofilter, 0=product, 1=service) + * @param int $limit Limit on number of returned lines + * @param int $price_level Level of price to show + * @param string $filterkey Filter on product + * @param int $status -1=Return all products, 0=Products not on sell, 1=Products on sell + * @param int $finished Filter on finished field: 2=No filter + * @param int $outputmode 0=HTML select string, 1=Array + * @param int $socid Thirdparty Id (to get also price dedicated to this customer) + * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @param int $hidepriceinlabel 1=Hide prices in label + * @param string $warehouseStatus Warehouse status filter to group/count stock. Following comma separated filter options can be used. + * 'warehouseopen' = count products from open warehouses, + * 'warehouseclosed' = count products from closed warehouses, + * 'warehouseinternal' = count products from warehouses for internal correct/transfer only + * @param int $status_purchase Purchase status -1=Return all products, 0=Products not on purchase, 1=Products on purchase + * @param int $warehouseId Filter by Warehouses Id where there is real stock + * @return array|string Array of keys for json + */ + public function select_produits_list($selected = 0, $htmlname = 'productid', $filtertype = '', $limit = 20, $price_level = 0, $filterkey = '', $status = 1, $finished = 2, $outputmode = 0, $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = 'maxwidth500', $hidepriceinlabel = 0, $warehouseStatus = '', $status_purchase = -1, $warehouseId = 0) + { + } + /** + * Function to forge the string with OPTIONs of SELECT. + * This define value for &$opt and &$optJson. + * This function is called by select_produits_list(). + * + * @param stdClass $objp Resultset of fetch + * @param string $opt Option (var used for returned value in string option format) + * @param array{key:string,value:string,label:string,label2:string,desc:string,type:string,price_ht:string,price_ttc:string,price_ht_locale:string,price_ttc_locale:string,pricebasetype:string,tva_tx:string,default_vat_code:string,qty:string,discount:string,duration_value:string,duration_unit:string,pbq:string,labeltrans:string,desctrans:string,ref_customer:string} $optJson Option (var used for returned value in json format) + * @param int $price_level Price level + * @param int $selected Preselected value + * @param int<0,1> $hidepriceinlabel Hide price in label + * @param string $filterkey Filter key to highlight + * @param int<0,1> $novirtualstock Do not load virtual stock, even if slow option STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO is on. + * @return void + */ + protected function constructProductListOption(&$objp, &$opt, &$optJson, $price_level, $selected, $hidepriceinlabel = 0, $filterkey = '', $novirtualstock = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list) + * + * @param int $socid Id third party + * @param string $selected Preselected product + * @param string $htmlname Name of HTML Select + * @param string $filtertype Filter on product type (''=nofilter, 0=product, 1=service) + * @param string $filtre For a SQL filter + * @param array $ajaxoptions Options for ajax_autocompleter + * @param int<0,1> $hidelabel Hide label (0=no, 1=yes) + * @param int<0,1> $alsoproductwithnosupplierprice 1=Add also product without supplier prices + * @param string $morecss More CSS + * @param string $placeholder Placeholder + * @return void + */ + public function select_produits_fournisseurs($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $ajaxoptions = array(), $hidelabel = 0, $alsoproductwithnosupplierprice = 0, $morecss = '', $placeholder = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of suppliers products + * + * @param int $socid Id of supplier thirdparty (0 = no filter) + * @param string $selected Product price preselected (must be 'id' in product_fournisseur_price or 'idprod_IDPROD') + * @param string $htmlname Name of HTML select + * @param string $filtertype Filter on product type (''=nofilter, 0=product, 1=service) + * @param string $filtre Generic filter. Data must not come from user input. + * @param string $filterkey Filter of produdts + * @param int $statut -1=Return all products, 0=Products not on buy, 1=Products on buy + * @param int $outputmode 0=HTML select string, 1=Array + * @param int $limit Limit of line number + * @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices + * @param string $morecss Add more CSS + * @param int $showstockinlist Show stock information (slower). + * @param string $placeholder Placeholder + * @return array|string Array of keys for json or HTML component + */ + public function select_produits_fournisseurs_list($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $filterkey = '', $statut = -1, $outputmode = 0, $limit = 100, $alsoproductwithnosupplierprice = 0, $morecss = '', $showstockinlist = 0, $placeholder = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of suppliers prices for a product + * + * @param int $productid Id of product + * @param string $htmlname Name of HTML field + * @param int $selected_supplier Pre-selected supplier if more than 1 result + * @return string + */ + public function select_product_fourn_price($productid, $htmlname = 'productfournpriceid', $selected_supplier = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load into cache list of payment terms + * + * @return int Nb of lines loaded, <0 if KO + */ + public function load_cache_conditions_paiements() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load int a cache property th elist of possible delivery delays. + * + * @return int Nb of lines loaded, <0 if KO + */ + public function load_cache_availability() + { + } + /** + * Return the list of type of delay available. + * + * @param string $selected Id du type de delais pre-selectionne + * @param string $htmlname Nom de la zone select + * @param string $filtertype To add a filter + * @param int $addempty Add empty entry + * @param string $morecss More CSS + * @return void + */ + public function selectAvailabilityDelay($selected = '', $htmlname = 'availid', $filtertype = '', $addempty = 0, $morecss = '') + { + } + /** + * Load into cache cache_demand_reason, array of input reasons + * + * @return int Nb of lines loaded, <0 if KO + */ + public function loadCacheInputReason() + { + } + /** + * Return list of input reason (events that triggered an object creation, like after sending an emailing, making an advert, ...) + * List found into table c_input_reason loaded by loadCacheInputReason + * + * @param string $selected Id or code of type origin to select by default + * @param string $htmlname Nom de la zone select + * @param string $exclude To exclude a code value (Example: SRC_PROP) + * @param int $addempty Add an empty entry + * @param string $morecss Add more css to the HTML select component + * @param int $notooltip Do not show the tooltip for admin + * @return void + */ + public function selectInputReason($selected = '', $htmlname = 'demandreasonid', $exclude = '', $addempty = 0, $morecss = '', $notooltip = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Charge dans cache la liste des types de paiements possibles + * + * @return int Nb of lines loaded, <0 if KO + */ + public function load_cache_types_paiements() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * print list of payment modes. + * Constant MAIN_DEFAULT_PAYMENT_TERM_ID can be used to set default value but scope is all application, probably not what you want. + * See instead to force the default value by the caller. + * + * @param int $selected Id of payment term to preselect by default + * @param string $htmlname Nom de la zone select + * @param int $filtertype If > 0, include payment terms with deposit percentage (for objects other than invoices and invoice templates) + * @param int $addempty Add an empty entry + * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info + * @param string $morecss Add more CSS on select tag + * @param int $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters) + * 0 : use default deposit percentage from entry + * > 0 : force deposit percentage (for example, from company object) + * @param int $noprint if set to one we return the html to print, if 0 (default) we print it + * @return void|string + * @deprecated Use getSelectConditionsPaiements() instead and handle noprint locally. + */ + public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1, $noprint = 0) + { + } + /** + * Return list of payment modes. + * Constant MAIN_DEFAULT_PAYMENT_TERM_ID can be used to set default value but scope is all application, probably not what you want. + * See instead to force the default value by the caller. + * + * @param int $selected Id of payment term to preselect by default + * @param string $htmlname Nom de la zone select + * @param int $filtertype If > 0, include payment terms with deposit percentage (for objects other than invoices and invoice templates) + * @param int $addempty Add an empty entry + * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info + * @param string $morecss Add more CSS on select tag + * @param int $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters) + * 0 : use default deposit percentage from entry + * > 0 : force deposit percentage (for example, from company object) + * @return string String for the HTML select component + */ + public function getSelectConditionsPaiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of payment methods + * Constant MAIN_DEFAULT_PAYMENT_TYPE_ID can used to set default value but scope is all application, probably not what you want. + * + * @param string $selected Id or code or preselected payment mode + * @param string $htmlname Name of select field + * @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz)) + * @param int $format 0=id+label, 1=code+code, 2=code+label, 3=id+code + * @param int $empty 1=can be empty, 0 otherwise + * @param int $noadmininfo 0=Add admin info, 1=Disable admin info + * @param int $maxlength Max length of label + * @param int $active Active or not, -1 = all + * @param string $morecss Add more CSS on select tag + * @param int $nooutput 1=Return string, do not send to output + * @return string|void String for the HTML select component + */ + public function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '', $nooutput = 0) + { + } + /** + * Selection HT or TTC + * + * @param string $selected Id pre-selectionne + * @param string $htmlname Nom de la zone select + * @param int $addjscombo Add js combo + * @return string Code of HTML select to chose tax or not + */ + public function selectPriceBaseType($selected = '', $htmlname = 'price_base_type', $addjscombo = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load in cache list of transport mode + * + * @return int Nb of lines loaded, <0 if KO + */ + public function load_cache_transport_mode() + { + } + /** + * Return list of transport mode for intracomm report + * + * @param string $selected Id of the transport mode preselected + * @param string $htmlname Name of the select field + * @param int $format 0=id+label, 1=code+code, 2=code+label, 3=id+code + * @param int $empty 1=can be empty, 0 else + * @param int $noadmininfo 0=Add admin info, 1=Disable admin info + * @param int $maxlength Max length of label + * @param int $active Active or not, -1 = all + * @param string $morecss Add more CSS on select tag + * @return void + */ + public function selectTransportMode($selected = '', $htmlname = 'transportmode', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '') + { + } + /** + * Return a HTML select list of shipping mode + * + * @param string $selected Id shipping mode preselected + * @param string $htmlname Name of select zone + * @param string $filtre To filter list. This parameter must not come from input of users + * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @param string $moreattrib To add more attribute on select + * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info + * @param string $morecss More CSS + * @return void + */ + public function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '', $noinfoadmin = 0, $morecss = '') + { + } + /** + * Display form to select shipping mode + * + * @param string $page Page + * @param string $selected Id of shipping mode + * @param string $htmlname Name of select html field + * @param int $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @return void + */ + public function formSelectShippingMethod($page, $selected = '', $htmlname = 'shipping_method_id', $addempty = 0) + { + } + /** + * Creates HTML last in cycle situation invoices selector + * + * @param string $selected Preselected ID + * @param int $socid Company ID + * + * @return string HTML select + */ + public function selectSituationInvoices($selected = '', $socid = 0) + { + } + /** + * Creates HTML units selector (code => label) + * + * @param int|'' $selected Preselected Unit ID + * @param string $htmlname Select name + * @param int<0,1> $showempty Add an empty line + * @param string $unit_type Restrict to one given unit type + * @return string HTML select + */ + public function selectUnits($selected = '', $htmlname = 'units', $showempty = 0, $unit_type = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return a HTML select list of bank accounts + * + * @param int|'' $selected Id account preselected + * @param string $htmlname Name of select zone + * @param int $status Status of searched accounts (0=open, 1=closed, 2=both) + * @param string $filtre To filter the list. This parameter must not come from input of users + * @param int|string $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @param string $moreattrib To add more attribute on select + * @param int $showcurrency Show currency in label + * @param string $morecss More CSS + * @param int $nooutput 1=Return string, do not send to output + * @return int|string If noouput=0: Return integer <0 if error, Num of bank account found if OK (0, 1, 2, ...), If nooutput=1: Return a HTML select string. + */ + public function select_comptes($selected = '', $htmlname = 'accountid', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '', $showcurrency = 0, $morecss = '', $nooutput = 0) + { + } + /** + * Return a HTML select list of establishment + * + * @param string $selected Id establishment preselected + * @param string $htmlname Name of select zone + * @param int $status Status of searched establishment (0=open, 1=closed, 2=both) + * @param string $filtre To filter list. This parameter must not come from input of users + * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @param string $moreattrib To add more attribute on select + * @return int Return integer <0 if error, Num of establishment found if OK (0, 1, 2, ...) + */ + public function selectEstablishments($selected = '', $htmlname = 'entity', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '') + { + } + /** + * Display form to select bank account + * + * @param string $page Page + * @param string $selected Id of bank account + * @param string $htmlname Name of select html field + * @param int $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @return void + */ + public function formSelectAccount($page, $selected = '', $htmlname = 'fk_account', $addempty = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of categories having chosen type + * + * @param string|int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. + * @param string $selected Id of category preselected or 'auto' (autoselect category if there is only one element). Not used if $outputmode = 1. + * @param string $htmlname HTML field name + * @param int $maxlength Maximum length for labels + * @param int|string|array $fromid Keep only or Exclude (depending on $include parameter) all categories (including the leaf $fromid) into the tree after this id $fromid. + * $fromid can be an : + * - int (id of category) + * - string (categories ids separated by comma) + * - array (list of categories ids) + * @param int<0,3> $outputmode 0=HTML select string, 1=Array with full label only, 2=Array extended, 3=Array with full picto + label + * @param int<0,1> $include [=0] Removed or 1=Keep only + * @param string $morecss More CSS + * @param int<0,2> $useempty 0=No empty value, 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. Default is 1. + * @return string|array|array|array String list or Array of categories + * @see select_categories() + */ + public function select_all_categories($type, $selected = '', $htmlname = "parent", $maxlength = 64, $fromid = 0, $outputmode = 0, $include = 0, $morecss = '', $useempty = 1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show a confirmation HTML form or AJAX popup + * + * @param string $page Url of page to call if confirmation is OK + * @param string $title Title + * @param string $question Question + * @param string $action Action + * @param array{text:string}|array $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>'autofocus' or 'style=...')) + * @param string $selectedchoice "" or "no" or "yes" + * @param int|string $useajax 0=No, 1=Yes use Ajax to show the popup, 2=Yes and also submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx + * @param int $height Force height of box + * @param int $width Force width of box + * @return void + * @deprecated + * @see formconfirm() + */ + public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) + { + } + /** + * Show a confirmation HTML form or AJAX popup. + * Easiest way to use this is with useajax=1. + * If you use useajax='xxx', you must also add jquery code to trigger opening of box (with correct parameters) + * just after calling this method. For example: + * print ''."\n"; + * + * @param string $page Url of page to call if confirmation is OK. Can contains parameters (param 'action' and 'confirm' will be reformatted) + * @param string $title Title + * @param string $question Question + * @param string $action Action + * @param array}>|string|null $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>'autofocus' or 'style=...')) + * 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'datetime', 'select', 'multiselect', 'morecss', + * 'other', 'onecolumn' or 'hidden'... + * @param int<0,1>|''|'no'|'yes'|'1'|'0' $selectedchoice '' or 'no', or 'yes' or '1', 1, '0' or 0 + * @param int<0,2>|string $useajax 0=No, 1=Yes use Ajax to show the popup, 2=Yes and also submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx + * @param int|string $height Force height of box (0 = auto) + * @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones. + * @param int $disableformtag 1=Disable form tag. Can be used if we are already inside a
section. + * @param string $labelbuttonyes Label for Yes + * @param string $labelbuttonno Label for No + * @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form + */ + public function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 0, $width = 500, $disableformtag = 0, $labelbuttonyes = 'Yes', $labelbuttonno = 'No') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show a form to select a project + * + * @param int $page Page + * @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id) + * @param string $selected Id preselected project + * @param string $htmlname Name of select field + * @param int $discard_closed Discard closed projects (0=Keep,1=hide completely except $selected,2=Disable) + * @param int $maxlength Max length + * @param int $forcefocus Force focus on field (works with javascript only) + * @param int $nooutput No print is done. String is returned. + * @param string $textifnoproject Text to show if no project + * @param string $morecss More CSS + * @return string Return html content + */ + public function form_project($page, $socid, $selected = '', $htmlname = 'projectid', $discard_closed = 0, $maxlength = 20, $forcefocus = 0, $nooutput = 0, $textifnoproject = '', $morecss = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show a form to select payment conditions + * + * @param int $page Page + * @param string $selected Id condition pre-selectionne + * @param string $htmlname Name of select html field + * @param int $addempty Add empty entry + * @param string $type Type ('direct-debit' or 'bank-transfer') + * @param int $filtertype If > 0, include payment terms with deposit percentage (for objects other than invoices and invoice templates) + * @param int $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters) + * 0 : use default deposit percentage from entry + * > 0 : force deposit percentage (for example, from company object) + * @param int $nooutput No print is done. String is returned. + * @return string HTML output or '' + */ + public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '', $filtertype = -1, $deposit_percent = -1, $nooutput = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show a form to select a delivery delay + * + * @param int $page Page + * @param string $selected Id condition pre-selectionne + * @param string $htmlname Name of select html field + * @param int $addempty Add an empty entry + * @return void + */ + public function form_availability($page, $selected = '', $htmlname = 'availability', $addempty = 0) + { + } + /** + * Output HTML form to select list of input reason (events that triggered an object creation, like after sending an emailing, making an advert, ...) + * List found into table c_input_reason loaded by loadCacheInputReason + * + * @param string $page Page + * @param string $selected Id condition pre-selectionne + * @param string $htmlname Name of select html field + * @param int $addempty Add empty entry + * @return void + */ + public function formInputReason($page, $selected = '', $htmlname = 'demandreason', $addempty = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show a form + html select a date + * + * @param string $page Page + * @param string $selected Date preselected + * @param string $htmlname Html name of date input fields or 'none' + * @param int $displayhour Display hour selector + * @param int $displaymin Display minutes selector + * @param int $nooutput 1=No print output, return string + * @param string $type 'direct-debit' or 'bank-transfer' + * @return string + * @see selectDate() + */ + public function form_date($page, $selected, $htmlname, $displayhour = 0, $displaymin = 0, $nooutput = 0, $type = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show a select form to choose a user + * + * @param string $page Page + * @param string $selected Id of user preselected + * @param string $htmlname Name of input html field. If 'none', we just output the user link. + * @param int[] $exclude List of users id to exclude + * @param int[] $include List of users id to include + * @return void + */ + public function form_users($page, $selected = '', $htmlname = 'userid', $exclude = array(), $include = array()) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show form with payment mode + * + * @param string $page Page + * @param string $selected Id mode pre-selectionne + * @param string $htmlname Name of select html field + * @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz)) + * @param int $active Active or not, -1 = all + * @param int $addempty 1=Add empty entry + * @param string $type Type ('direct-debit' or 'bank-transfer') + * @param int $nooutput 1=Return string, no output + * @return string HTML output or '' + */ + public function form_modes_reglement($page, $selected = '', $htmlname = 'mode_reglement_id', $filtertype = '', $active = 1, $addempty = 0, $type = '', $nooutput = 0) + { + } + /** + * Show form with transport mode + * + * @param string $page Page + * @param string $selected Id mode pre-select + * @param string $htmlname Name of select html field + * @param int $active Active or not, -1 = all + * @param int $addempty 1=Add empty entry + * @return void + */ + public function formSelectTransportMode($page, $selected = '', $htmlname = 'transport_mode_id', $active = 1, $addempty = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show form with multicurrency code + * + * @param string $page Page + * @param string $selected code pre-selectionne + * @param string $htmlname Name of select html field + * @return void + */ + public function form_multicurrency_code($page, $selected = '', $htmlname = 'multicurrency_code') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show form with multicurrency rate + * + * @param string $page Page + * @param double $rate Current rate + * @param string $htmlname Name of select html field + * @param string $currency Currency code to explain the rate + * @return void + */ + public function form_multicurrency_rate($page, $rate = 0.0, $htmlname = 'multicurrency_tx', $currency = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show a select box with available absolute discounts + * + * @param string $page Page URL where form is shown + * @param int $selected Value preselected + * @param string $htmlname Name of SELECT component. If 'none', not changeable. Example 'remise_id'. + * @param int $socid Third party id + * @param float $amount Total amount available + * @param string $filter SQL filter on discounts + * @param int $maxvalue Max value for lines that can be selected + * @param string $more More string to add + * @param int $hidelist 1=Hide list + * @param int $discount_type 0 => customer discount, 1 => supplier discount + * @return void + */ + public function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter = '', $maxvalue = 0, $more = '', $hidelist = 0, $discount_type = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show forms to select a contact + * + * @param string $page Page + * @param Societe $societe Filter on third party + * @param string $selected Id contact pre-selectionne + * @param string $htmlname Name of HTML select. If 'none', we just show contact link. + * @return void + */ + public function form_contacts($page, $societe, $selected = '', $htmlname = 'contactid') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Output html select to select thirdparty + * + * @param string $page Page + * @param string $selected Id preselected + * @param string $htmlname Name of HTML select + * @param string $filter Optional filters criteras. WARNING: To avoid SQL injection, only few chars [.a-z0-9 =<>()] are allowed here (example: 's.rowid <> x', 's.client IN (1,3)'). Do not use a filter coming from input of users. + * @param string|int<0,1> $showempty Add an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty') + * @param int<0,1> $showtype Show third party type in combolist (customer, prospect or supplier) + * @param int<0,1> $forcecombo Force to use combo box + * @param array}> $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @param int $nooutput No print output. Return it only. + * @param int[] $excludeids Exclude IDs from the select combo + * @param string $textifnothirdparty Text to show if no thirdparty + * @return string HTML output or '' + */ + public function form_thirdparty($page, $selected = '', $htmlname = 'socid', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $events = array(), $nooutput = 0, $excludeids = array(), $textifnothirdparty = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Retourne la liste des devises, dans la langue de l'utilisateur + * + * @param string $selected preselected currency code + * @param string $htmlname name of HTML select list + * @deprecated + * @return void + */ + public function select_currency($selected = '', $htmlname = 'currency_id') + { + } + /** + * Retourne la liste des devises, dans la langue de l'utilisateur + * + * @param string $selected preselected currency code + * @param string $htmlname name of HTML select list + * @param int $mode 0 = Add currency symbol into label, 1 = Add 3 letter iso code + * @param string $useempty '1'=Allow empty value + * @return string + */ + public function selectCurrency($selected = '', $htmlname = 'currency_id', $mode = 0, $useempty = '') + { + } + /** + * Return array of currencies in user language + * + * @param string $selected Preselected currency code + * @param string $htmlname Name of HTML select list + * @param integer $useempty 1=Add empty line + * @param string $filter Optional filters criteras (example: 'code <> x', ' in (1,3)') + * @param bool $excludeConfCurrency false = If company current currency not in table, we add it into list. Should always be available. + * true = we are in currency_rate update , we don't want to see conf->currency in select + * @param string $morecss More css + * @return string HTML component + */ + public function selectMultiCurrency($selected = '', $htmlname = 'multicurrency_code', $useempty = 0, $filter = '', $excludeConfCurrency = \false, $morecss = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load into the cache ->cache_vatrates, all the vat rates of a country + * + * @param string $country_code Country code with quotes ("'CA'", or "'CA,IN,...'") + * @return int Nb of loaded lines, 0 if already loaded, <0 if KO + */ + public function load_cache_vatrates($country_code) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Output an HTML select vat rate. + * The name of this function should be selectVat. We keep bad name for compatibility purpose. + * + * @param string $htmlname Name of HTML select field + * @param float|string $selectedrate Force preselected vat rate. Can be '8.5' or '8.5 (NOO)' for example. Use '' for no forcing. + * @param Societe $societe_vendeuse Thirdparty seller + * @param Societe $societe_acheteuse Thirdparty buyer + * @param int $idprod Id product. O if unknown of NA. + * @param int $info_bits Miscellaneous information on line (1 for NPR) + * @param int|string $type ''=Unknown, 0=Product, 1=Service (Used if idprod not defined) + * If seller not subject to VAT, default VAT=0. End of rule. + * If (seller country==buyer country), then default VAT=product's VAT. End of rule. + * If (seller and buyer in EU) and sold product = new means of transportation (car, boat, airplane), default VAT =0 (VAT must be paid by the buyer to his country's tax office and not the seller). End of rule. + * If (seller and buyer in EU) and buyer=private person, then default VAT=VAT of sold product. End of rule. + * If (seller and buyer in EU) and buyer=company then default VAT =0. End of rule. + * Else, default proposed VAT==0. End of rule. + * @param bool $options_only Return HTML options lines only (for ajax treatment) + * @param int $mode 0=Use vat rate as key in combo list, 1=Add VAT code after vat rate into key, -1=Use id of vat line as key + * @param int $type_vat 0=All type, 1=VAT rate sale, 2=VAT rate purchase + * @return string + */ + public function load_tva($htmlname = 'tauxtva', $selectedrate = '', $societe_vendeuse = \null, $societe_acheteuse = \null, $idprod = 0, $info_bits = 0, $type = '', $options_only = \false, $mode = 0, $type_vat = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show a HTML widget to input a date or combo list for day, month, years and optionally hours and minutes. + * Fields are preselected with : + * - set_time date (must be a local PHP server timestamp or string date with format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM') + * - local date in user area, if set_time is '' (so if set_time is '', output may differs when done from two different location) + * - Empty (fields empty), if set_time is -1 (in this case, parameter empty must also have value 1) + * + * @param integer|string $set_time Pre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date with 00:00 hour (Parameter 'empty' must be 0 or 2). + * @param string $prefix Prefix for fields name + * @param int $h 1 or 2=Show also hours (2=hours on a new line), -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show hour always empty + * @param int $m 1=Show also minutes, -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show minutes always empty + * @param int $empty 0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only + * @param string $form_name Not used + * @param int $d 1=Show days, month, years + * @param int $addnowlink Add a link "Now" + * @param int $nooutput Do not output html string but return it + * @param int $disabled Disable input fields + * @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59 + * @param string $addplusone Add a link "+1 hour". Value must be name of another select_date field. + * @param int|string $adddateof Add a link "Date of invoice" using the following date. + * @return string '' or HTML component string if nooutput is 1 + * @deprecated + * @see selectDate(), form_date(), select_month(), select_year(), select_dayofweek() + */ + public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = 0, $addplusone = '', $adddateof = '') + { + } + /** + * Show 2 HTML widget to input a date or combo list for day, month, years and optionally hours and minutes. + * Fields are preselected with : + * - set_time date (must be a local PHP server timestamp or string date with format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM') + * - local date in user area, if set_time is '' (so if set_time is '', output may differs when done from two different location) + * - Empty (fields empty), if set_time is -1 (in this case, parameter empty must also have value 1) + * + * @param integer|string $set_time Pre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date with 00:00 hour (Parameter 'empty' must be 0 or 2). + * @param integer|string $set_time_end Pre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date with 00:00 hour (Parameter 'empty' must be 0 or 2). + * @param string $prefix Prefix for fields name + * @param int $empty 0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only + * @param int $forcenewline Force new line between the 2 dates. + * @return string Html for selectDate + * @see form_date(), select_month(), select_year(), select_dayofweek() + */ + public function selectDateToDate($set_time = '', $set_time_end = '', $prefix = 're', $empty = 0, $forcenewline = 0) + { + } + /** + * Show a HTML widget to input a date or combo list for day, month, years and optionally hours and minutes. + * Fields are preselected with : + * - set_time date (must be a local PHP server timestamp or string date with format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM') + * - local date in user area, if set_time is '' (so if set_time is '', output may differs when done from two different location) + * - Empty (fields empty), if set_time is -1 (in this case, parameter empty must also have value 1) + * + * @param integer|string $set_time Pre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date with 00:00 hour (Parameter 'empty' must be 0 or 2). + * @param string $prefix Prefix for fields name + * @param int $h 1 or 2=Show also hours (2=hours on a new line), -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 or 4 (4=hours on a new line)=Show hour always empty + * @param int $m 1=Show also minutes, -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show minutes always empty + * @param int $empty 0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only + * @param string $form_name Not used + * @param int<0,1> $d 1=Show days, month, years + * @param int<0,2> $addnowlink Add a link "Now", 1 with server time, 2 with local computer time + * @param int<0,1> $disabled Disable input fields + * @param int|string $fullday When a checkbox with id #fullday is checked, hours are set with 00:00 (if value if 'fulldaystart') or 23:59 (if value is 'fulldayend') + * @param string $addplusone Add a link "+1 hour". Value must be name of another selectDate field. + * @param int|string|array $adddateof Add a link "Date of ..." using the following date. Must be array(array('adddateof' => ..., 'labeladddateof' => ...)) + * @param string $openinghours Specify hour start and hour end for the select ex 8,20 + * @param int $stepminutes Specify step for minutes between 1 and 30 + * @param string $labeladddateof Label to use for the $adddateof parameter. Deprecated. Used only when $adddateof is not an array. + * @param string $placeholder Placeholder + * @param mixed $gm 'auto' (for backward compatibility, avoid this), 'gmt' or 'tzserver' or 'tzuserrel' + * @return string Html for selectDate + * @see form_date(), select_month(), select_year(), select_dayofweek() + */ + public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '', $openinghours = '', $stepminutes = 1, $labeladddateof = '', $placeholder = '', $gm = 'auto') + { + } + /** + * selectTypeDuration + * + * @param string $prefix Prefix + * @param string $selected Selected duration type + * @param string[] $excludetypes Array of duration types to exclude. Example array('y', 'm') + * @return string HTML select string + */ + public function selectTypeDuration($prefix, $selected = 'i', $excludetypes = array()) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Function to show a form to select a duration on a page + * + * @param string $prefix Prefix for input fields + * @param int|string $iSecond Default preselected duration (number of seconds or '') + * @param int $disabled Disable the combo box + * @param string $typehour If 'select' then input hour and input min is a combo, + * If 'text' input hour is in text and input min is a text, + * If 'textselect' input hour is in text and input min is a combo + * @param integer $minunderhours If 1, show minutes selection under the hours + * @param int $nooutput Do not output html string but return it + * @return string HTML component + */ + public function select_duration($prefix, $iSecond = '', $disabled = 0, $typehour = 'select', $minunderhours = 0, $nooutput = 0) + { + } + /** + * Return list of tickets in Ajax if Ajax activated or go to selectTicketsList + * + * @param string $selected Preselected tickets + * @param string $htmlname Name of HTML select field (must be unique in page). + * @param string $filtertype To add a filter + * @param int $limit Limit on number of returned lines + * @param int $status Ticket status + * @param string $selected_input_value Value of preselected input text (for use with ajax) + * @param int<0,3> $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) + * @param array $ajaxoptions Options for ajax_autocompleter + * @param int $socid Thirdparty Id (to get also price dedicated to this customer) + * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int<0,1> $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) + * @param int<0,1> $nooutput No print, return the output into a string + * @return string + */ + public function selectTickets($selected = '', $htmlname = 'ticketid', $filtertype = '', $limit = 0, $status = 1, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $selected_combinations = \null, $nooutput = 0) + { + } + /** + * Return list of tickets. + * Called by selectTickets. + * + * @param string $selected Preselected ticket + * @param string $htmlname Name of select html + * @param string $filtertype Filter on ticket type + * @param int $limit Limit on number of returned lines + * @param string $filterkey Filter on ticket ref or subject + * @param int $status Ticket status + * @param int $outputmode 0=HTML select string, 1=Array + * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @return array|string Array of keys for json or HTML component + */ + public function selectTicketsList($selected = '', $htmlname = 'ticketid', $filtertype = '', $limit = 20, $filterkey = '', $status = 1, $outputmode = 0, $showempty = '1', $forcecombo = 0, $morecss = '') + { + } + /** + * constructTicketListOption. + * This define value for &$opt and &$optJson. + * + * @param object $objp Result set of fetch + * @param string $opt Option (var used for returned value in string option format) + * @param mixed[] $optJson Option (var used for returned value in json format) + * @param string $selected Preselected value + * @param string $filterkey Filter key to highlight + * @return void + */ + protected function constructTicketListOption(&$objp, &$opt, &$optJson, $selected, $filterkey = '') + { + } + /** + * Return list of projects in Ajax if Ajax activated or go to selectTicketsList + * + * @param string $selected Preselected tickets + * @param string $htmlname Name of HTML select field (must be unique in page). + * @param string $filtertype To add a filter + * @param int $limit Limit on number of returned lines + * @param int $status Not used + * @param string $selected_input_value Value of preselected input text (for use with ajax) + * @param int<0,3> $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) + * @param array $ajaxoptions Options for ajax_autocompleter + * @param int $socid Thirdparty Id (to get also price dedicated to this customer) + * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int<0,1> $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) + * @param int<0,1> $nooutput No print, return the output into a string + * @return string + */ + public function selectProjects($selected = '', $htmlname = 'projectid', $filtertype = '', $limit = 0, $status = 1, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $selected_combinations = \null, $nooutput = 0) + { + } + /** + * Return list of projects. + * Called by selectProjects. + * + * @param string $selected Preselected project + * @param string $htmlname Name of select html + * @param string $filtertype Filter on project type + * @param int $limit Limit on number of returned lines + * @param string $filterkey Filter on project ref or subject + * @param int $status Not used + * @param int $outputmode 0=HTML select string, 1=Array + * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @return array|string Array of keys for json or HTML component + */ + public function selectProjectsList($selected = '', $htmlname = 'projectid', $filtertype = '', $limit = 20, $filterkey = '', $status = 1, $outputmode = 0, $showempty = '1', $forcecombo = 0, $morecss = '') + { + } + /** + * constructProjectListOption. + * This define value for &$opt and &$optJson. + * + * @param stdClass $objp Result set of fetch + * @param string $opt Option (var used for returned value in string option format) + * @param array{key:string,value:string,type:string} $optJson Option (var used for returned value in json format) + * @param string $selected Preselected value + * @param string $filterkey Filter key to highlight + * @return void + */ + protected function constructProjectListOption(&$objp, &$opt, &$optJson, $selected, $filterkey = '') + { + } + /** + * Return list of members in Ajax if Ajax activated or go to selectTicketsList + * + * @param string $selected Preselected tickets + * @param string $htmlname Name of HTML select field (must be unique in page). + * @param string $filtertype To add a filter + * @param int $limit Limit on number of returned lines + * @param int $status Ticket status + * @param string $selected_input_value Value of preselected input text (for use with ajax) + * @param int<0,3> $hidelabel Hide label (0=no, 1=yes, 2=show search icon before and placeholder, 3 search icon after) + * @param array $ajaxoptions Options for ajax_autocompleter + * @param int $socid Thirdparty Id (to get also price dedicated to this customer) + * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) + * @param int<0,1> $nooutput No print, return the output into a string + * @return string + */ + public function selectMembers($selected = '', $htmlname = 'adherentid', $filtertype = '', $limit = 0, $status = 1, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $selected_combinations = \null, $nooutput = 0) + { + } + /** + * Return list of adherents. + * Called by selectMembers. + * + * @param string $selected Preselected adherent + * @param string $htmlname Name of select html + * @param string $filtertype Filter on adherent type + * @param int $limit Limit on number of returned lines + * @param string $filterkey Filter on member status + * @param int $status Member status + * @param int $outputmode 0=HTML select string, 1=Array + * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @return array|string Array of keys for json or HTML string component + */ + public function selectMembersList($selected = '', $htmlname = 'adherentid', $filtertype = '', $limit = 20, $filterkey = '', $status = 1, $outputmode = 0, $showempty = '1', $forcecombo = 0, $morecss = '') + { + } + /** + * constructMemberListOption. + * This define value for &$opt and &$optJson. + * + * @param object $objp Result set of fetch + * @param string $opt Option (var used for returned value in string option format) + * @param mixed[] $optJson Option (var used for returned value in json format) + * @param string $selected Preselected value + * @param string $filterkey Filter key to highlight + * @return void + */ + protected function constructMemberListOption(&$objp, &$opt, &$optJson, $selected, $filterkey = '') + { + } + /** + * Generic method to select a component from a combo list. + * Can use autocomplete with ajax after x key pressed or a full combo, depending on setup. + * This is the generic method that will replace all specific existing methods. + * + * @param string $objectdesc 'ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]'. For hard coded custom needs. Try to prefer method using $objectfield instead of $objectdesc. + * @param string $htmlname Name of HTML select component + * @param int $preSelectedValue Preselected value (ID of element) + * @param string|int<0,1> $showempty ''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...) + * @param string $searchkey Search criteria + * @param string $placeholder Place holder + * @param string $morecss More CSS + * @param string $moreparams More params provided to ajax call + * @param int $forcecombo Force to load all values and output a standard combobox (with no beautification) + * @param int<0,1> $disabled 1=Html component is disabled + * @param string $selected_input_value Value of preselected input text (for use with ajax) + * @param string $objectfield Object:Field that contains the definition of parent (in table $fields or $extrafields). Example: 'Object:xxx' or 'Object@module:xxx' (old syntax 'Module_Object:xxx') or 'Object:options_xxx' or 'Object@module:options_xxx' (old syntax 'Module_Object:options_xxx') + * @return string Return HTML string + * @see selectForFormsList(), select_thirdparty_list() + */ + public function selectForForms($objectdesc, $htmlname, $preSelectedValue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $disabled = 0, $selected_input_value = '', $objectfield = '') + { + } + /** + * Output html form to select an object. + * Note, this function is called by selectForForms or by ajax selectobject.php + * + * @param Object $objecttmp Object to know the table to scan for combo. + * @param string $htmlname Name of HTML select component + * @param int $preselectedvalue Preselected value (ID of element) + * @param string|int<0,1> $showempty ''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...) + * @param string $searchkey Search value + * @param string $placeholder Place holder + * @param string $morecss More CSS + * @param string $moreparams More params provided to ajax call + * @param int $forcecombo Force to load all values and output a standard combobox (with no beautification) + * @param int $outputmode 0=HTML select string, 1=Array + * @param int $disabled 1=Html component is disabled + * @param string $sortfield Sort field + * @param string $filter Add more filter (Universal Search Filter) + * @return string|array Return HTML string + * @see selectForForms() + */ + public function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0, $disabled = 0, $sortfield = '', $filter = '') + { + } + /** + * Return a HTML select string, built from an array of key+value. + * Note: Do not apply langs->trans function on returned content, content may be entity encoded twice. + * + * @param string $htmlname Name of html select area. Try to start name with "multi" or "search_multi" if this is a multiselect + * @param array{label:string,data-html:string,disable?:int<0,1>,css?:string} $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...)) + * @param string|string[]|int $id Preselected key or array of preselected keys for multiselect. Use 'ifone' to autoselect record if there is only one record. + * @param int<0,1>|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (If 1: key is -1 and value is '' or ' ', If placeholder string: key is -1 and value is the string), <0 to add an empty value with key that is this value. + * @param int<0,1> $key_in_label 1 to show key into label with format "[key] value" + * @param int<0,1> $value_as_key 1 to use value as key + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container + * @param int<0,1> $translate 1=Translate and encode value + * @param int $maxlen Length maximum for labels + * @param int<0,1> $disabled Html select box is disabled + * @param string $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' or 'POS' = Do not sort, we keep original order + * @param string $morecss Add more class to css styles + * @param int $addjscombo Add js combo + * @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set + * @param int $disablebademail 1=Check if a not valid email, 2=Check string '---', and if found into value, disable and colorize entry + * @param int $nohtmlescape No html escaping (not recommended, use 'data-html' if you need to use label with HTML content). + * @return string HTML select string. + * @see multiselectarray(), selectArrayAjax(), selectArrayFilter() + */ + public static function selectarray($htmlname, $array, $id = '', $show_empty = 0, $key_in_label = 0, $value_as_key = 0, $moreparam = '', $translate = 0, $maxlen = 0, $disabled = 0, $sort = '', $morecss = 'minwidth75', $addjscombo = 1, $moreparamonempty = '', $disablebademail = 0, $nohtmlescape = 0) + { + } + /** + * Return a HTML select string, built from an array of key+value, but content returned into select come from an Ajax call of an URL. + * Note: Do not apply langs->trans function on returned content of Ajax service, content may be entity encoded twice. + * + * @param string $htmlname Name of html select area + * @param string $url Url. Must return a json_encode of array(key=>array('text'=>'A text', 'url'=>'An url'), ...) + * @param string $id Preselected key + * @param string $moreparam Add more parameters onto the select tag + * @param string $moreparamtourl Add more parameters onto the Ajax called URL + * @param int $disabled Html select box is disabled + * @param int $minimumInputLength Minimum Input Length + * @param string $morecss Add more class to css styles + * @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected. + * @param string $placeholder String to use as placeholder + * @param integer $acceptdelayedhtml 1 = caller is requesting to have html js content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect) + * @return string HTML select string + * @see selectArrayFilter(), ajax_combobox() in ajax.lib.php + */ + public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) + { + } + /** + * Return a HTML select string, built from an array of key+value, but content returned into select is defined into $array parameter. + * Note: Do not apply langs->trans function on returned content of Ajax service, content may be entity encoded twice. + * + * @param string $htmlname Name of html select area + * @param array $array Array (key=>array('text'=>'A text', 'url'=>'An url'), ...) + * @param string $id Preselected key + * @param string $moreparam Add more parameters onto the select tag + * @param int<0,1> $disableFiltering If set to 1, results are not filtered with searched string + * @param int<0,1> $disabled Html select box is disabled + * @param int $minimumInputLength Minimum Input Length + * @param string $morecss Add more class to css styles + * @param int<0,1> $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected. + * @param string $placeholder String to use as placeholder + * @param int<0,1> $acceptdelayedhtml 1 = caller is requesting to have html js content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect) + * @param string $textfortitle Text to show on title. + * @return string HTML select string + * @see selectArrayAjax(), ajax_combobox() in ajax.lib.php + */ + public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') + { + } + /** + * Show a multiselect form from an array. WARNING: Use this only for short lists. + * + * @param string $htmlname Name of select + * @param array $array Array(key=>value) or Array(key=>array('id'=>key, 'label'=>value, 'color'=> , 'picto'=> , 'labelhtml'=> )) + * @param string[] $selected Array of keys preselected + * @param int<0,1> $key_in_label 1 to show key like in "[key] value" + * @param int<0,1> $value_as_key 1 to use value as key + * @param string $morecss Add more css style + * @param int<0,1> $translate Translate and encode value + * @param int|string $width Force width of select box. May be used only when using jquery couch. Example: 250, '95%' + * @param string $moreattrib Add more options on select component. Example: 'disabled' + * @param string $elemtype Type of element we show ('category', ...). Will execute a formatting function on it. To use in readonly mode if js component support HTML formatting. + * @param string $placeholder String to use as placeholder + * @param int<-1,1> $addjscombo Add js combo + * @return string HTML multiselect string + * @see selectarray(), selectArrayAjax(), selectArrayFilter() + */ + public static function multiselectarray($htmlname, $array, $selected = array(), $key_in_label = 0, $value_as_key = 0, $morecss = '', $translate = 0, $width = 0, $moreattrib = '', $elemtype = '', $placeholder = '', $addjscombo = -1) + { + } + /** + * Show a multiselect dropbox from an array. + * If a saved selection of fields exists for user (into $user->conf->MAIN_SELECTEDFIELDS_contextofpage), we use this one instead of default. + * + * @param string $htmlname Name of HTML field + * @param array $array Array with array of fields we could show. This array may be modified according to setup of user. + * @param string $varpage Id of context for page. Can be set by caller with $varpage=(empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage); + * @param string $pos Position colon on liste value 'left' or '' (meaning 'right'). + * @return string HTML multiselect string + * @see selectarray() + */ + public static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage, $pos = '') + { + } + /** + * Render list of categories linked to object with id $id and type $type + * + * @param int $id Id of object + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact'). Old mode (0, 1, 2, ...) is deprecated. + * @param int<0,1> $rendermode 0=Default, use multiselect. 1=Emulate multiselect (recommended) + * @param int<0,1> $nolink 1=Do not add html links + * @return string String with categories + */ + public function showCategories($id, $type, $rendermode = 0, $nolink = 0) + { + } + /** + * Show linked object block. + * + * @param CommonObject $object Object we want to show links to + * @param string $morehtmlright More html to show on right of title + * @param array $compatibleImportElementsList Array of compatibles elements object for "import from" action + * @param string $title Title + * @return int Return Number of different types + */ + public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleImportElementsList = array(), $title = 'RelatedObjects') + { + } + /** + * Show block with links to link to other objects. + * + * @param CommonObject $object Object we want to show links to + * @param string[] $restrictlinksto Restrict links to some elements, for example array('order') or array('supplier_order'). null or array() if no restriction. + * @param string[] $excludelinksto Do not show links of this type, for example array('order') or array('supplier_order'). null or array() if no exclusion. + * @return string HTML block + */ + public function showLinkToObjectBlock($object, $restrictlinksto = array(), $excludelinksto = array()) + { + } + /** + * Return an html string with a select combo box to choose yes or no + * + * @param string $htmlname Name of html select field + * @param string $value Pre-selected value + * @param int $option 0 return yes/no, 1 return 1/0 + * @param bool $disabled true or false + * @param int $useempty 1=Add empty line + * @param int $addjscombo 1=Add js beautifier on combo box + * @param string $morecss More CSS + * @param string $labelyes Label for Yes + * @param string $labelno Label for No + * @return string See option + */ + public function selectyesno($htmlname, $value = '', $option = 0, $disabled = \false, $useempty = 0, $addjscombo = 0, $morecss = 'width75', $labelyes = 'Yes', $labelno = 'No') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of export templates + * + * @param string $selected Id modele pre-selectionne + * @param string $htmlname Name of HTML select + * @param string $type Type of searched templates + * @param int $useempty Affiche valeur vide dans liste + * @return void + */ + public function select_export_model($selected = '', $htmlname = 'exportmodelid', $type = '', $useempty = 0) + { + } + /** + * Return a HTML area with the reference of object and a navigation bar for a business object + * Note: To complete search with a particular filter on select, you can set $object->next_prev_filter set to define SQL criteria. + * + * @param CommonObject $object Object to show. + * @param string $paramid Name of parameter to use to name the id into the URL next/previous link. + * @param string $morehtml More html content to output just before the nav bar. + * @param int<0,1> $shownav Show Condition (navigation is shown if value is 1). + * @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field compared to $object->ref). Use 'none' to disable next/prev. + * @param string $fieldref Name of field ref of object (object->ref) to show or 'none' to not show ref. + * @param string $morehtmlref More html to show after ref. + * @param string $moreparam More param to add in nav link url. Must start with '&...'. + * @param int<0,1> $nodbprefix Do not include DB prefix to forge table name. + * @param string $morehtmlleft More html code to show before ref. + * @param string $morehtmlstatus More html code to show under navigation arrows (status place). + * @param string $morehtmlright More html code to show after ref. + * @return string Portion HTML with ref + navigation buttons + */ + public function showrefnav($object, $paramid, $morehtml = '', $shownav = 1, $fieldid = 'rowid', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlstatus = '', $morehtmlright = '') + { + } + /** + * Return HTML code to output a barcode + * + * @param CommonObject $object Object containing data to retrieve file name + * @param int $width Width of photo + * @param string $morecss More CSS on img of barcode + * @return string HTML code to output barcode + */ + public function showbarcode(&$object, $width = 100, $morecss = '') + { + } + /** + * Return HTML code to output a photo + * + * @param string $modulepart Key to define module concerned ('societe', 'userphoto', 'memberphoto') + * @param Societe|Adherent|Contact|User|CommonObject $object Object containing data to retrieve file name + * @param int $width Width of photo + * @param int $height Height of photo (auto if 0) + * @param int<0,1> $caneditfield Add edit fields + * @param string $cssclass CSS name to use on img for photo + * @param string $imagesize 'mini', 'small' or '' (original) + * @param int<0,1> $addlinktofullsize Add link to fullsize image + * @param int<0,1> $cache 1=Accept to use image in cache + * @param string $forcecapture '', 'user' or 'environment'. Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if ''. + * @param int<0,1> $noexternsourceoverwrite No overwrite image with extern source (like 'gravatar' or other module) + * @return string HTML code to output photo + * @see getImagePublicURLOfObject() + */ + public static function showphoto($modulepart, $object, $width = 100, $height = 0, $caneditfield = 0, $cssclass = 'photowithmargin', $imagesize = '', $addlinktofullsize = 1, $cache = 0, $forcecapture = '', $noexternsourceoverwrite = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return select list of groups + * + * @param int|object|object[] $selected Id group or group(s) preselected + * @param string $htmlname Field name in form + * @param int<0,1> $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue + * @param string|int[] $exclude Array list of groups id to exclude + * @param int<0,1> $disabled If select list must be disabled + * @param string|int[] $include Array list of groups id to include + * @param int[] $enableonly Array list of groups id to be enabled. All other must be disabled + * @param string $force_entity '0' or Ids of environment to force + * @param bool $multiple add [] in the name of element and add 'multiple' attribute (not working with ajax_autocompleter) + * @param string $morecss More css to add to html component + * @return string HTML Componont to select a group + * @see select_dolusers() + */ + public function select_dolgroups($selected = 0, $htmlname = 'groupid', $show_empty = 0, $exclude = '', $disabled = 0, $include = '', $enableonly = array(), $force_entity = '0', $multiple = \false, $morecss = 'minwidth200') + { + } + /** + * Return HTML to show the search and clear search button + * + * @param string $pos Position of colon on the list. Value 'left' or 'right' + * @return string + */ + public function showFilterButtons($pos = '') + { + } + /** + * Return HTML to show the search and clear search button + * + * @param string $cssclass CSS class + * @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes + * @param string $massactionname Mass action button name that will launch an action on the selected items + * @return string + */ + public function showCheckAddButtons($cssclass = 'checkforaction', $calljsfunction = 0, $massactionname = "massaction") + { + } + /** + * Return HTML to show the search and clear search button + * + * @param int $addcheckuncheckall Add the check all/uncheck all checkbox (use javascript) and code to manage this + * @param string $cssclass CSS class + * @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes + * @param string $massactionname Mass action name + * @return string + */ + public function showFilterAndCheckAddButtons($addcheckuncheckall = 0, $cssclass = 'checkforaction', $calljsfunction = 0, $massactionname = "massaction") + { + } + /** + * Return HTML to show the select of expense categories + * + * @param string $selected preselected category + * @param string $htmlname name of HTML select list + * @param int<0,1> $useempty 1=Add empty line + * @param int[] $excludeid id to exclude + * @param string $target htmlname of target select to bind event + * @param int $default_selected default category to select if fk_c_type_fees change = EX_KME + * @param array $params param to give + * @param int<0,1> $info_admin Show the tooltip help picto to setup list + * @return string + */ + public function selectExpenseCategories($selected = '', $htmlname = 'fk_c_exp_tax_cat', $useempty = 0, $excludeid = array(), $target = '', $default_selected = 0, $params = array(), $info_admin = 1) + { + } + /** + * Return HTML to show the select ranges of expense range + * + * @param string $selected preselected category + * @param string $htmlname name of HTML select list + * @param integer $useempty 1=Add empty line + * @return string + */ + public function selectExpenseRanges($selected = '', $htmlname = 'fk_range', $useempty = 0) + { + } + /** + * Return HTML to show a select of expense + * + * @param string $selected preselected category + * @param string $htmlname name of HTML select list + * @param integer $useempty 1=Add empty choice + * @param integer $allchoice 1=Add all choice + * @param integer $useid 0=use 'code' as key, 1=use 'id' as key + * @return string + */ + public function selectExpense($selected = '', $htmlname = 'fk_c_type_fees', $useempty = 0, $allchoice = 1, $useid = 0) + { + } + /** + * Output a combo list with invoices qualified for a third party + * + * @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id) + * @param string $selected Id invoice preselected + * @param string $htmlname Name of HTML select + * @param int $maxlength Maximum length of label + * @param int $option_only Return only html options lines without the select tag + * @param string $show_empty Add an empty line ('1' or string to show for empty line) + * @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable) + * @param int $forcefocus Force focus on field (works with javascript only) + * @param int $disabled Disabled + * @param string $morecss More css added to the select component + * @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids. + * @param string $showproject 'all' = Show project info, ''=Hide project info + * @param User $usertofilter User object to use for filtering + * @return string HTML Select Invoice + */ + public function selectInvoice($socid = -1, $selected = '', $htmlname = 'invoiceid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = \null) + { + } + /** + * Output a combo list with invoices qualified for a third party + * + * @param string $selected Id invoice preselected + * @param string $htmlname Name of HTML select + * @param int $maxlength Maximum length of label + * @param int $option_only Return only html options lines without the select tag + * @param string $show_empty Add an empty line ('1' or string to show for empty line) + * @param int $forcefocus Force focus on field (works with javascript only) + * @param int $disabled Disabled + * @param string $morecss More css added to the select component + * @return int Nbr of project if OK, <0 if KO + */ + public function selectInvoiceRec($selected = '', $htmlname = 'facrecid', $maxlength = 24, $option_only = 0, $show_empty = '1', $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500') + { + } + /** + * Output the component to make advanced search criteries + * + * @param array> $arrayofcriterias Array of available search criteria. Example: array($object->element => $object->fields, 'otherfamily' => otherarrayoffields, ...) + * @param array $search_component_params Array of selected search criteria + * @param string[] $arrayofinputfieldsalreadyoutput Array of input fields already inform. The component will not generate a hidden input field if it is in this list. + * @param string $search_component_params_hidden String with $search_component_params criteria + * @return string HTML component for advanced search + */ + public function searchComponent($arrayofcriterias, $search_component_params, $arrayofinputfieldsalreadyoutput = array(), $search_component_params_hidden = '') + { + } + /** + * selectModelMail + * + * @param string $prefix Prefix + * @param string $modelType Model type + * @param int<0,1> $default 1=Show also Default mail template + * @param int<0,1> $addjscombo Add js combobox + * @return string HTML select string + */ + public function selectModelMail($prefix, $modelType = '', $default = 0, $addjscombo = 0) + { + } + /** + * Output the buttons to submit a creation/edit form + * + * @param string $save_label Alternative label for save button + * @param string $cancel_label Alternative label for cancel button + * @param array $morebuttons Add additional buttons between save and cancel + * @param bool $withoutdiv Option to remove enclosing centered div + * @param string $morecss More CSS + * @param string $dol_openinpopup If the button are shown in a context of a page shown inside a popup, we put here the string name of popup. + * @return string Html code with the buttons + */ + public function buttonsSaveCancel($save_label = 'Save', $cancel_label = 'Cancel', $morebuttons = array(), $withoutdiv = \false, $morecss = '', $dol_openinpopup = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load into cache list of invoice subtypes + * + * @return int Nb of lines loaded, <0 if KO + */ + public function load_cache_invoice_subtype() + { + } + /** + * Return list of invoice subtypes. + * + * @param int $selected Id of invoice subtype to preselect by default + * @param string $htmlname Select field name + * @param int<0,1> $addempty Add an empty entry + * @param int<0,1> $noinfoadmin 0=Add admin info, 1=Disable admin info + * @param string $morecss Add more CSS on select tag + * @return string String for the HTML select component + */ + public function getSelectInvoiceSubtype($selected = 0, $htmlname = 'subtypeid', $addempty = 0, $noinfoadmin = 0, $morecss = '') + { + } + } + /* Copyright (C) 2014 Florian Henry + * Copyright (C) 2019 Frédéric France + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file comm/mailing/class/html.formadvtargetemailing.class.php + * \ingroup mailing + * \brief File for the class with functions for the building of HTML components for advtargetemailing + */ + /** + * Class to manage building of HTML components + */ + class FormAdvTargetEmailing extends \Form + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * Constructor + * + * @param DoliDB $db handler + */ + public function __construct($db) + { + } + /** + * Affiche un champs select contenant une liste + * + * @param array $selected_array à preselectionner + * @param string $htmlname select field + * @return string select field + */ + public function multiselectProspectionStatus($selected_array = array(), $htmlname = 'cust_prospect_status') + { + } + /** + * Return combo list of activated countries, into language of user + * + * @param string $htmlname of html select object + * @param array $selected_array or Code or Label of preselected country + * @return string HTML string with select + */ + public function multiselectState($htmlname = 'state_id', $selected_array = array()) + { + } + /** + * Return combo list of activated countries, into language of user + * + * @param string $htmlname of html select object + * @param array $selected_array or Code or Label of preselected country + * @return string HTML string with select + */ + public function multiselectCountry($htmlname = 'country_id', $selected_array = array()) + { + } + /** + * Return select list for categories (to use in form search selectors) + * + * @param string $htmlname control name + * @param array $selected_array array of data + * @param User $user User action + * @return string combo list code + */ + public function multiselectselectSalesRepresentatives($htmlname, $selected_array, $user) + { + } + /** + * Return select list for categories (to use in form search selectors) + * + * @param string $htmlname of combo list (example: 'search_sale') + * @param array $selected_array selected array + * @return string combo list code + */ + public function multiselectselectLanguage($htmlname = '', $selected_array = array()) + { + } + /** + * Return multiselect list of entities for extrafield type sellist + * + * @param string $htmlname control name + * @param array $sqlqueryparam array + * @param string[] $selected_array array + * + * @return string HTML combo + */ + public function advMultiselectarraySelllist($htmlname, $sqlqueryparam = array(), $selected_array = array()) + { + } + /** + * Return combo list with people title + * + * @param string $htmlname Name of HTML select combo field + * @param array $selected_array Array + * @return string HTML combo + */ + public function multiselectCivility($htmlname = 'civilite_id', $selected_array = array()) + { + } + /** + * Return multiselect list of entities. + * + * @param string $htmlname select + * @param array $options_array to manage + * @param array $selected_array to manage + * @param int $showempty show empty + * @return string HTML combo + */ + public function advMultiselectarray($htmlname, $options_array = array(), $selected_array = array(), $showempty = 0) + { + } + /** + * Return a combo list to select emailing target selector + * + * @param string $htmlname control name + * @param integer $selected default selected + * @param integer $showempty empty lines + * @param string $type_element Type element. Example: 'mailing' + * @param string $morecss More CSS + * @return string HTML combo + */ + public function selectAdvtargetemailingTemplate($htmlname = 'template_id', $selected = 0, $showempty = 0, $type_element = 'mailing', $morecss = '') + { + } + } + /** + * Class to manage emailings module + */ + class Mailing extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'mailing'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'mailing'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'email'; + /** + * @var string Type of message ('email', 'sms') + */ + public $messtype; + /** + * @var string title + */ + public $title; + /** + * @var string subject + */ + public $sujet; + /** + * @var string body + */ + public $body; + /** + * @var int 1=Email will be sent even to email that has opt-out + */ + public $evenunsubscribe; + /** + * @var int number of email + */ + public $nbemail; + /** + * @var string background color + */ + public $bgcolor; + /** + * @var string background image + */ + public $bgimage; + /** + * @var int status + * @deprecated + */ + public $statut; + // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely + /** + * @var int status + */ + public $status; + // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely + /** + * @var string email from + */ + public $email_from; + /** + * @var string email to + */ + public $sendto; + /** + * @var string email reply to + */ + public $email_replyto; + /** + * @var string email errors to + */ + public $email_errorsto; + /** + * @var string first joined file + */ + public $joined_file1; + /** + * @var string second joined file + */ + public $joined_file2; + /** + * @var string third joined file + */ + public $joined_file3; + /** + * @var string fourth joined file + */ + public $joined_file4; + /** + * @var int|null date sending + */ + public $date_envoi; + /** + * @var array (Encoded as JSON in database) + */ + public $extraparams = array(); + /** + * @var array statut dest + */ + public $statut_dest = array(); + /** + * @var array substitutionarray + */ + public $substitutionarray; + /** + * @var array substitutionarrayfortest + */ + public $substitutionarrayfortest; + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_SENTPARTIALY = 2; + const STATUS_SENTCOMPLETELY = 3; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create an EMailing + * + * @param User $user Object of user making creation + * @param int $notrigger Disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Update emailing record + * + * @param User $user Object of user making change + * @param int $notrigger Disable triggers + * @return int Return integer < 0 if KO, > 0 if OK + */ + public function update($user, $notrigger = 0) + { + } + /** + * Get object from database + * + * @param int $rowid Id of emailing + * @param string $ref Title to search from title + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($rowid, $ref = '') + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $user User making the clone + * @param int $fromid Id of object to clone + * @param int $option1 1=Clone content, 0=Forget content + * @param int $option2 1=Clone recipients + * @return int New id of clone + */ + public function createFromClone(\User $user, $fromid, $option1, $option2) + { + } + /** + * Validate emailing + * + * @param User $user Object user qui valide + * @return int Return integer <0 if KO, >0 if OK + */ + public function valid($user) + { + } + /** + * Delete emailing + * + * @param User $user User that delete + * @param int $notrigger Disable triggers + * @return int >0 if OK, <0 if KO + */ + public function delete($user, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Delete targets emailing + * + * @return int 1 if OK, 0 if error + */ + public function delete_targets() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Change status of each recipient + * + * @param User $user Object user qui valide + * @return int Return integer <0 if KO, >0 if OK + */ + public function reset_targets_status($user) + { + } + /** + * Reset status of a specific recipient in error + * + * @param User $user Object user qui valide + * @param int $id Recipient id to reset + * @return int Return integer <0 if KO, >0 if OK + */ + public function resetTargetErrorStatus($user, $id) + { + } + /** + * Count number of target with status + * + * @param string $mode Mode ('alreadysent' = Sent success or error, 'alreadysentok' = Sent success, 'alreadysentko' = Sent error) + * @return int Nb of target with status + */ + public function countNbOfTargets($mode) + { + } + /** + * Refresh denormalized value ->nbemail into emailing record + * Note: There is also the method update_nb into modules_mailings that is used for this. + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function refreshNbOfTargets() + { + } + /** + * getTooltipContentArray + * + * @param array $params ex option, infologin + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Return label of status of emailing (draft, validated, ...) + * + * @param int $mode 0=Long label, 1=Short label, 2=Picto+Short label, 3=Picto, 4=Picto+Short label, 5=Short label+Picto, 6=Picto+Long label, 7=Very short label+Picto + * @return string Label + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=Long label, 1=Short label, 2=Picto+Short label, 3=Picto, 4=Picto+Short label, 5=Short label+Picto, 6=Picto+Long label, 7=Very short label+Picto + * @return string Label + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Return the label of a given status of a recipient + * TODO Add class mailin_target.class.php + * + * @param int $status Id status + * @param int $mode 0=Long label, 1=Short label, 2=Picto+Short label, 3=Picto, 4=Picto+Short label, 5=Short label+Picto, 6=Picto+Long label, 7=Very short label+Picto + * @param string $desc Description of error to show as tooltip + * @return string Label + */ + public static function libStatutDest($status, $mode = 0, $desc = '') + { + } + } + /** + * API class for orders + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ + class Proposals extends \DolibarrApi + { + /** + * @var array $FIELDS Mandatory fields, checked when create and update object + */ + public static $FIELDS = array('socid'); + /** + * @var Propal $propal {@type Propal} + */ + public $propal; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get properties of a commercial proposal object + * + * Return an array with commercial proposal information + * + * @param int $id ID of commercial proposal + * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id + * @return Object Object with cleaned properties + * + * @throws RestException + */ + public function get($id, $contact_list = 1) + { + } + /** + * Get properties of an proposal object by ref + * + * Return an array with proposal information + * + * @param string $ref Ref of object + * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id + * @return Object Object with cleaned properties + * + * @url GET ref/{ref} + * + * @throws RestException + */ + public function getByRef($ref, $contact_list = 1) + { + } + /** + * Get properties of an proposal object by ref_ext + * + * Return an array with proposal information + * + * @param string $ref_ext External reference of object + * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id + * @return Object Object with cleaned properties + * + * @url GET ref_ext/{ref_ext} + * + * @throws RestException + */ + public function getByRefExt($ref_ext, $contact_list = 1) + { + } + /** + * List commercial proposals + * + * Get a list of commercial proposals + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $thirdparty_ids Thirdparty ids to filter commercial proposals (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'2016-01-01')" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* + * @return array Array of order objects + */ + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '', $pagination_data = \false) + { + } + /** + * Create commercial proposal object + * + * @param array $request_data Request data + * @return int ID of proposal + */ + public function post($request_data = \null) + { + } + /** + * Get lines of a commercial proposal + * + * @param int $id Id of commercial proposal + * @param string $sqlfilters Other criteria to filter answers separated by a comma. d is the alias for proposal lines table, p is the alias for product table. "Syntax example "(p.ref:like:'SO-%') AND (d.date_start:<:'20220101')" + * + * @url GET {id}/lines + * + * @return array + */ + public function getLines($id, $sqlfilters = '') + { + } + /** + * Add a line to given commercial proposal + * + * @param int $id Id of commercial proposal to update + * @param array $request_data Commercial proposal line data + * + * @url POST {id}/line + * + * @return int + */ + public function postLine($id, $request_data = \null) + { + } + /** + * Add lines to given commercial proposal + * + * @param int $id Id of commercial proposal to update + * @param array $request_data Commercial proposal line data + * + * @url POST {id}/lines + * + * @return int + */ + public function postLines($id, $request_data = \null) + { + } + /** + * Update a line of given commercial proposal + * + * @param int $id Id of commercial proposal to update + * @param int $lineid Id of line to update + * @param array $request_data Commercial proposal line data + * @return Object|false Object with cleaned properties + * + * @url PUT {id}/lines/{lineid} + */ + public function putLine($id, $lineid, $request_data = \null) + { + } + /** + * Delete a line of given commercial proposal + * + * + * @param int $id Id of commercial proposal to update + * @param int $lineid Id of line to delete + * @return Object|false Object with cleaned properties + * + * @url DELETE {id}/lines/{lineid} + * + * @throws RestException 401 + * @throws RestException 404 + */ + public function deleteLine($id, $lineid) + { + } + /** + * Add a contact type of given commercial proposal + * + * @param int $id Id of commercial proposal to update + * @param int $contactid Id of external or internal contact to add + * @param string $type Type of the external contact (BILLING, SHIPPING, CUSTOMER), internal contact (SALESREPFOLL) + * @param string $source Source of the contact (internal, external) + * @return array + * + * @url POST {id}/contact/{contactid}/{type}/{source} + * + * @throws RestException 401 + * @throws RestException 404 + */ + public function postContact($id, $contactid, $type, $source = 'external') + { + } + /** + * Delete a contact type of given commercial proposal + * + * @param int $id Id of commercial proposal to update + * @param int $contactid Row key of the contact in the array contact_ids. + * @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER). + * @return Object Object with cleaned properties + * + * @url DELETE {id}/contact/{contactid}/{type} + * + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 500 System error + */ + public function deleteContact($id, $contactid, $type) + { + } + /** + * Update commercial proposal general fields (won't touch lines of commercial proposal) + * + * @param int $id Id of commercial proposal to update + * @param array $request_data Datas + * @return Object Object with cleaned properties + */ + public function put($id, $request_data = \null) + { + } + /** + * Delete commercial proposal + * + * @param int $id Commercial proposal ID + * @return array + */ + public function delete($id) + { + } + /** + * Set a proposal to draft + * + * @param int $id Order ID + * @return Object Object with cleaned properties + * + * @url POST {id}/settodraft + */ + public function settodraft($id) + { + } + /** + * Validate a commercial proposal + * + * If you get a bad value for param notrigger check that ou provide this in body + * { + * "notrigger": 0 + * } + * + * @param int $id Commercial proposal ID + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return Object Object with cleaned properties + * + * @url POST {id}/validate + * + * @throws RestException 304 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 500 System error + */ + public function validate($id, $notrigger = 0) + { + } + /** + * Close (Accept or refuse) a quote / commercial proposal + * + * @param int $id Commercial proposal ID + * @param int $status Must be 2 (accepted) or 3 (refused) {@min 2}{@max 3} + * @param string $note_private Add this mention at end of private note + * @param int $notrigger Disabled triggers + * @param string $note_public Add this mention at end of public note + * @return Object Object with cleaned properties + * + * @url POST {id}/close + */ + public function close($id, $status, $note_private = '', $notrigger = 0, $note_public = '') + { + } + /** + * Set a commercial proposal billed. Could be also called setbilled + * + * @param int $id Commercial proposal ID + * @return Object Object with cleaned properties + * + * @url POST {id}/setinvoiced + */ + public function setinvoiced($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensible object datas + * + * @param Object $object Object to clean + * @return Object Object with cleaned properties + */ + protected function _cleanObjectDatas($object) + { + } + } + /* Copyright (C) 2012 Regis Houssin + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/core/class/commonincoterm.class.php + * \ingroup core + * \brief File of the superclass of object classes that support incoterm (customer and supplier) + */ + /** + * Trait for incoterm classes + * + * Properties expected on the host class: + * + * @property DoliDB $db + * @property int $id + * @property string[] $errors + * @property string $table_element + * + */ + trait CommonIncoterm + { + /** + * @var int ID incoterm. + * @see setIncoterms() + */ + public $fk_incoterms; + /** + * @var string Label of incoterm. Used for tooltip. + * @see SetIncoterms() + */ + public $label_incoterms; + /** + * @var string Location of incoterm. + * @see display_incoterms() + */ + public $location_incoterms; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return incoterms information + * TODO Use a cache for label get + * + * @return string incoterms info + */ + public function display_incoterms() + { + } + /** + * Return incoterms information for pdf display + * + * @return string|boolean Incoterms info or false + */ + public function getIncotermsForPDF() + { + } + /** + * Define incoterms values of current object + * + * @param int $id_incoterm Id of incoterm to set or '' to remove + * @param string $location location of incoterm + * @return int Return integer <0 if KO, >0 if OK + */ + public function setIncoterms($id_incoterm, $location) + { + } + } + /** + * Class to manage proposals + */ + class Propal extends \CommonObject + { + use \CommonIncoterm; + /** + * @var string code + */ + public $code = ""; + /** + * @var string ID to identify managed object + */ + public $element = 'propal'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'propal'; + /** + * @var string Name of subtable line + */ + public $table_element_line = 'propaldet'; + /** + * @var string Fieldname with ID of parent key if this field has a parent + */ + public $fk_element = 'fk_propal'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'propal'; + /** + * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user + * @var integer + */ + public $restrictiononfksoc = 1; + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + /** + * ID of the client + * @var int + */ + public $socid; + /** + * ID of the contact + * @var int + */ + public $contactid; + public $author; + /** + * Ref from thirdparty + * @var string + * @deprecated + * @see $ref_customer + */ + public $ref_client; + /** + * Ref from thirdparty + * @var string + */ + public $ref_customer; + /** + * @var static oldcopy with propal properties + */ + public $oldcopy; + /** + * Status of the quote + * @var int + * @deprecated Try to use $status now + * @see Propal::STATUS_DRAFT, Propal::STATUS_VALIDATED, Propal::STATUS_SIGNED, Propal::STATUS_NOTSIGNED, Propal::STATUS_BILLED, Propal::STATUS_CANCELED + */ + public $statut; + /** + * Status of the quote + * @var int + * @see Propal::STATUS_DRAFT, Propal::STATUS_VALIDATED, Propal::STATUS_SIGNED, Propal::STATUS_NOTSIGNED, Propal::STATUS_BILLED, Propal::STATUS_CANCELED + */ + public $status; + /** + * @deprecated + * @see $date_creation + */ + public $datec; + /** + * @deprecated + * @see $date_validation + */ + public $datev; + /** + * @var integer|'' $date_validation; + */ + public $date_validation; + /** + * @var integer|'' $date_signature; + */ + public $date_signature; + /** + * @var User $user_signature + */ + public $user_signature; + /** + * @var integer|'' date of the quote; + */ + public $date; + /** + * @deprecated + * @see $date + */ + public $datep; + /** + * @var null|int|'' $delivery_date; + */ + public $delivery_date; + // Date expected of shipment (date starting shipment, not the reception that occurs some days after) + /** + * @var integer|'' end of validity + */ + public $fin_validite; + /** + * @var int ID of user author + */ + public $user_author_id; + /** + * @deprecated + * @see $total_ht + */ + public $price; + /** + * @deprecated + * @see $total_tva + */ + public $tva; + /** + * @deprecated + * @see $total_ttc + */ + public $total; + public $cond_reglement_code; + // code + public $cond_reglement; + // label + public $cond_reglement_doc; + // label doc + public $mode_reglement_code; + // code + public $mode_reglement; + // label + public $deposit_percent; + /** + * @var int ID + * @deprecated + */ + public $fk_address; + public $address_type; + public $address; + /** + * @var int availability ID + */ + public $availability_id; + /** + * @var int availability ID + * @deprecated + * @see $availability_id + */ + public $fk_availability; + /** + * @var string availability code + */ + public $availability_code; + /** + * @var string availability label + */ + public $availability; + public $duree_validite; + /** + * @var int ID demand reason + */ + public $demand_reason_id; + /** + * @var string ID demand reason code + */ + public $demand_reason_code; + /** + * @var string ID demand reason label + */ + public $demand_reason; + /** + * @var int ID of warehouse + */ + public $warehouse_id; + /** + * @var PropaleLigne[] + */ + public $lines = array(); + /** + * @var PropaleLigne + */ + public $line; + public $labelStatus = array(); + public $labelStatusShort = array(); + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array( + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), + 'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 20), + 'ref_client' => array('type' => 'varchar(255)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => -1, 'position' => 22), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 40), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'position' => 23), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Fk projet', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 24), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 25), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 55), + 'datep' => array('type' => 'date', 'label' => 'Date', 'enabled' => 1, 'visible' => -1, 'position' => 60), + 'fin_validite' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => -1, 'position' => 65), + 'date_valid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 70), + 'date_cloture' => array('type' => 'datetime', 'label' => 'DateClosing', 'enabled' => 1, 'visible' => -1, 'position' => 75), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 85), + 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'fk_user_cloture' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user cloture', 'enabled' => 1, 'visible' => -1, 'position' => 95), + 'price' => array('type' => 'double', 'label' => 'Price', 'enabled' => 1, 'visible' => -1, 'position' => 105), + 'total_ht' => array('type' => 'double(24,8)', 'label' => 'TotalHT', 'enabled' => 1, 'visible' => -1, 'position' => 125, 'isameasure' => 1), + 'total_tva' => array('type' => 'double(24,8)', 'label' => 'VAT', 'enabled' => 1, 'visible' => -1, 'position' => 130, 'isameasure' => 1), + 'localtax1' => array('type' => 'double(24,8)', 'label' => 'LocalTax1', 'enabled' => 1, 'visible' => -1, 'position' => 135, 'isameasure' => 1), + 'localtax2' => array('type' => 'double(24,8)', 'label' => 'LocalTax2', 'enabled' => 1, 'visible' => -1, 'position' => 140, 'isameasure' => 1), + 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'TotalTTC', 'enabled' => 1, 'visible' => -1, 'position' => 145, 'isameasure' => 1), + 'fk_account' => array('type' => 'integer', 'label' => 'BankAccount', 'enabled' => 'isModEnabled("bank")', 'visible' => -1, 'position' => 150), + 'fk_currency' => array('type' => 'varchar(3)', 'label' => 'Currency', 'enabled' => 1, 'visible' => -1, 'position' => 155), + 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'PaymentTerm', 'enabled' => 1, 'visible' => -1, 'position' => 160), + 'deposit_percent' => array('type' => 'varchar(63)', 'label' => 'DepositPercent', 'enabled' => 1, 'visible' => -1, 'position' => 161), + 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'PaymentMode', 'enabled' => 1, 'visible' => -1, 'position' => 165), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 170), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 175), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'PDFTemplate', 'enabled' => 1, 'visible' => 0, 'position' => 180), + 'date_livraison' => array('type' => 'date', 'label' => 'DateDeliveryPlanned', 'enabled' => 1, 'visible' => -1, 'position' => 185), + 'fk_shipping_method' => array('type' => 'integer', 'label' => 'ShippingMethod', 'enabled' => 1, 'visible' => -1, 'position' => 190), + 'fk_warehouse' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'Fk warehouse', 'enabled' => 'isModEnabled("stock")', 'visible' => -1, 'position' => 191), + 'fk_availability' => array('type' => 'integer', 'label' => 'Availability', 'enabled' => 1, 'visible' => -1, 'position' => 195), + 'fk_delivery_address' => array('type' => 'integer', 'label' => 'DeliveryAddress', 'enabled' => 1, 'visible' => 0, 'position' => 200), + // deprecated + 'fk_input_reason' => array('type' => 'integer', 'label' => 'InputReason', 'enabled' => 1, 'visible' => -1, 'position' => 205), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 215), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 220), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 225), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'MulticurrencyID', 'enabled' => 1, 'visible' => -1, 'position' => 230), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'MulticurrencyCurrency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 235), + 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 240, 'isameasure' => 1), + 'multicurrency_total_ht' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountHT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 245, 'isameasure' => 1), + 'multicurrency_total_tva' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountVAT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 250, 'isameasure' => 1), + 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountTTC', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 255, 'isameasure' => 1), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => -1, 'position' => 260), + 'fk_statut' => array('type' => 'smallint(6)', 'label' => 'Status', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 500), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 900), + ); + // END MODULEBUILDER PROPERTIES + /** + * Canceled status + */ + const STATUS_CANCELED = -1; + /** + * Draft status + */ + const STATUS_DRAFT = 0; + /** + * Validated status + */ + const STATUS_VALIDATED = 1; + /** + * Signed quote + */ + const STATUS_SIGNED = 2; + /** + * Not signed quote + */ + const STATUS_NOTSIGNED = 3; + /** + * Billed or processed quote + */ + const STATUS_BILLED = 4; + // Todo rename into STATUS_CLOSE ? + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param int $socid Id third party + * @param int $propalid Id proposal + */ + public function __construct($db, $socid = 0, $propalid = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Add line into array ->lines + * $this->thirdparty should be loaded + * + * @param int $idproduct Product Id to add + * @param float $qty Quantity + * @param float $remise_percent Discount effected on Product + * @return int Return integer <0 if KO, >0 if OK + * + * TODO Replace calls to this function by generation object Ligne + */ + public function add_product($idproduct, $qty, $remise_percent = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Add a discount line into an proposal (as a proposal line) using an existing absolute discount (Consume the discount) + * + * @param int $idremise Id of fixed discount from table llx_societe_remise_except + * @return int >0 if OK, <0 if KO + */ + public function insert_discount($idremise) + { + } + /** + * Add a proposal line into database (linked to product/service or not) + * The parameters are already supposed to be appropriate and with final values to the call + * of this method. Also, for the VAT rate, it must have already been defined + * by whose calling the method get_default_tva (societe_vendeuse, societe_acheteuse, '' product) + * and desc must already have the right value (it's up to the caller to manage multilanguage) + * + * @param string $desc Description of line + * @param float $pu_ht Unit price + * @param float $qty Quantity + * @param float|string $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') + * @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside) + * @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside) + * @param int $fk_product Product/Service ID predefined + * @param float $remise_percent Pourcentage de remise de la ligne + * @param string $price_base_type HT or TTC + * @param float $pu_ttc Prix unitaire TTC + * @param int $info_bits Bits for type of lines + * @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used. + * @param int $rang Position of line + * @param int $special_code Special code (also used by externals modules!) + * @param int $fk_parent_line Id of parent line + * @param int $fk_fournprice Id supplier price + * @param int $pa_ht Buying price without tax + * @param string $label ??? + * @param int|string $date_start Start date of the line + * @param int|string $date_end End date of the line + * @param array $array_options extrafields array + * @param int|null $fk_unit Code of the unit to use. Null to use the default one + * @param string $origin Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be 'orderdet', 'propaldet'..., else 'order','propal,'.... + * @param int $origin_id Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be Id of origin object (aka line id), else object id + * @param double $pu_ht_devise Unit price in currency + * @param int $fk_remise_except Id discount if line is from a discount + * @param int $noupdateafterinsertline No update after insert of line + * @return int >0 if OK, <0 if KO + * @see add_product() + */ + public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $info_bits = 0, $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $date_start = '', $date_end = '', $array_options = array(), $fk_unit = \null, $origin = '', $origin_id = 0, $pu_ht_devise = 0, $fk_remise_except = 0, $noupdateafterinsertline = 0) + { + } + /** + * Update a proposal line + * + * @param int $rowid Id of line + * @param float $pu Unit price (HT or TTC depending on price_base_type) + * @param float $qty Quantity + * @param float $remise_percent Discount on line + * @param float|string $txtva VAT Rate (Can be '1.23' or '1.23 (ABC)') + * @param float $txlocaltax1 Local tax 1 rate + * @param float $txlocaltax2 Local tax 2 rate + * @param string $desc Description + * @param string $price_base_type HT or TTC + * @param int $info_bits Miscellaneous information + * @param int $special_code Special code (also used by externals modules!) + * @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines). + * @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules) + * @param int $fk_fournprice Id of origin supplier price + * @param int $pa_ht Price (without tax) of product when it was bought + * @param string $label ??? + * @param int $type 0/1=Product/service + * @param int|string $date_start Start date of the line + * @param int|string $date_end End date of the line + * @param array $array_options extrafields array + * @param int|null $fk_unit Code of the unit to use. Null to use the default one + * @param double $pu_ht_devise Unit price in currency + * @param int $notrigger disable line update trigger + * @param integer $rang line rank + * @return int 0 if OK, <0 if KO + */ + public function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $date_start = '', $date_end = '', $array_options = array(), $fk_unit = \null, $pu_ht_devise = 0, $notrigger = 0, $rang = 0) + { + } + /** + * Delete detail line + * + * @param int $lineid Id of line to delete + * @param int $id Id of object (for a check) + * @return int >0 if OK, <0 if KO + */ + public function deleteLine($lineid, $id = 0) + { + } + /** + * Create commercial proposal into database + * this->ref can be set or empty. If empty, we will use "(PROVid)" + * + * @param User $user User that create + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >=0 if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $user User making the clone + * @param int $socid Id of thirdparty + * @param int $forceentity Entity id to force + * @param bool $update_prices [=false] Update prices if true + * @param bool $update_desc [=false] Update description if true + * @return int New id of clone + */ + public function createFromClone(\User $user, $socid = 0, $forceentity = \null, $update_prices = \false, $update_desc = \false) + { + } + /** + * Load a proposal from database. Get also lines. + * + * @param int $rowid Id of object to load + * @param string $ref Ref of proposal + * @param string $ref_ext Ref ext of proposal + * @param int $forceentity Entity id to force when searching on ref or ref_ext + * @return int >0 if OK, <0 if KO + */ + public function fetch($rowid, $ref = '', $ref_ext = '', $forceentity = 0) + { + } + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load array lines + * + * @param int $only_product Return only physical products + * @param int $loadalsotranslation Return translation for products + * @param string $sqlforgedfilters Filter on other fields + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch_lines($only_product = 0, $loadalsotranslation = 0, $sqlforgedfilters = '') + { + } + /** + * Set status to validated + * + * @param User $user Object user that validate + * @param int $notrigger 1=Does not execute triggers, 0=execute triggers + * @return int Return integer <0 if KO, 0=Nothing done, >=0 if OK + */ + public function valid($user, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Define proposal date + * + * @param User $user Object user that modify + * @param int $date Date + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_date($user, $date, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Define end validity date + * + * @param User $user Object user that modify + * @param int $date_end_validity End of validity date + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_echeance($user, $date_end_validity, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set delivery date + * + * @param User $user Object user that modify + * @param int $delivery_date Delivery date + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if ko, >0 if ok + * @deprecated Use setDeliveryDate + */ + public function set_date_livraison($user, $delivery_date, $notrigger = 0) + { + } + /** + * Set delivery date + * + * @param User $user Object user that modify + * @param int $delivery_date Delivery date + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if ko, >0 if ok + */ + public function setDeliveryDate($user, $delivery_date, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set delivery + * + * @param User $user Object user that modify + * @param int $id Availability id + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_availability($user, $id, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set source of demand + * + * @param User $user Object user that modify + * @param int $id Input reason id + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_demand_reason($user, $id, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set customer reference number + * + * @param User $user Object user that modify + * @param string $ref_client Customer reference + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if ko, >0 if ok + */ + public function set_ref_client($user, $ref_client, $notrigger = 0) + { + } + /** + * Reopen the commercial proposal + * + * @param User $user Object user that close + * @param int $status Status + * @param string $note Comment + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function reopen($user, $status, $note = '', $notrigger = 0) + { + } + /** + * Close/set the commercial proposal to status signed or refused (fill also date signature) + * + * @param User $user Object user that close + * @param int $status Status (self::STATUS_BILLED or self::STATUS_REFUSED) + * @param string $note_private Complete private note with this note + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @param string $note_public Complete public note with this note + * @return int Return integer <0 if KO, >0 if OK + */ + public function closeProposal($user, $status, $note_private = '', $notrigger = 0, $note_public = '') + { + } + /** + * Classify the proposal to status Billed + * + * @param User $user Object user + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @param string $note Complete private note with this note + * @return int Return integer <0 if KO, 0 = nothing done, >0 if OK + */ + public function classifyBilled(\User $user, $notrigger = 0, $note = '') + { + } + /** + * Cancel the proposal + * + * @param User $user Object user + * @return int Return integer if KO <0 , if OK >0 + */ + public function setCancel(\User $user) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set draft status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function setDraft($user, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of proposal (eventually filtered on user) into an array + * + * @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name) + * @param int $draft 0=not draft, 1=draft + * @param int $notcurrentuser 0=all user, 1=not current user + * @param int $socid Id third party + * @param int $limit For pagination + * @param int $offset For pagination + * @param string $sortfield Sort criteria + * @param string $sortorder Sort order + * @return array|int -1 if KO, array with result if OK + */ + public function liste_array($shortlist = 0, $draft = 0, $notcurrentuser = 0, $socid = 0, $limit = 0, $offset = 0, $sortfield = 'p.datep', $sortorder = 'DESC') + { + } + /** + * Returns an array with the numbers of related invoices + * + * @return array Array of invoices + */ + public function getInvoiceArrayList() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns an array with id and ref of related invoices + * + * @param int $id Id propal + * @return array|int Array of invoices id + */ + public function InvoiceArrayList($id) + { + } + /** + * Delete proposal + * + * @param User $user Object user that delete + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int >0 if OK, <=0 if KO + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Change the delivery time + * + * @param int $availability_id Id of new delivery time + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int >0 if OK, <0 if KO + * @deprecated use set_availability + */ + public function availability($availability_id, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Change source demand + * + * @param int $demand_reason_id Id of new source demand + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int >0 si ok, <0 si ko + * @deprecated use set_demand_reason + */ + public function demand_reason($demand_reason_id, $notrigger = 0) + { + } + /** + * Object Proposal Information + * + * @param int $id Proposal id + * @return void + */ + public function info($id) + { + } + /** + * Return label of status of proposal (draft, validated, ...) + * + * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return label of a status (draft, validated, ...) + * + * @param int $status Id status + * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label + */ + public function LibStatut($status, $mode = 1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @param string $mode "opened" for proposal to close, "signed" for proposal to invoice + * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK + */ + public function load_board($user, $mode) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Load the indicators this->nb for the state board + * + * @return int Return integer <0 if ko, >0 if ok + */ + public function loadStateBoard() + { + } + /** + * Returns the reference to the following non used Proposal used depending on the active numbering module + * defined into PROPALE_ADDON + * + * @param Societe $soc Object thirdparty + * @return string Reference libre pour la propale + */ + public function getNextNumRef($soc) + { + } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param int $withpicto Add picto into link + * @param string $option Where point the link ('expedition', 'document', ...) + * @param string $get_params Parameters added to url + * @param int $notooltip 1=Disable tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $addlinktonotes -1=Disable, 0=Just add label show notes, 1=Add private note (only internal user), 2=Add public note (internal or external user), 3=Add private (internal user) and public note (internal and external user) + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = -1) + { + } + /** + * Retrieve an array of proposal lines + * + * @param string $sqlforgedfilters Filter on other fields + * @return int >0 if OK, <0 if KO + */ + public function getLinesArray($sqlforgedfilters = '') + { + } + /** + * Create a document onto disk according to template module. + * + * @param string $modele Force model to use ('' to not force) + * @param Translate $outputlangs Object langs to use for output + * @param int $hidedetails Hide details of lines + * @param int $hidedesc Hide description + * @param int $hideref Hide ref + * @param null|array $moreparams Array to provide more information + * @return int 0 if KO, 1 if OK + */ + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = \null) + { + } + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty(\DoliDB $dbs, $origin_id, $dest_id) + { + } + /** + * Function used to replace a product id with another one. + * + * @param DoliDB $db Database handler + * @param int $origin_id Old product id + * @param int $dest_id New product id + * @return bool + */ + public static function replaceProduct(\DoliDB $db, $origin_id, $dest_id) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /** + * Class to manage commercial proposal lines + */ + class PropaleLigne extends \CommonObjectLine + { + /** + * @var string ID to identify managed object + */ + public $element = 'propaldet'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'propaldet'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'propal'; + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_propal'; + /** + * @var PropaleLigne + */ + public $oldline; + // From llx_propaldet + /** + * @var int + */ + public $fk_propal; + /** + * @var int + */ + public $fk_parent_line; + /** + * @var string Line description + */ + public $desc; + /** + * @var int Predefined product Id + */ + public $fk_product; + /** + * @var int + * @deprecated + * @see $product_type + */ + public $fk_product_type; + /** + * Product type. + * @var int + * @see Product::TYPE_PRODUCT, Product::TYPE_SERVICE + */ + public $product_type = \Product::TYPE_PRODUCT; + /** + * @var float Quantity + */ + public $qty; + /** + * @var float|string + */ + public $tva_tx; + /** + * @var string + */ + public $vat_src_code; + /** + * Unit price before taxes + * @var float + */ + public $subprice; + /** + * @var int|string|float + */ + public $remise_percent; + /** + * @var int ID + */ + public $fk_remise_except; + /** + * @var int line rank + */ + public $rang = 0; + /** + * @var int + */ + public $fk_fournprice; + /** + * @var float|int|string + */ + public $pa_ht; + /** + * @var int|float|string + */ + public $marge_tx; + /** + * @var float|string + */ + public $marque_tx; + /** + * Tag for special lines (exclusive tags) + * 1: shipping costs + * 2: ecotaxe + * 3: option line (when qty = 0) + * @var int special code + */ + public $special_code; + /** + * Some other info: + * Bit 0: 0 si TVA normal - 1 if TVA NPR + * Bit 1: 0 ligne normal - 1 if line with fixed discount + * @var int + */ + public $info_bits = 0; + /** + * Total amount excluding taxes (HT = "Hors Taxe" in French) including discounts + * @var float + */ + public $total_ht; + /** + * Total VAT amount (TVA = "Taxe sur la Valeur Ajoutée" in French) + * @var float + */ + public $total_tva; + /** + * Total amount including taxes (TTC = "Toutes Taxes Comprises" in French) + * @var float + */ + public $total_ttc; + /** + * @var float|string + * @deprecated + * @see $remise_percent, $fk_remise_except + */ + public $remise; + /** + * @var float|string + * @deprecated + * @see $subprice + */ + public $price; + // From llx_product + /** + * @var string + * @deprecated + * @see $product_ref + */ + public $ref; + /** + * Product reference + * @var string + */ + public $product_ref; + /** + * @var string + * @deprecated + * @see $product_label + */ + public $libelle; + /** + * @var string + * @deprecated + * @see $product_label + */ + public $label; + /** + * Product label + * @var string + */ + public $product_label; + /** + * Product description + * @var string + */ + public $product_desc; + /** + * Product use lot + * @var string + */ + public $product_tobatch; + /** + * Product barcode + * @var string + */ + public $product_barcode; + /** + * @var string|float + */ + public $localtax1_tx; + /** + * @var string|float + */ + public $localtax2_tx; + /** + * @var int|string Local tax 1 type + */ + public $localtax1_type; + /** + * @var int|string Local tax 2 type + */ + public $localtax2_type; + /** + * @var float Line total local tax 1 + */ + public $total_localtax1; + /** + * @var float Line total local tax 2 + */ + public $total_localtax2; + /** + * @var int|string + */ + public $date_start; + /** + * @var int|string + */ + public $date_end; + /** + * @var int Skip update price total for special lines + */ + public $skip_update_total; + // Multicurrency + /** + * @var int multicurrency id + */ + public $fk_multicurrency; + /** + * @var string Multicurrency code + */ + public $multicurrency_code; + /** + * @var float Multicurrency subprice + */ + public $multicurrency_subprice; + /** + * @var float Multicurrency total without tax + */ + public $multicurrency_total_ht; + /** + * @var float Multicurrency total vat + */ + public $multicurrency_total_tva; + /** + * @var float Multicurrency total with tax + */ + public $multicurrency_total_ttc; + /** + * Class line Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Retrieve the propal line object + * + * @param int $rowid Propal line id + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($rowid) + { + } + /** + * Insert object line propal in database + * + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function insert($notrigger = 0) + { + } + /** + * Delete line in database + * + * @param User $user Object user + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if ko, >0 if ok + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Update propal line object into DB + * + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if ko, >0 if ok + */ + public function update($notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update DB line fields total_xxx + * Used by migration + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function update_total() + { + } + } + /** + * Class to manage proposals statistics + */ + class PropaleStats extends \Stats + { + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; + public $socid; + public $userid; + public $from; + public $field; + public $where; + public $join; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. + * @param int $userid Id user for filter (creation user) + * @param string $mode Option ('customer', 'supplier') + * @param int $typentid Id typent of thirdpary for filter + * @param int $categid Id category of thirdpary for filter + */ + public function __construct($db, $socid = 0, $userid = 0, $mode = 'customer', $typentid = 0, $categid = 0) + { + } + /** + * Return propals number by month for a year + * + * @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 + */ + public function getNbByMonth($year, $format = 0) + { + } + /** + * Return propals number per year + * + * @return array Array with number by year + * + */ + public function getNbByYear() + { + } + /** + * Return the propals amount by month for a year + * + * @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 + */ + public function getAmountByMonth($year, $format = 0) + { + } + /** + * Return the propals amount average by month for a year + * + * @param int $year year for stats + * @return array array with number by month + */ + public function getAverageByMonth($year) + { + } + /** + * Return nb, total and average + * + * @return array Array of values + */ + public function getAllByYear() + { + } + /** + * Return nb, amount of predefined product for year + * + * @param int $year Year to scan + * @param int $limit Limit + * @return array,array{0:int<1,12>,1:int|float}> Array of values + */ + public function getAllByProduct($year, $limit = 10) + { + } + } + /** + * API class for orders + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ + class Orders extends \DolibarrApi + { + /** + * @var array $FIELDS Mandatory fields, checked when create and update object + */ + public static $FIELDS = array('socid', 'date'); + /** + * @var Commande $commande {@type Commande} + */ + public $commande; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get properties of an order object by id + * + * Return an array with order information + * + * @param int $id ID of order + * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id + * @return array|mixed data without useless information + * + * @throws RestException + */ + public function get($id, $contact_list = 1) + { + } + /** + * Get properties of an order object by ref + * + * Return an array with order information + * + * @param string $ref Ref of object + * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id + * @return array|mixed data without useless information + * + * @url GET ref/{ref} + * + * @throws RestException + */ + public function getByRef($ref, $contact_list = 1) + { + } + /** + * Get properties of an order object by ref_ext + * + * Return an array with order information + * + * @param string $ref_ext External reference of object + * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id + * @return array|mixed data without useless information + * + * @url GET ref_ext/{ref_ext} + * + * @throws RestException + */ + public function getByRefExt($ref_ext, $contact_list = 1) + { + } + /** + * List orders + * + * Get a list of orders + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + * @param string $sqlfilterlines Other criteria to filter answers separated by a comma. Syntax example "(tl.fk_product:=:'17') and (tl.price:<:'250')" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* + * @return array Array of order objects + * + * @throws RestException 404 Not found + * @throws RestException 503 Error + */ + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $sqlfilterlines = '', $properties = '', $pagination_data = \false) + { + } + /** + * Create a sale order + * + * Example: { "socid": 2, "date": 1595196000, "type": 0, "lines": [{ "fk_product": 2, "qty": 1 }] } + * + * @param array $request_data Request data + * @return int ID of order + */ + public function post($request_data = \null) + { + } + /** + * Get lines of an order + * + * @param int $id Id of order + * + * @url GET {id}/lines + * + * @return array + */ + public function getLines($id) + { + } + /** + * Add a line to given order + * + * @param int $id Id of order to update + * @param array $request_data OrderLine data + * + * @url POST {id}/lines + * + * @return int + */ + public function postLine($id, $request_data = \null) + { + } + /** + * Update a line to given order + * + * @param int $id Id of order to update + * @param int $lineid Id of line to update + * @param array $request_data OrderLine data + * @return Object|false Object with cleaned properties + * + * @url PUT {id}/lines/{lineid} + */ + public function putLine($id, $lineid, $request_data = \null) + { + } + /** + * Delete a line of a given order + * + * @param int $id Id of order to update + * @param int $lineid Id of line to delete + * @return Object Object with cleaned properties + * + * @url DELETE {id}/lines/{lineid} + * + * @throws RestException 401 + * @throws RestException 404 + */ + public function deleteLine($id, $lineid) + { + } + /** + * Get contacts of given order + * + * Return an array with contact information + * + * @param int $id ID of order + * @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER) + * @return Object Object with cleaned properties + * + * @url GET {id}/contacts + * + * @throws RestException + */ + public function getContacts($id, $type = '') + { + } + /** + * Add a contact type of given order + * + * @param int $id Id of order to update + * @param int $contactid Id of contact to add + * @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER) + * @return array + * + * @url POST {id}/contact/{contactid}/{type} + * + * @throws RestException 401 + * @throws RestException 404 + */ + public function postContact($id, $contactid, $type) + { + } + /** + * Unlink a contact type of given order + * + * @param int $id Id of order to update + * @param int $contactid Id of contact + * @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER). + * + * @url DELETE {id}/contact/{contactid}/{type} + * + * @return array + * + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 500 System error + */ + public function deleteContact($id, $contactid, $type) + { + } + /** + * Update order general fields (won't touch lines of order) + * + * @param int $id Id of order to update + * @param array $request_data Datas + * @return Object Object with cleaned properties + */ + public function put($id, $request_data = \null) + { + } + /** + * Delete order + * + * @param int $id Order ID + * @return array + */ + public function delete($id) + { + } + /** + * Validate an order + * + * If you get a bad value for param notrigger check, provide this in body + * { + * "idwarehouse": 0, + * "notrigger": 0 + * } + * + * @param int $id Order ID + * @param int $idwarehouse Warehouse ID + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return Object Object with cleaned properties + * + * @url POST {id}/validate + * + * @throws RestException 304 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 500 System error + * + */ + public function validate($id, $idwarehouse = 0, $notrigger = 0) + { + } + /** + * Tag the order as validated (opened) + * + * Function used when order is reopend after being closed. + * + * @param int $id Id of the order + * + * @url POST {id}/reopen + * + * @return int + * + * @throws RestException 304 + * @throws RestException 400 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 405 + */ + public function reopen($id) + { + } + /** + * Classify the order as invoiced. Could be also called setbilled + * + * @param int $id Id of the order + * @return Object Object with cleaned properties + * + * @url POST {id}/setinvoiced + * + * @throws RestException 400 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 405 + */ + public function setinvoiced($id) + { + } + /** + * Close an order (Classify it as "Delivered") + * + * @param int $id Order ID + * @param int $notrigger Disabled triggers + * @return Object Object with cleaned properties + * + * @url POST {id}/close + */ + public function close($id, $notrigger = 0) + { + } + /** + * Set an order to draft + * + * @param int $id Order ID + * @param int $idwarehouse Warehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on) + * @return Object Object with cleaned properties + * + * @url POST {id}/settodraft + */ + public function settodraft($id, $idwarehouse = -1) + { + } + /** + * Create an order using an existing proposal. + * + * @param int $proposalid Id of the proposal + * @return Object Object with cleaned properties + * + * @url POST /createfromproposal/{proposalid} + * + * @throws RestException 400 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 405 + */ + public function createOrderFromProposal($proposalid) + { + } + /** + * Get the shipments of an order + * + * @param int $id Id of the order + * + * @url GET {id}/shipment + * + * @return array + * + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 500 System error + */ + public function getOrderShipments($id) + { + } + /** + * Create the shipment of an order + * + * @param int $id Id of the order + * @param int $warehouse_id Id of a warehouse + * + * @url POST {id}/shipment/{warehouse_id} + * + * @return int + * + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 500 System error + */ + public function createOrderShipment($id, $warehouse_id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensible object datas + * + * @param Object $object Object to clean + * @return Object Object with cleaned properties + */ + protected function _cleanObjectDatas($object) + { + } + } + /** + * Superclass for orders classes + */ + abstract class CommonOrder extends \CommonObject + { + use \CommonIncoterm; + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + /** return nb of fines of order where products or services that can be bought + * + * @param boolean $ignoreFree Ignore free lines + * @return int number of products or services on buy in a command + */ + public function getNbLinesProductOrServiceOnBuy($ignoreFree = \false) + { + } + /** + * @var string code + */ + public $code = ""; + } + /** + * Class to manage customers orders + */ + class Commande extends \CommonOrder + { + /** + * @var string ID to identify managed object + */ + public $element = 'commande'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'commande'; + /** + * @var string Name of subtable line + */ + public $table_element_line = 'commandedet'; + /** + * @var string Name of class line + */ + public $class_element_line = 'OrderLine'; + /** + * @var string Field name with ID of parent key if this field has a parent + */ + public $fk_element = 'fk_commande'; + /** + * @var string String with name of icon for commande class. Here is object_order.png + */ + public $picto = 'order'; + /** + * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user + * @var integer + */ + public $restrictiononfksoc = 1; + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + /** + * @var int Thirdparty ID + */ + public $socid; + /** + * @var string Thirdparty ref of order + */ + public $ref_client; + /** + * @var string Thirdparty ref of order + */ + public $ref_customer; + /** + * @var int Contact ID + */ + public $contactid; + /** + * Status of the order + * @var int + */ + public $statut; + /** + * @var int Status Billed or not + */ + public $billed; + /** + * @var int Deadline for payment + */ + public $date_lim_reglement; + /** + * @var string Condition payment code + */ + public $cond_reglement_code; + /** + * @var string Condition payment label + */ + public $cond_reglement_doc; + /** + * @var float Deposit percent for payment terms. + * Populated by $CommonObject->setPaymentTerms(). + * @see setPaymentTerms() + */ + public $deposit_percent; + /** + * @var int bank account ID + */ + public $fk_account; + /** + * @var string It holds the label of the payment mode. Use it in case translation cannot be found. + */ + public $mode_reglement; + /** + * @var int Payment mode id + */ + public $mode_reglement_id; + /** + * @var string Payment mode code + */ + public $mode_reglement_code; + /** + * Availability delivery time id + * @var int + */ + public $availability_id; + /** + * Availability delivery time code + * @var string + */ + public $availability_code; + /** + * Label of availability delivery time. Use it in case translation cannot be found. + * @var string + */ + public $availability; + /** + * @var int Source demand reason Id + */ + public $demand_reason_id; + /** + * @var string Source reason code. Why we receive order (after a phone campaign, ...) + */ + public $demand_reason_code; + /** + * @var null|int|'' Date of order + */ + public $date; + /** + * @var null|int|'' Date of order + * @deprecated + * @see $date + */ + public $date_commande; + /** + * @var null|int|'' Date expected of shipment (date of start of shipment, not the reception that occurs some days after) + */ + public $delivery_date; + /** + * @var int ID + */ + public $fk_remise_except; + /** + * @deprecated + */ + public $remise_percent; + public $source; + // Order mode. How we received order (by phone, by email, ...) + /** + * Status of the contract (0=NoSignature, 1=SignedBySender, 2=SignedByReceiver, 9=SignedByAll) + * @var int + */ + public $signed_status = 0; + /** + * @var int Warehouse Id + */ + public $warehouse_id; + /** + * @var array (Encoded as JSON in database) + */ + public $extraparams = array(); + public $linked_objects = array(); + /** + * @var int User author ID + */ + public $user_author_id; + /** + * @var OrderLine one line of an order + */ + public $line; + /** + * @var OrderLine[] + */ + public $lines = array(); + //! key of module source when order generated from a dedicated module ('cashdesk', 'takepos', ...) + public $module_source; + //! key of pos source ('0', '1', ...) + public $pos_source; + /** + * @var array Array with line of all shipments + */ + public $expeditions; + /** + * @var string payment url + */ + public $online_payment_url; + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array( + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 20, 'index' => 1), + 'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 25), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 26), + 'ref_client' => array('type' => 'varchar(255)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => -1, 'position' => 28), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'notnull' => 1, 'position' => 20), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Project', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 25), + 'date_commande' => array('type' => 'date', 'label' => 'Date', 'enabled' => 1, 'visible' => 1, 'position' => 60, 'csslist' => 'nowraponall'), + 'date_valid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 62, 'csslist' => 'nowraponall'), + 'date_cloture' => array('type' => 'datetime', 'label' => 'DateClosing', 'enabled' => 1, 'visible' => -1, 'position' => 65, 'csslist' => 'nowraponall'), + 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 85), + 'fk_user_cloture' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserClosing', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'source' => array('type' => 'smallint(6)', 'label' => 'Source', 'enabled' => 1, 'visible' => -1, 'position' => 95), + 'total_tva' => array('type' => 'double(24,8)', 'label' => 'VAT', 'enabled' => 1, 'visible' => -1, 'position' => 125, 'isameasure' => 1), + 'localtax1' => array('type' => 'double(24,8)', 'label' => 'LocalTax1', 'enabled' => 1, 'visible' => -1, 'position' => 130, 'isameasure' => 1), + 'localtax2' => array('type' => 'double(24,8)', 'label' => 'LocalTax2', 'enabled' => 1, 'visible' => -1, 'position' => 135, 'isameasure' => 1), + 'total_ht' => array('type' => 'double(24,8)', 'label' => 'TotalHT', 'enabled' => 1, 'visible' => -1, 'position' => 140, 'isameasure' => 1), + 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'TotalTTC', 'enabled' => 1, 'visible' => -1, 'position' => 145, 'isameasure' => 1), + 'signed_status' => array('type' => 'smallint(6)', 'label' => 'SignedStatus', 'enabled' => 1, 'visible' => -1, 'position' => 146, 'arrayofkeyval' => array(0 => 'NoSignature', 1 => 'SignedSender', 2 => 'SignedReceiver', 9 => 'SignedAll')), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 150), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'PDFTemplate', 'enabled' => 1, 'visible' => 0, 'position' => 160), + 'fk_account' => array('type' => 'integer', 'label' => 'BankAccount', 'enabled' => 'isModEnabled("bank")', 'visible' => -1, 'position' => 170), + 'fk_currency' => array('type' => 'varchar(3)', 'label' => 'MulticurrencyID', 'enabled' => 1, 'visible' => -1, 'position' => 175), + 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'PaymentTerm', 'enabled' => 1, 'visible' => -1, 'position' => 180), + 'deposit_percent' => array('type' => 'varchar(63)', 'label' => 'DepositPercent', 'enabled' => 1, 'visible' => -1, 'position' => 181), + 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'PaymentMode', 'enabled' => 1, 'visible' => -1, 'position' => 185), + 'date_livraison' => array('type' => 'date', 'label' => 'DateDeliveryPlanned', 'enabled' => 1, 'visible' => -1, 'position' => 190, 'csslist' => 'nowraponall'), + 'fk_shipping_method' => array('type' => 'integer', 'label' => 'ShippingMethod', 'enabled' => 1, 'visible' => -1, 'position' => 195), + 'fk_warehouse' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'Fk warehouse', 'enabled' => 'isModEnabled("stock")', 'visible' => -1, 'position' => 200), + 'fk_availability' => array('type' => 'integer', 'label' => 'Availability', 'enabled' => 1, 'visible' => -1, 'position' => 205), + 'fk_input_reason' => array('type' => 'integer', 'label' => 'InputReason', 'enabled' => 1, 'visible' => -1, 'position' => 210), + //'fk_delivery_address' =>array('type'=>'integer', 'label'=>'DeliveryAddress', 'enabled'=>1, 'visible'=>-1, 'position'=>215), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 225), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 230), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 235), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'Fk multicurrency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 240), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'MulticurrencyCurrency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 245), + 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 250, 'isameasure' => 1), + 'multicurrency_total_ht' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountHT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 255, 'isameasure' => 1), + 'multicurrency_total_tva' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountVAT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 260, 'isameasure' => 1), + 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountTTC', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 265, 'isameasure' => 1), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => -1, 'position' => 270), + 'module_source' => array('type' => 'varchar(32)', 'label' => 'POSModule', 'enabled' => 1, 'visible' => -1, 'position' => 275), + 'pos_source' => array('type' => 'varchar(32)', 'label' => 'POSTerminal', 'enabled' => 1, 'visible' => -1, 'position' => 280), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -1, 'position' => 300), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 302), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'position' => 304, 'csslist' => 'nowraponall'), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 306), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 400), + 'fk_statut' => array('type' => 'smallint(6)', 'label' => 'Status', 'enabled' => 1, 'visible' => -1, 'position' => 500), + ); + // END MODULEBUILDER PROPERTIES + /** + * ERR Not enough stock + */ + const STOCK_NOT_ENOUGH_FOR_ORDER = -3; + /** + * Canceled status + */ + const STATUS_CANCELED = -1; + /** + * Draft status + */ + const STATUS_DRAFT = 0; + /** + * Validated status + */ + const STATUS_VALIDATED = 1; + /** + * Shipment on process + */ + const STATUS_SHIPMENTONPROCESS = 2; + // We set this status when a shipment is validated + /** + * For backward compatibility. Use key STATUS_SHIPMENTONPROCESS instead. + * @deprecated + */ + const STATUS_ACCEPTED = 2; + /** + * Closed (Sent, billed or not) + */ + const STATUS_CLOSED = 3; + /* + * No signature + */ + const STATUS_NO_SIGNATURE = 0; + /* + * Signed by sender + */ + const STATUS_SIGNED_SENDER = 1; + /* + * Signed by receiver + */ + const STATUS_SIGNED_RECEIVER = 2; + /* + * Signed by all + */ + const STATUS_SIGNED_ALL = 9; + // To handle future kind of signature (ex: tripartite contract) + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Returns the reference to the following non used Order depending on the active numbering module + * defined into COMMANDE_ADDON + * + * @param Societe $soc Object thirdparty + * @return string Order free reference + */ + public function getNextNumRef($soc) + { + } + /** + * Validate order + * + * @param User $user User making status change + * @param int $idwarehouse Id of warehouse to use for stock decrease + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK + */ + public function valid($user, $idwarehouse = 0, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set draft status + * + * @param User $user Object user that modify + * @param int $idwarehouse Warehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on) + * @return int Return integer <0 if KO, >0 if OK + */ + public function setDraft($user, $idwarehouse = -1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Tag the order as validated (opened) + * Function used when order is reopend after being closed. + * + * @param User $user Object user that change status + * @return int Return integer <0 if KO, 0 if nothing is done, >0 if OK + */ + public function set_reopen($user) + { + } + /** + * Close order + * + * @param User $user Object user that close + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function cloture($user, $notrigger = 0) + { + } + /** + * Cancel an order + * If stock is decremented on order validation, we must reincrement it + * + * @param int $idwarehouse Id warehouse to use for stock change. + * @return int Return integer <0 if KO, >0 if OK + */ + public function cancel($idwarehouse = -1) + { + } + /** + * Create order + * Note that this->ref can be set or empty. If empty, we will use "(PROV)" + * + * @param User $user Object user that make creation + * @param int $notrigger Disable all triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $user User making the clone + * @param int $socid Id of thirdparty + * @return int New id of clone + */ + public function createFromClone(\User $user, $socid = 0) + { + } + /** + * Load an object from a proposal and create a new order into database + * + * @param Object $object Object source + * @param User $user User making creation + * @return int Return integer <0 if KO, 0 if nothing done, 1 if OK + */ + public function createFromProposal($object, \User $user) + { + } + /** + * Add an order line into database (linked to product/service or not) + * + * @param string $desc Description of line + * @param float $pu_ht Unit price (without tax) + * @param float $qty Quantite + * @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') + * @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside) + * @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside) + * @param int $fk_product Id of product + * @param float $remise_percent Percentage discount of the line + * @param int $info_bits Bits of type of lines + * @param int $fk_remise_except Id remise + * @param string $price_base_type HT or TTC + * @param float $pu_ttc Prix unitaire TTC + * @param int|string $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) + * @param int|string $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) + * @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used. + * @param int $rang Position of line + * @param int $special_code Special code (also used by externals modules!) + * @param int $fk_parent_line Parent line + * @param int $fk_fournprice Id supplier price + * @param int $pa_ht Buying price (without tax) + * @param string $label Label + * @param array $array_options extrafields array. Example array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) + * @param int|null $fk_unit Code of the unit to use. Null to use the default one + * @param string $origin Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be 'orderdet', 'propaldet'..., else 'order','propal,'.... + * @param int $origin_id Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be Id of origin object (aka line id), else object id + * @param double $pu_ht_devise Unit price in currency + * @param string $ref_ext line external reference + * @param int $noupdateafterinsertline No update after insert of line + * @return int >0 if OK, <0 if KO + * + * @see add_product() + * + * Les parameters sont deja cense etre juste et avec valeurs finales a l'appel + * de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini + * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit) + * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) + */ + public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $info_bits = 0, $fk_remise_except = 0, $price_base_type = 'HT', $pu_ttc = 0, $date_start = '', $date_end = '', $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = \null, $pa_ht = 0, $label = '', $array_options = array(), $fk_unit = \null, $origin = '', $origin_id = 0, $pu_ht_devise = 0, $ref_ext = '', $noupdateafterinsertline = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Add line into array + * $this->client must be loaded + * + * @param int $idproduct Product Id + * @param float $qty Quantity + * @param float $remise_percent Product discount relative + * @param int|string $date_start Start date of the line + * @param int|string $date_end End date of the line + * @return void + * + * TODO Remplacer les appels a cette fonction par generation object Ligne + */ + public function add_product($idproduct, $qty, $remise_percent = 0.0, $date_start = '', $date_end = '') + { + } + /** + * Get object from database. Get also lines. + * + * @param int $id Id of object to load + * @param string $ref Ref of object + * @param string $ref_ext External reference of object + * @param string $notused Internal reference of other object + * @return int >0 if OK, <0 if KO, 0 if not found + */ + public function fetch($id, $ref = '', $ref_ext = '', $notused = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Add a discount line into a sale order (as a sale order line) using an existing absolute discount (Consume the discount) + * + * @param int $idremise Id for the fixed discount from table llx_societe_remise_except + * @return int >0 if OK, <0 if KO + */ + public function insert_discount($idremise) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load array lines + * + * @param int $only_product Return only physical products, not services + * @param int $loadalsotranslation Return translation for products + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch_lines($only_product = 0, $loadalsotranslation = 0) + { + } + /** + * Return number of line with type product. + * + * @return int Return integer <0 if KO, Nbr of product lines if OK + */ + public function getNbOfProductsLines() + { + } + /** + * Return number of line with type service. + * + * @return int Return integer <0 if KO, Nbr of service lines if OK + */ + public function getNbOfServicesLines() + { + } + /** + * Count number of shipments for this order + * + * @return int Return integer <0 if KO, Nb of shipment found if OK + */ + public function getNbOfShipments() + { + } + /** + * Load array this->expeditions of lines of shipments with nb of products sent for each order line + * Note: For a dedicated shipment, the fetch_lines can be used to load the qty_asked and qty_shipped. This function is use to return qty_shipped cumulated for the order + * + * @param int $filtre_statut Filter on shipment status + * @param int $fk_product Add a filter on a product + * @return int Return integer <0 if KO, Nb of lines found if OK + */ + public function loadExpeditions($filtre_statut = -1, $fk_product = 0) + { + } + /** + * Returns an array with expeditions lines number + * + * @return int Nb of shipments + */ + public function countNbOfShipments() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return a array with the pending stock by product + * + * @param int $filtre_statut Filtre sur statut + * @return int 0 si OK, <0 si KO + * + * TODO FONCTION NON FINIE A FINIR + */ + /*public function stock_array($filtre_statut = self::STATUS_CANCELED) + { + // phpcs:enable + $this->stocks = array(); + + // Tableau des id de produit de la commande + $array_of_product = array(); + + // Recherche total en stock pour chaque produit + // TODO $array_of_product est défini vide juste au dessus !! + if (count($array_of_product)) { + $sql = "SELECT fk_product, sum(ps.reel) as total"; + $sql .= " FROM ".MAIN_DB_PREFIX."product_stock as ps"; + $sql .= " WHERE ps.fk_product IN (".$this->db->sanitize(join(',', $array_of_product)).")"; + $sql .= ' GROUP BY fk_product'; + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + $i = 0; + while ($i < $num) { + $obj = $this->db->fetch_object($resql); + $this->stocks[$obj->fk_product] = $obj->total; + $i++; + } + $this->db->free($resql); + } + } + return 0; + }*/ + /** + * Delete an order line + * + * @param User $user User object + * @param int $lineid Id of line to delete + * @param int $id Id of object (for a check) + * @return int >0 if OK, 0 if nothing to do, <0 if KO + */ + public function deleteLine($user = \null, $lineid = 0, $id = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Applique une remise relative + * + * @deprecated Use setDiscount() instead. + * @see setDiscount() + * @param User $user User qui positionne la remise + * @param float $remise Discount (percent) + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_remise($user, $remise, $notrigger = 0) + { + } + /** + * Set a percentage discount + * + * @param User $user User setting the discount + * @param float|string $remise Discount (percent) + * @param int<0,1> $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function setDiscount($user, $remise, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set a fixed amount discount + * + * @param User $user User qui positionne la remise + * @param float $remise Discount + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + /* + public function set_remise_absolue($user, $remise, $notrigger = 0) + { + // phpcs:enable + if (empty($remise)) { + $remise = 0; + } + + $remise = price2num($remise); + + if ($user->hasRight('commande', 'creer')) { + $error = 0; + + $this->db->begin(); + + $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande'; + $sql .= ' SET remise_absolue = '.((float) $remise); + $sql .= ' WHERE rowid = '.((int) $this->id).' AND fk_statut = '.self::STATUS_DRAFT; + + dol_syslog(__METHOD__, LOG_DEBUG); + $resql = $this->db->query($sql); + if (!$resql) { + $this->errors[] = $this->db->error(); + $error++; + } + + if (!$error) { + $this->oldcopy = clone $this; + $this->remise_absolue = $remise; + $this->update_price(1); + } + + if (!$notrigger && empty($error)) { + // Call trigger + $result = $this->call_trigger('ORDER_MODIFY', $user); + if ($result < 0) { + $error++; + } + // End call triggers + } + + if (!$error) { + $this->db->commit(); + return 1; + } else { + foreach ($this->errors as $errmsg) { + dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); + $this->error .= ($this->error ? ', '.$errmsg : $errmsg); + } + $this->db->rollback(); + return -1 * $error; + } + } + + return 0; + } + */ + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set the order date + * + * @param User $user Object user making change + * @param int $date Date + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_date($user, $date, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set delivery date + * + * @param User $user Object user that modify + * @param int $delivery_date Delivery date + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if ko, >0 if ok + * @deprecated Use setDeliveryDate + */ + public function set_date_livraison($user, $delivery_date, $notrigger = 0) + { + } + /** + * Set the planned delivery date + * + * @param User $user Object utilisateur qui modifie + * @param int $delivery_date Delivery date + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 si ko, >0 si ok + */ + public function setDeliveryDate($user, $delivery_date, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of orders (eventuelly filtered on a user) into an array + * + * @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name) + * @param int $draft 0=not draft, 1=draft + * @param User $excluser Object user to exclude + * @param int $socid Id third party + * @param int $limit For pagination + * @param int $offset For pagination + * @param string $sortfield Sort criteria + * @param string $sortorder Sort order + * @return int|array -1 if KO, array with result if OK + */ + public function liste_array($shortlist = 0, $draft = 0, $excluser = \null, $socid = 0, $limit = 0, $offset = 0, $sortfield = 'c.date_commande', $sortorder = 'DESC') + { + } + /** + * Update delivery delay + * + * @param int $availability_id Id du nouveau mode + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int >0 if OK, <0 if KO + */ + public function availability($availability_id, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update order demand_reason + * + * @param int $demand_reason_id Id of new demand + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int >0 if ok, <0 if ko + */ + public function demand_reason($demand_reason_id, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set customer ref + * + * @param User $user User that make change + * @param string $ref_client Customer ref + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_ref_client($user, $ref_client, $notrigger = 0) + { + } + /** + * Classify the order as invoiced + * + * @param User $user Object user making the change + * @param int $notrigger 1=Does not execute triggers, 0=execute triggers + * @return int Return integer <0 if KO, 0 if already billed, >0 if OK + */ + public function classifyBilled(\User $user, $notrigger = 0) + { + } + /** + * Classify the order as not invoiced + * + * @param User $user Object user making the change + * @param int $notrigger 1=Does not execute triggers, 0=execute triggers + * @return int Return integer <0 if ko, >0 if ok + */ + public function classifyUnBilled(\User $user, $notrigger = 0) + { + } + /** + * Update a line in database + * + * @param int $rowid Id of line to update + * @param string $desc Description of line + * @param float $pu Unit price + * @param float $qty Quantity + * @param float $remise_percent Percent of discount + * @param float $txtva Taux TVA + * @param float $txlocaltax1 Local tax 1 rate + * @param float $txlocaltax2 Local tax 2 rate + * @param string $price_base_type HT or TTC + * @param int $info_bits Miscellaneous information on line + * @param int|string $date_start Start date of the line + * @param int|string $date_end End date of the line + * @param int $type Type of line (0=product, 1=service) + * @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines). + * @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules) + * @param int $fk_fournprice Id of origin supplier price + * @param int $pa_ht Price (without tax) of product when it was bought + * @param string $label Label + * @param int $special_code Special code (also used by externals modules!) + * @param array $array_options extrafields array + * @param int|null $fk_unit Code of the unit to use. Null to use the default one + * @param double $pu_ht_devise Amount in currency + * @param int $notrigger disable line update trigger + * @param string $ref_ext external reference + * @param integer $rang line rank + * @return int Return integer < 0 if KO, > 0 if OK + */ + public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $price_base_type = 'HT', $info_bits = 0, $date_start = '', $date_end = '', $type = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = \null, $pa_ht = 0, $label = '', $special_code = 0, $array_options = array(), $fk_unit = \null, $pu_ht_devise = 0, $notrigger = 0, $ref_ext = '', $rang = 0) + { + } + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete the sales order + * + * @param User $user User object + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <=0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @param string $mode Mode ('toship', 'tobill', 'shippedtobill') + * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK + */ + public function load_board($user, $mode) + { + } + /** + * Return source label of order + * + * @return string Label + */ + public function getLabelSource() + { + } + /** + * Return status label of Order + * + * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return label of status + * + * @param int $status Id status + * @param int $billed If invoiced + * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto + * @param int $donotshowbilled Do not show billed status after order status + * @return string Label of status + */ + public function LibStatut($status, $billed, $mode, $donotshowbilled = 0) + { + } + /** + * getTooltipContentArray + * + * @param array $params params to construct tooltip data + * @return array + */ + public function getTooltipContentArray($params) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param int $withpicto Add picto into link + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param int $max Max length to show + * @param int $short ??? + * @param int $notooltip 1=Disable tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $addlinktonotes Add link to notes + * @param string $target attribute target for link + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0, $target = '') + { + } + /** + * Charge les information d'ordre info dans l'objet commande + * + * @param int $id Id of order + * @return void + */ + public function info($id) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Load the indicators this->nb for the state board + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function loadStateBoard() + { + } + /** + * Create an array of order lines + * + * @return int >0 if OK, <0 if KO + */ + public function getLinesArray() + { + } + /** + * Create a document onto disk according to template module. + * + * @param string $modele Force template to use ('' to not force) + * @param Translate $outputlangs object lang a utiliser pour traduction + * @param int $hidedetails Hide details of lines + * @param int $hidedesc Hide description + * @param int $hideref Hide ref + * @param null|array $moreparams Array to provide more information + * @return int 0 if KO, 1 if OK + */ + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = \null) + { + } + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty(\DoliDB $dbs, $origin_id, $dest_id) + { + } + /** + * Function used to replace a product id with another one. + * + * @param DoliDB $db Database handler + * @param int $origin_id Old product id + * @param int $dest_id New product id + * @return bool + */ + public static function replaceProduct(\DoliDB $db, $origin_id, $dest_id) + { + } + /** + * Is the sales order delayed? + * + * @return bool true if late, false if not + */ + public function hasDelay() + { + } + /** + * Show the customer delayed info + * + * @return string Show delayed information + */ + public function showDelay() + { + } + /** + * Set signed status + * + * @param User $user Object user that modify + * @param int $status Newsigned status to set (often a constant like self::STATUS_XXX) + * @param int $notrigger 1 = Does not execute triggers, 0 = Execute triggers + * @param string $triggercode Trigger code to use + * @return int 0 < if KO, > 0 if OK + */ + public function setSignedStatus(\User $user, int $status = 0, int $notrigger = 0, $triggercode = '') : int + { + } + } + /** + * Class to manage order statistics (customer and supplier) + */ + class CommandeStats extends \Stats + { + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; + public $socid; + public $userid; + public $from; + public $from_line; + public $field; + public $field_line; + public $categ_link; + public $where = ''; + public $join; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. + * @param string $mode Option ('customer', 'supplier') + * @param int $userid Id user for filter (creation user) + * @param int $typentid Id typent of thirdpary for filter + * @param int $categid Id category of thirdpary for filter + */ + public function __construct($db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0) + { + } + /** + * Return orders number by month for a year + * + * @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 + */ + public function getNbByMonth($year, $format = 0) + { + } + /** + * Return orders number per year + * + * @return array Array with number by year + * + */ + public function getNbByYear() + { + } + /** + * Return the orders amount by month for a year + * + * @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 + */ + public function getAmountByMonth($year, $format = 0) + { + } + /** + * Return the orders amount average by month for a year + * + * @param int $year year for stats + * @return array array with number by month + */ + public function getAverageByMonth($year) + { + } + /** + * Return nb, total and average + * + * @return array Array of values + */ + public function getAllByYear() + { + } + /** + * Return nb, amount of predefined product for year + * + * @param int $year Year to scan + * @param int $limit Limit + * @return array Array of values + */ + public function getAllByProduct($year, $limit = 10) + { + } + } + /** + * Superclass for orders classes + */ + abstract class CommonOrderLine extends \CommonObjectLine + { + /** + * Custom label of line. Not used by default. + * @deprecated + */ + public $label; + /** + * Product ref + * @var string + * @deprecated Use product_ref + * @see $product_ref + */ + public $ref; + /** + * Product label + * @var string + * @deprecated Use product_label + * @see $product_label + */ + public $libelle; + /** + * Product ref + * @var string + */ + public $product_ref; + /** + * Product label + * @var string + */ + public $product_label; + /** + * Boolean that indicates whether the product is available for sale '1' or not '0' + * @var int + */ + public $product_tosell = 0; + /** + * Boolean that indicates whether the product is available for purchase '1' or not '0' + * @var int + */ + public $product_tobuy = 0; + /** + * Product description + * @var string + */ + public $product_desc; + /** + * Product use lot + * @var string + */ + public $product_tobatch; + /** + * Product barcode + * @var string + */ + public $product_barcode; + /** + * Quantity + * @var float + */ + public $qty; + /** + * Unit price + * @deprecated + * @see $subprice + */ + public $price; + /** + * Unit price before taxes + * @var float + */ + public $subprice; + /** + * Type of the product. 0 for product 1 for service + * @var int + */ + public $product_type = 0; + /** + * Id of corresponding product + * @var int + */ + public $fk_product; + /** + * Percent line discount + * @var float|string + */ + public $remise_percent; + /** + * VAT code + * @var string + */ + public $vat_src_code; + /** + * VAT % + * @var float|string + */ + public $tva_tx; + /** + * Local tax 1 % + * @var float + */ + public $localtax1_tx; + /** + * Local tax 2 % + * @var float + */ + public $localtax2_tx; + public $localtax1_type; + public $localtax2_type; + /** + * Liste d'options cumulables: + * Bit 0: 0 si TVA normal - 1 si TVA NPR + * Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except) + * @var int + */ + public $info_bits = 0; + /** + * @var int special code + */ + public $special_code = 0; + public $fk_multicurrency; + public $multicurrency_code; + public $multicurrency_subprice; + public $multicurrency_total_ht; + public $multicurrency_total_tva; + public $multicurrency_total_ttc; + } + /** + * Class to manage order lines + */ + class OrderLine extends \CommonOrderLine + { + /** + * @var string ID to identify managed object + */ + public $element = 'commandedet'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'commandedet'; + /** + * @var OrderLine + */ + public $oldline; + /** + * Id of parent order + * @var int + */ + public $fk_commande; + /** + * Id of parent order + * @var int + * @deprecated Use fk_commande + * @see $fk_commande + */ + public $commande_id; + /** + * @var int + */ + public $fk_parent_line; + /** + * @var int Id of invoice + */ + public $fk_facture; + /** + * @var string External ref + */ + public $ref_ext; + /** + * @var int + */ + public $fk_remise_except; + /** + * @var int line rank + */ + public $rang = 0; + /** + * @var int + */ + public $fk_fournprice; + /** + * Buy price without taxes + * @var float + */ + public $pa_ht; + /** + * @var int|float|string + */ + public $marge_tx; + /** + * @var float|string + */ + public $marque_tx; + /** + * @var float|string + * @deprecated + * @see $remise_percent, $fk_remise_except + */ + public $remise; + /** + * Start date of line + * @var int|string + */ + public $date_start; + /** + * End date of line + * @var int|string + */ + public $date_end; + /** + * Skip update price total for special lines + * @var int + */ + public $skip_update_total; + /** + * Constructor + * + * @param DoliDB $db handler d'acces base de donnee + */ + public function __construct($db) + { + } + /** + * Load line order + * + * @param int $rowid Id line order + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($rowid) + { + } + /** + * Delete line in database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 si ko, >0 si ok + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Insert line into database + * + * @param User $user User that modify + * @param int $notrigger 1 = disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function insert($user = \null, $notrigger = 0) + { + } + /** + * Update the line object into db + * + * @param User $user User that modify + * @param int $notrigger 1 = disable triggers + * @return int Return integer <0 si ko, >0 si ok + */ + public function update(\User $user, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update DB line fields total_xxx + * Used by migration + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function update_total() + { + } + } + /** + * Class to manage bank accounts + */ + class Account extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'bank_account'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'bank_account'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'account'; + /** + * @var int Use id instead of rowid + * @deprecated + * @see $id + */ + public $rowid; + /** + * Account Label + * @var string + */ + public $label; + /** + * Bank account type. Check TYPE_ constants + * @var int + * @deprecated + * @see $type + */ + public $courant; + /** + * Bank account type. Check TYPE_ constants. It's integer but Company bank account use string to identify type account + * @var int|string + */ + public $type; + /** + * Bank name + * @var string + */ + public $bank; + /** + * Status closed + * + * @var int + * @deprecated Duplicate field. We already have the field $this->status + * @see $status + */ + public $clos = self::STATUS_OPEN; + /** + * Does it need to be conciliated? + * @var int + */ + public $rappro = 1; + /** + * Webpage + * @var string + */ + public $url; + /** + * Bank number. If in SEPA area, you should move to IBAN field + * @var string + */ + public $code_banque; + /** + * Branch number. If in SEPA area, you should move to IBAN field + * @var string + */ + public $code_guichet; + /** + * Account number. If in SEPA area, you should move to IBAN field + * @var string + */ + public $number; + /** + * Bank account number control digit. If in SEPA area, you should move to IBAN field + * @var string + */ + public $cle_rib; + /** + * BIC/Swift code + * @var string + */ + public $bic; + /** + * IBAN number (International Bank Account Number). Stored into iban_prefix field into database (TODO Rename field in database) + * @var string + */ + public $iban; + /** + * IBAN number + * + * @var string + * @deprecated see $iban + */ + public $iban_prefix; + /** + * XML SEPA format: place Payment Type Information (PmtTpInf) in Credit Transfer Transaction Information (CdtTrfTxInf) + * @var int + */ + public $pti_in_ctti = 0; + /** + * Name of account holder + * @var string + * @deprecated + * @see $owner_name + */ + public $proprio; + /** + * Name of account holder + * @var string + */ + public $owner_name; + /** + * Address of account holder + * @var string + */ + public $owner_address; + /** + * Zip of account holder + * @var string + */ + public $owner_zip; + /** + * Town of account holder + * @var string + */ + public $owner_town; + public $owner_country_id; + public $owner_country_code; + /** + * Address of the bank account + * @var string + * @deprecated + * @see $address + */ + public $domiciliation; + /** + * Address of the bank account + * @var string + */ + public $address; + public $state_id; + public $state_code; + public $state; + public $country_id; + /** + * Variable containing all account types with their respective translated label. + * Defined in __construct + * @var array + */ + public $type_lib = array(); + /** + * Accountancy code + * @var string + */ + public $account_number; + /** + * @var int ID + */ + public $fk_accountancy_journal; + /** + * @var string Label of journal + */ + public $accountancy_journal; + /** + * Currency code + * @var string + */ + public $currency_code; + /** + * Currency code + * @var string + * @deprecated Use currency_code instead + * @see $currency_code + */ + public $account_currency_code; + /** + * Authorized minimum balance + * @var float + */ + public $min_allowed; + /** + * Desired minimum balance + * @var float + */ + public $min_desired; + /** + * Notes + * @var string + */ + public $comment; + /** + * Date of the initial balance. Used in Account::create + * @var int + */ + public $date_solde; + /** + * Balance. Used in Account::create + * @var float + * @deprecated + * @see $balance + */ + public $solde; + /** + * Balance. Used in Account::create + * @var float + */ + public $balance; + /** + * Creditor Identifier CI. Some banks use different ICS for direct debit and bank transfer + * @var string + */ + public $ics; + /** + * Creditor Identifier for Bank Transfer. + * @var string + */ + public $ics_transfer; + /** + * @var string The previous ref in case of rename on update to rename attachment folders + */ + public $oldref; + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), 'ref' => array('type' => 'varchar(12)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 25), 'label' => array('type' => 'varchar(30)', 'label' => 'Label', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 30), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 35, 'index' => 1), 'bank' => array('type' => 'varchar(60)', 'label' => 'Bank', 'enabled' => 1, 'visible' => -1, 'position' => 40), 'code_banque' => array('type' => 'varchar(128)', 'label' => 'Code banque', 'enabled' => 1, 'visible' => -1, 'position' => 45), 'code_guichet' => array('type' => 'varchar(6)', 'label' => 'Code guichet', 'enabled' => 1, 'visible' => -1, 'position' => 50), 'number' => array('type' => 'varchar(255)', 'label' => 'Number', 'enabled' => 1, 'visible' => -1, 'position' => 55), 'cle_rib' => array('type' => 'varchar(5)', 'label' => 'Cle rib', 'enabled' => 1, 'visible' => -1, 'position' => 60), 'bic' => array('type' => 'varchar(11)', 'label' => 'Bic', 'enabled' => 1, 'visible' => -1, 'position' => 65), 'iban_prefix' => array('type' => 'varchar(34)', 'label' => 'Iban prefix', 'enabled' => 1, 'visible' => -1, 'position' => 70), 'country_iban' => array('type' => 'varchar(2)', 'label' => 'Country iban', 'enabled' => 1, 'visible' => -1, 'position' => 75), 'cle_iban' => array('type' => 'varchar(2)', 'label' => 'Cle iban', 'enabled' => 1, 'visible' => -1, 'position' => 80), 'domiciliation' => array('type' => 'varchar(255)', 'label' => 'Domiciliation', 'enabled' => 1, 'visible' => -1, 'position' => 85), 'state_id' => array('type' => 'integer', 'label' => 'StateId', 'enabled' => 1, 'visible' => -1, 'position' => 90), 'fk_pays' => array('type' => 'integer', 'label' => 'Country', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 95), 'proprio' => array('type' => 'varchar(60)', 'label' => 'Proprio', 'enabled' => 1, 'visible' => -1, 'position' => 100), 'owner_address' => array('type' => 'varchar(255)', 'label' => 'Owner address', 'enabled' => 1, 'visible' => -1, 'position' => 105), 'owner_zip' => array('type' => 'varchar(25)', 'label' => 'Owner zip', 'enabled' => 1, 'visible' => -1, 'position' => 106), 'owner_town' => array('type' => 'varchar(50)', 'label' => 'Owner town', 'enabled' => 1, 'visible' => -1, 'position' => 107), 'owner_country_id' => array('type' => 'integer', 'label' => 'Owner country', 'enabled' => 1, 'visible' => -1, 'position' => 108), 'courant' => array('type' => 'smallint(6)', 'label' => 'Courant', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 110), 'clos' => array('type' => 'smallint(6)', 'label' => 'Clos', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 115), 'rappro' => array('type' => 'smallint(6)', 'label' => 'Rappro', 'enabled' => 1, 'visible' => -1, 'position' => 120), 'url' => array('type' => 'varchar(128)', 'label' => 'Url', 'enabled' => 1, 'visible' => -1, 'position' => 125), 'account_number' => array('type' => 'varchar(32)', 'label' => 'Account number', 'enabled' => 1, 'visible' => -1, 'position' => 130), 'fk_accountancy_journal' => array('type' => 'integer', 'label' => 'Accountancy journal ID', 'enabled' => 1, 'visible' => -1, 'position' => 132), 'accountancy_journal' => array('type' => 'varchar(20)', 'label' => 'Accountancy journal', 'enabled' => 1, 'visible' => -1, 'position' => 135), 'currency_code' => array('type' => 'varchar(3)', 'label' => 'Currency code', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 140), 'min_allowed' => array('type' => 'integer', 'label' => 'Min allowed', 'enabled' => 1, 'visible' => -1, 'position' => 145), 'min_desired' => array('type' => 'integer', 'label' => 'Min desired', 'enabled' => 1, 'visible' => -1, 'position' => 150), 'comment' => array('type' => 'text', 'label' => 'Comment', 'enabled' => 1, 'visible' => -1, 'position' => 155), 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 156), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 157), 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 160), 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 165), 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 170), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 175), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 180), 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 185)); + // END MODULEBUILDER PROPERTIES + /** + * Current account + */ + const TYPE_CURRENT = 1; + /** + * Cash account + */ + const TYPE_CASH = 2; + /** + * Savings account + */ + const TYPE_SAVINGS = 0; + const STATUS_OPEN = 0; + const STATUS_CLOSED = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Shows the account number in the appropriate format + * + * @return string + */ + public function __toString() + { + } + /** + * Return if a bank account need to be conciliated + * + * @return int 1 if need to be concialiated, < 0 otherwise. + */ + public function canBeConciliated() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Add a link between bank line record and its source + * + * @param int $line_id Id of bank entry + * @param int $url_id Id of object related to link + * @param string $url Url (deprecated, we use now 'url_id' and 'type' instead) + * @param string $label Link label + * @param string $type Type of link ('payment', 'company', 'member', ...) + * @return int Return integer <0 if KO, id line if OK + */ + public function add_url_line($line_id, $url_id, $url, $label, $type) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * TODO Move this into AccountLine + * Return array with links from llx_bank_url + * + * @param int $fk_bank To search using bank transaction id + * @param int $url_id To search using link to + * @param string $type To search using type + * @return array|int Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error + */ + public function get_url($fk_bank = 0, $url_id = 0, $type = '') + { + } + /** + * Add an entry into table ".MAIN_DB_PREFIX."bank + * + * @param int $date Date operation + * @param string $oper 'VIR','PRE','LIQ','VAD','CB','CHQ'... + * @param string $label Description + * @param float $amount Amount + * @param string $num_chq Numero cheque or transfer + * @param int $categorie Category id (optional) + * @param User $user User that create + * @param string $emetteur Name of cheque writer + * @param string $banque Bank of cheque writer + * @param string $accountancycode When we record a free bank entry, we must provide accounting account if accountancy module is on. + * @param int $datev Date value + * @param string $num_releve Label of bank receipt for reconciliation + * @param float $amount_main_currency Amount + * @return int Rowid of added entry, <0 if KO + */ + public function addline($date, $oper, $label, $amount, $num_chq, $categorie, \User $user, $emetteur = '', $banque = '', $accountancycode = '', $datev = \null, $num_releve = '', $amount_main_currency = \null) + { + } + /** + * Create bank account into database + * + * @param User $user Object user making creation + * @param int $notrigger 1=Disable triggers + * @return int Return integer < 0 if KO, > 0 if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Update bank account card + * + * @param User $user Object user making action + * @param int $notrigger 1=Disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update BBAN (RIB) account fields + * + * @param User|null $user Object user making update + * @return int Return integer <0 if KO, >0 if OK + */ + public function update_bban(\User $user = \null) + { + } + /** + * Load a bank account into memory from database + * + * @param int $id Id of bank account to get + * @param string $ref Ref of bank account to get + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $ref = '') + { + } + /** + * Sets object to supplied categories. + * + * Deletes object from existing categories not supplied. + * Adds it to non existing supplied categories. + * Existing categories are left untouch. + * + * @param int[]|int $categories Category or categories IDs + * @return int Return integer <0 if KO, >0 if OK + */ + public function setCategories($categories) + { + } + /** + * Delete bank account from database + * + * @param User|null $user User deleting + * @param int $notrigger 1=Disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user = \null, $notrigger = 0) + { + } + /** + * Return label of object status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto + * @return string Label + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return label of given object status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto + * @return string Label + */ + public function LibStatut($status, $mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Indicates if an account can be deleted or not (without movements) + * + * @return boolean True is the deletion is ok, false if not + */ + public function can_be_deleted() + { + } + /** + * Return error + * + * @return string Error string + */ + public function error() + { + } + /** + * Return current balance + * + * @param int $option 1=Exclude future operation date (this is to exclude input made in advance and have real account sold) + * @param int|string $date_end Date until we want to get bank account balance + * @param string $field 'dateo' or 'datev' + * @return float|-1 current balance (value date <= today), or -1 if error + */ + public function solde($option = 0, $date_end = '', $field = 'dateo') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @param int $filteraccountid To get info for a particular account id + * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK + */ + public function load_board(\User $user, $filteraccountid = 0) + { + } + /** + * Load the indicators this->nb for the state board + * + * @param int $filteraccountid To get info for a particular account id + * @return int Return integer <0 if KO, >0 if OK + */ + public function loadStateBoard($filteraccountid = 0) + { + } + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @return int Nb of account we can reconciliate + */ + public function countAccountToReconcile() + { + } + /** + * getTooltipContentArray + * + * @param array $params Params to construct tooltip data + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int $withpicto Include picto into link + * @param string $mode ''=Link to card, 'transactions'=Link to transactions card + * @param string $option ''=Show ref, 'reflabel'=Show ref+label + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0, $mode = '', $option = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = '') + { + } + // Method after here are common to Account and CompanyBankAccount + /** + * Return if an account has valid information for Direct debit payment + * + * @return int 1 if correct, <=0 if wrong + */ + public function verif() + { + } + /** + * Return account country code + * + * @return string country code + */ + public function getCountryCode() + { + } + /** + * Return full address for banner + * + * @param string $htmlkey HTML id to make banner content unique + * @param Object $object Object (thirdparty, thirdparty of contact for contact, null for a member) + * @return string Full address string + */ + public function getBannerAddress($htmlkey, $object) + { + } + /** + * Return if a bank account is defined with detailed information (bank code, desk code, number and key). + * More information on codes used by countries on page http://en.wikipedia.org/wiki/Bank_code + * + * @return int 0=No bank code need + Account number is enough + * 1=Need 2 fields for bank code: Bank, Desk (France, Spain, ...) + Account number and key + * 2=Need 1 field for bank code: Bank only (Sort code for Great Britain, BSB for Australia) + Account number + */ + public function useDetailedBBAN() + { + } + /** + * Return 1 if IBAN is mandatory (otherwise option) + * + * @return int 1 = mandatory / 0 = Not mandatory + */ + public function needIBAN() + { + } + /** + * Return 1 if BIC is mandatory (otherwise option) + * + * @return int 1 = mandatory / 0 = Not mandatory + */ + public function needBIC() + { + } + /** + * Load miscellaneous information for tab "Info" + * + * @param int $id Id of object to load + * @return void + */ + public function info($id) + { + } + /** + * Returns the fields in order that this bank account should show to the user + * Will return an array with the following values: + * - BankAccountNumber + * - BankCode + * - BankAccountNumberKey + * - DeskCode + * + * Some countries show less or more bank account properties to the user + * + * @param int $includeibanbic 1=Return also key for IBAN and BIC + * @return array Array of fields to show + * @see useDetailedBBAN() + */ + public function getFieldsToShow($includeibanbic = 0) + { + } + /** + * Returns the components of the bank account in order. + * Will return an array with the following values: + * - BankAccountNumber + * - BankCode + * - BankAccountNumberKey + * - DeskCode + * + * @return array + */ + public static function getAccountNumberOrder() + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $dbs Database handler + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool True=SQL success, False=SQL error + */ + public static function replaceThirdparty($dbs, $origin_id, $dest_id) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /** + * Class to manage bank transaction lines + */ + class AccountLine extends \CommonObjectLine + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string ID to identify managed object + */ + public $element = 'bank'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'bank'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'accountline'; + /** + * @var int ID + */ + public $id; + /** + * @var string Ref + */ + public $ref; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + /** + * Date (dateo) + * + * @var integer + */ + public $dateo; + /** + * Date value (datev) + * + * @var integer + */ + public $datev; + /** + * @var float Amount of payment in the bank account currency + */ + public $amount; + /** + * @var float Amount in the currency of company if bank account use another currency + */ + public $amount_main_currency; + /** + * @var int ID + */ + public $fk_user_author; + /** + * @var int ID + */ + public $fk_user_rappro; + /** + * @var string Type of operation (ex: "SOLD", "VIR", "CHQ", "CB", "PPL") + */ + public $fk_type; + /** + * @var int ID of cheque receipt + */ + public $fk_bordereau; + /** + * @var int ID of bank account + */ + public $fk_account; + /** + * @var string Ref of bank account + */ + public $bank_account_ref; + /** + * @var string Label of bank account + */ + public $bank_account_label; + /** + * @var string Bank account numero + */ + public $numero_compte; + /** + * @var string Name of check issuer + */ + public $emetteur; + /** + * @var int<0,1> 1 if the line has been reconciled, 0 otherwise + */ + public $rappro; + /** + * @var string Name of the bank statement (if the line has been reconciled) + */ + public $num_releve; + /** + * @var string Cheque number + */ + public $num_chq; + /** + * @var string Bank name of the cheque + */ + public $bank_chq; + /** + * @var string Label of the bank transaction line + */ + public $label; + /** + * @var string Note + */ + public $note; + /** + * User author of the reconciliation + * TODO: variable used only by method info() => is it the same as $fk_user_rappro ? + */ + public $user_rappro; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Load into memory content of a bank transaction line + * + * @param int $rowid Id of bank transaction to load + * @param string $ref Ref of bank transaction to load + * @param string $num External num to load (ex: num of transaction for paypal fee) + * @return int Return integer <0 if KO, 0 if OK but not found, >0 if OK and found + */ + public function fetch($rowid, $ref = '', $num = '') + { + } + /** + * Inserts a transaction to a bank account + * + * @return int Return integer <0 if KO, rowid of the line if OK + */ + public function insert() + { + } + /** + * Delete bank transaction record + * + * @param User|null $user User object that delete + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user = \null, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Delete bank line records + * + * @param User|null $user User object that delete + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete_urls(\User $user = \null) + { + } + /** + * Update bank account record in database + * + * @param User $user Object user making update + * @param int $notrigger 0=Disable all triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Update bank account record label in database + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function updateLabel() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update conciliation field + * + * @param User $user Object user making update + * @param int $cat Category id + * @param int $conciliated 1=Set transaction to conciliated, 0=Keep transaction non conciliated + * @return int Return integer <0 if KO, >0 if OK + */ + public function update_conciliation(\User $user, $cat, $conciliated = 1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Increase/decrease value date of a rowid + * + * @param int $rowid Id of line + * @param int $sign 1 or -1 + * @return int >0 if OK, 0 if KO + */ + public function datev_change($rowid, $sign = 1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Increase value date of a rowid + * + * @param int $id Id of line to change + * @return int >0 if OK, 0 if KO + */ + public function datev_next($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Decrease value date of a rowid + * + * @param int $id Id of line to change + * @return int >0 if OK, 0 if KO + */ + public function datev_previous($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Increase/decrease operation date of a rowid + * + * @param int $rowid Id of line + * @param int $sign 1 or -1 + * @return int >0 if OK, 0 if KO + */ + public function dateo_change($rowid, $sign = 1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Increase operation date of a rowid + * + * @param int $id Id of line to change + * @return int >0 if OK, 0 if KO + */ + public function dateo_next($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Decrease operation date of a rowid + * + * @param int $id Id of line to change + * @return int >0 if OK, 0 if KO + */ + public function dateo_previous($id) + { + } + /** + * Load miscellaneous information for tab "Info" + * + * @param int $id Id of object to load + * @return void + */ + public function info($id) + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $maxlen Longueur max libelle + * @param string $option Option ('', 'showall', 'showconciliated', 'showconciliatedandaccounted'). Options may be slow. + * @param int $notooltip 1=Disable tooltip + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0, $maxlen = 0, $option = '', $notooltip = 0) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Return if a bank line was dispatched into bookkeeping + * + * @return int Return integer <0 if KO, 0=no, 1=yes + */ + public function getVentilExportCompta() + { + } + } + /** + * API class for accounts + * + * @property DoliDB $db + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ + class BankAccounts extends \DolibarrApi + { + /** + * array $FIELDS Mandatory fields, checked when creating an object + */ + public static $FIELDS = array('ref', 'label', 'type', 'currency_code', 'country_id'); + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get the list of accounts. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param int $category Use this param to filter list by category + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @return array List of account objects + * + * @throws RestException + */ + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '', $properties = '') + { + } + /** + * Get account by ID. + * + * @param int $id ID of account + * @return Object Object with cleaned properties + * + * @throws RestException + */ + public function get($id) + { + } + /** + * Create account object + * + * @param array $request_data Request data + * @return int ID of account + */ + public function post($request_data = \null) + { + } + /** + * Create an internal wire transfer between two bank accounts + * + * @param int $bankaccount_from_id BankAccount ID to use as the source of the internal wire transfer {@from body}{@required true} + * @param int $bankaccount_to_id BankAccount ID to use as the destination of the internal wire transfer {@from body}{@required true} + * @param string $date Date of the internal wire transfer (UNIX timestamp) {@from body}{@required true}{@type timestamp} + * @param string $description Description of the internal wire transfer {@from body}{@required true} + * @param float $amount Amount to transfer from the source to the destination BankAccount {@from body}{@required true} + * @param float $amount_to Amount to transfer to the destination BankAccount (only when accounts does not share the same currency) {@from body}{@required false} + * @param string $cheque_number Cheque numero {@from body}{@required false} + * + * @url POST /transfer + * + * @return array + * + * @status 201 + * + * @throws RestException 401 Unauthorized: User does not have permission to configure bank accounts + * @throws RestException 404 Not Found: Either the source or the destination bankaccount for the provided id does not exist + * @throws RestException 422 Unprocessable Entity: Refer to detailed exception message for the cause + * @throws RestException 500 Internal Server Error: Error(s) returned by the RDBMS + */ + public function transfer($bankaccount_from_id = 0, $bankaccount_to_id = 0, $date = \null, $description = "", $amount = 0.0, $amount_to = 0.0, $cheque_number = "") + { + } + /** + * Update account + * + * @param int $id ID of account + * @param array $request_data data + * @return Object Object with cleaned properties + */ + public function put($id, $request_data = \null) + { + } + /** + * Delete account + * + * @param int $id ID of account + * @return array + */ + public function delete($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensible object datas + * + * @param Object $object Object to clean + * @return Object Object with cleaned properties + */ + protected function _cleanObjectDatas($object) + { + } + /** + * Get the list of lines of the account. + * + * @param int $id ID of account + * @return array Array of AccountLine objects + * + * @throws RestException + * + * @url GET {id}/lines + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')" + */ + public function getLines($id, $sqlfilters = '') + { + } + /** + * Add a line to an account + * + * @param int $id ID of account + * @param string $date Payment date (timestamp) {@from body} {@type timestamp} + * @param string $type Payment mode (TYP,VIR,PRE,LIQ,VAD,CB,CHQ...) {@from body} + * @param string $label Label {@from body} + * @param float $amount Amount (may be 0) {@from body} + * @param int $category Category + * @param string $cheque_number Cheque numero {@from body} + * @param string $cheque_writer Name of cheque writer {@from body} + * @param string $cheque_bank Bank of cheque writer {@from body} + * @param string $accountancycode Accountancy code {@from body} + * @param string $datev Payment date value (timestamp) {@from body} {@type timestamp} + * @param string $num_releve Bank statement numero {@from body} + * @return int ID of line + * + * @url POST {id}/lines + */ + public function addLine($id, $date, $type, $label, $amount, $category = 0, $cheque_number = '', $cheque_writer = '', $cheque_bank = '', $accountancycode = '', $datev = \null, $num_releve = '') + { + } + /** + * Add a link to an account line + * + * @param int $id ID of account + * @param int $line_id ID of account line + * @param int $url_id ID to set in the URL {@from body} + * @param string $url URL of the link {@from body} + * @param string $label Label {@from body} + * @param string $type Type of link ('payment', 'company', 'member', ...) {@from body} + * @return int ID of link + * + * @url POST {id}/lines/{line_id}/links + */ + public function addLink($id, $line_id, $url_id, $url, $label, $type) + { + } + /** + * Get the list of links for a line of the account. + * + * @param int $id ID of account + * @param int $line_id ID of account line + * @return array Array of links + * + * @throws RestException + * + * @url GET {id}/lines/{line_id}/links + * + */ + public function getLinks($id, $line_id) + { + } + /** + * Update an account line + * + * @param int $id ID of account + * @param int $line_id ID of account line + * @param string $label Label {@from body} + * @return int ID of link + * + * @url PUT {id}/lines/{line_id} + */ + public function updateLine($id, $line_id, $label) + { + } + /** + * Delete an account line + * + * @param int $id ID of account + * @param int $line_id ID of account line + * @return array + * + * @url DELETE {id}/lines/{line_id} + */ + public function deleteLine($id, $line_id) + { + } + } + /* Copyright (C) 2008 Laurent Destailleur + * Copyright (C) 2009 Regis Houssin + * Copyright (C) 2016 Marcos García + * Copyright (C) 2024 Frédéric France + * + * 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 . + */ + /** + * \file compta/bank/class/bankcateg.class.php + * \ingroup bank + * \brief This file is CRUD class file (Create/Read/Update/Delete) for bank categories + */ + /** + * Class to manage bank categories + */ + class BankCateg + { + //public $element='category_bank'; //!< Id that identify managed objects + //public $table_element='category_bank'; //!< Name of table without prefix where object is stored + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'generic'; + /** + * @var int ID + */ + public $id; + /** + * @var string bank categories label + */ + public $label; + /** + * @var DoliDB + */ + protected $db; + /** + * @var string error + */ + public $error; + /** + * @var array errors + */ + public $errors; + /** + * @var array context + */ + public $context; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create in database + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id object + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id) + { + } + /** + * Update database + * + * @param User|null $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user = \null, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $user User making the clone + * @param int $fromid Id of object to clone + * @return int New id of clone + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Returns all bank categories + * + * @return BankCateg[] + */ + public function fetchAll() + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + } + /** + * Class to manage various payments + */ + class PaymentVarious extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'payment_various'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'payment_various'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'payment'; + /** + * @var int ID + */ + public $id; + /** + * @var string Ref + */ + public $ref; + /** + * @var int timestamp + */ + public $datep; + /** + * @var int timestamp + */ + public $datev; + /** + * @var int<0,1> Payment direction (debit or credit) + */ + public $sens; + /** + * @var float + */ + public $amount; + /** + * @var int Payment type (fk_typepayment) + */ + public $type_payment; + /** + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") + */ + public $num_payment; + /** + * @var string Name of cheque writer + */ + public $chqemetteur; + /** + * @var string Bank of cheque writer + */ + public $chqbank; + /** + * @var int Category id + */ + public $category_transaction; + /** + * @var string various payments label + */ + public $label; + /** + * @var string accountancy code + */ + public $accountancy_code; + /** + * @var string subledger account + */ + public $subledger_account; + /** + * @var int ID + */ + public $fk_project; + /** + * @var int Bank account ID + */ + public $fk_account; + /** + * @var int Bank account ID + * @deprecated See fk_account + */ + public $accountid; + /** + * @var int ID record into llx_bank + */ + public $fk_bank; + /** + * @var int transaction category + */ + public $categorie_transaction; + /** + * @var int ID + */ + public $fk_user_author; + /** + * @var int ID + */ + public $fk_user_modif; + /** + * @var int Type of bank account if the payment is on a bank account + */ + public $fk_type; + /** + * @var int 1 if the payment is on a bank account line that is conciliated + */ + public $rappro; + /** + * @var string ID of bank receipt + */ + public $bank_num_releve; + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")' + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array(); + // END MODULEBUILDER PROPERTIES + /** + * Draft status + */ + const STATUS_DRAFT = 0; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=no, 1=yes (no update trigger) + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id id object + * @param User $user User that load + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $user = \null) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Check if a miscellaneous payment can be created into database + * + * @return boolean True or false + */ + public function check() + { + } + /** + * Create in database + * + * @param User $user User that create + * @return int Return integer <0 if KO, >0 if OK + */ + public function create($user) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update link between payment various and line generate into llx_bank + * + * @param int $id_bank Id bank account + * @return int Return integer <0 if KO, >0 if OK + */ + public function update_fk_bank($id_bank) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Send name clickable (with possibly the picto) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param string $option link option + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $notooltip 1=Disable tooltip + * @param string $morecss morecss string + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = '') + { + } + /** + * Information on record + * + * @param int $id Id of record + * @return void + */ + public function info($id) + { + } + /** + * Return if a various payment linked to a bank line id was dispatched into bookkeeping + * + * @return int Return integer <0 if KO, 0=no, 1=yes + */ + public function getVentilExportCompta() + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + /** + * Return General accounting account with defined length (used for product and miscellaneous) + * + * @param string $account General accounting account + * @return string String with defined length + */ + public function lengthAccountg($account) + { + } + /** + * Return Auxiliary accounting account of thirdparties with defined length + * + * @param string $account Auxiliary accounting account + * @return string String with defined length + */ + public function lengthAccounta($account) + { + } + } + /* Copyright (C) 2008 Laurent Destailleur + * Copyright (C) 2009 Regis Houssin + * Copyright (C) 2016 Marcos García + * Copyright (C) 2018 Andreu Bisquerra + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * + * 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 . + */ + /** + * \file htdocs/compta/cashcontrol/class/cashcontrol.class.php + * \ingroup cashdesk|takepos + * \brief This file is CRUD class file (Create/Read/Update/Delete) for cash fence table + */ + /** + * Class to manage cash fence + */ + class CashControl extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'cashcontrol'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'pos_cash_fence'; + /** + * @var string String with name of icon for pos_cash_fence. Must be the part after the 'object_' into object_pos_cash_fence.png + */ + public $picto = 'cash-register'; + /** + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")' + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 10), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 15), 'ref' => array('type' => 'varchar(64)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 18), 'posmodule' => array('type' => 'varchar(30)', 'label' => 'Module', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 19), 'posnumber' => array('type' => 'varchar(30)', 'label' => 'Terminal', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 20, 'css' => 'center'), 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'visible' => 0, 'position' => 24), 'opening' => array('type' => 'price', 'label' => 'Opening', 'enabled' => 1, 'visible' => 1, 'position' => 25, 'csslist' => 'amount'), 'cash' => array('type' => 'price', 'label' => 'Cash', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'csslist' => 'amount'), 'cheque' => array('type' => 'price', 'label' => 'Cheque', 'enabled' => 1, 'visible' => 1, 'position' => 33, 'csslist' => 'amount'), 'card' => array('type' => 'price', 'label' => 'CreditCard', 'enabled' => 1, 'visible' => 1, 'position' => 36, 'csslist' => 'amount'), 'year_close' => array('type' => 'integer', 'label' => 'Year close', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 50, 'css' => 'center'), 'month_close' => array('type' => 'integer', 'label' => 'Month close', 'enabled' => 1, 'visible' => 1, 'position' => 55, 'css' => 'center'), 'day_close' => array('type' => 'integer', 'label' => 'Day close', 'enabled' => 1, 'visible' => 1, 'position' => 60, 'css' => 'center'), 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 500), 'date_valid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 502), 'tms' => array('type' => 'timestamp', 'label' => 'Tms', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 505), 'fk_user_creat' => array('type' => 'integer:User', 'label' => 'UserCreation', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 600), 'fk_user_valid' => array('type' => 'integer:User', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 602), 'import_key' => array('type' => 'varchar(14)', 'label' => 'Import key', 'enabled' => 1, 'visible' => 0, 'position' => 700), 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 1000, 'notnull' => 1, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated'))); + /** + * @var int Object Id + */ + public $id; + public $label; + public $opening; + public $status; + public $year_close; + public $month_close; + public $day_close; + public $posmodule; + public $posnumber; + public $cash; + public $cheque; + public $card; + public $fk_user_creat; + /** + * @var int|string $date_valid + */ + public $date_valid; + public $fk_user_valid; + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_CLOSED = 1; + // For the moment CLOSED = VALIDATED + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create in database + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Validate cash fence + * + * @param User $user User + * @param int $notrigger No trigger + * @return int Return integer <0 if KO, >0 if OK + */ + public function valid(\User $user, $notrigger = 0) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = \null) + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Return label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param int $withpicto Add picto into link + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /** + * Class to manage trips and working credit notes + */ + class Deplacement extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'deplacement'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'deplacement'; + /** + * @var string Name of subtable line + */ + public $table_element_line = ''; + /** + * @var string Fieldname with ID of parent key if this field has a parent + */ + public $fk_element = ''; + public $fk_soc; + public $date; + public $type; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + /** + * Date (dated) + * + * @var integer + */ + public $dated; + /** + * @var int ID + */ + public $fk_user_author; + /** + * @var int User ID + */ + public $fk_user; + /** + * @var float km value formatted + */ + public $km; + /** + * @var int Thirdparty id + */ + public $socid; + /** + * @var int Status 0=draft, 1=validated, 2=Refunded + */ + public $statut; + /** + * @var array (Encoded as JSON in database) + */ + public $extraparams = array(); + /** + * Draft status + */ + const STATUS_DRAFT = 0; + /** + * Validated status + */ + const STATUS_VALIDATED = 1; + /** + * Refunded status + */ + const STATUS_REFUNDED = 2; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object in database + * TODO Add ref number + * + * @param User $user User that creates + * @return int Return integer <0 if KO, >0 if OK + */ + public function create($user) + { + } + /** + * Update record + * + * @param User $user User making update + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user) + { + } + /** + * Load an object from database + * + * @param int $id Id of record to load + * @param string $ref Ref of record + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $ref = '') + { + } + /** + * Delete record + * + * @param User $user USer that Delete + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0) + { + } + /** + * List of types + * + * @param int $active Active or not + * @return array + */ + public function listOfTypes($active = 1) + { + } + /** + * Information on record + * + * @param int $id Id of record + * @return void + */ + public function info($id) + { + } + } + /** + * Class to manage the statistics of travel and expense notes + */ + class DeplacementStats extends \Stats + { + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; + public $socid; + public $userid; + public $from; + public $field; + public $where; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param int $socid Id third party + * @param mixed $userid Id user for filter or array of user ids + * @return void + */ + public function __construct($db, $socid = 0, $userid = 0) + { + } + /** + * Renvoie le nombre de facture par annee + * + * @return array Array of values + */ + public function getNbByYear() + { + } + /** + * Renvoie le nombre de facture par mois pour une annee donnee + * + * @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 + */ + public function getNbByMonth($year, $format = 0) + { + } + /** + * Renvoie le montant de facture par mois pour une annee donnee + * + * @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 + */ + public function getAmountByMonth($year, $format = 0) + { + } + /** + * Return average amount + * + * @param int $year Year to scan + * @return array Array of values + */ + public function getAverageByMonth($year) + { + } + /** + * Return nb, total and average + * + * @return array Array of values + */ + public function getAllByYear() + { + } + } + /** + * API class for invoices + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ + class Invoices extends \DolibarrApi + { + /** + * + * @var array $FIELDS Mandatory fields, checked when create and update object + */ + public static $FIELDS = array('socid'); + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get properties of a invoice object + * + * Return an array with invoice information + * + * @param int $id ID of invoice + * @param int $contact_list 0:Return array contains all properties, 1:Return array contains just id, -1: Do not return contacts/adddesses + * @return Object Object with cleaned properties + * + * @throws RestException + */ + public function get($id, $contact_list = 1) + { + } + /** + * Get properties of an invoice object by ref + * + * Return an array with invoice information + * + * @param string $ref Ref of object + * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id, -1: Do not return contacts/adddesses + * @return Object Object with cleaned properties + * + * @url GET ref/{ref} + * + * @throws RestException + */ + public function getByRef($ref, $contact_list = 1) + { + } + /** + * Get properties of an invoice object by ref_ext + * + * Return an array with invoice information + * + * @param string $ref_ext External reference of object + * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id, -1: Do not return contacts/adddesses + * @return Object Object with cleaned properties + * + * @url GET ref_ext/{ref_ext} + * + * @throws RestException + */ + public function getByRefExt($ref_ext, $contact_list = 1) + { + } + /** + * List invoices + * + * Get a list of invoices + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} + * @param string $status Filter by invoice status : draft | unpaid | paid | cancelled + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0 + * @return array Array of invoice objects + * + * @throws RestException 404 Not found + * @throws RestException 503 Error + */ + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '', $pagination_data = \false) + { + } + /** + * Create invoice object + * + * @param array $request_data Request datas + * @return int ID of invoice + */ + public function post($request_data = \null) + { + } + /** + * Create an invoice using an existing order. + * + * @param int $orderid Id of the order + * @return Object Object with cleaned properties + * + * @url POST /createfromorder/{orderid} + * + * @throws RestException 400 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 405 + */ + public function createInvoiceFromOrder($orderid) + { + } + /** + * Create an invoice using a contract. + * + * @param int $contractid Id of the contract + * @return Object Object with cleaned properties + * + * @url POST /createfromcontract/{contractid} + * + * @throws RestException 400 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 405 + */ + public function createInvoiceFromContract($contractid) + { + } + /** + * Get lines of an invoice + * + * @param int $id Id of invoice + * @return array Array of lines + * + * @url GET {id}/lines + */ + public function getLines($id) + { + } + /** + * Update a line to a given invoice + * + * @param int $id Id of invoice to update + * @param int $lineid Id of line to update + * @param array $request_data InvoiceLine data + * @return Object Object with cleaned properties + * + * @url PUT {id}/lines/{lineid} + * + * @throws RestException 304 + * @throws RestException 401 + * @throws RestException 404 Invoice not found + */ + public function putLine($id, $lineid, $request_data = \null) + { + } + /** + * Add a contact type of given invoice + * + * @param int $id Id of invoice to update + * @param int $contactid Id of contact to add + * @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER) + * @return array + * + * @url POST {id}/contact/{contactid}/{type} + * + * @throws RestException 401 + * @throws RestException 404 + */ + public function postContact($id, $contactid, $type) + { + } + /** + * Delete a contact type of given invoice + * + * @param int $id Id of invoice to update + * @param int $contactid Row key of the contact in the array contact_ids. + * @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER). + * @return Object Object with cleaned properties + * + * @url DELETE {id}/contact/{contactid}/{type} + * + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 500 System error + */ + public function deleteContact($id, $contactid, $type) + { + } + /** + * Deletes a line of a given invoice + * + * @param int $id Id of invoice + * @param int $lineid Id of the line to delete + * @return Object Object with cleaned properties + * + * @url DELETE {id}/lines/{lineid} + * + * @throws RestException 400 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 405 + */ + public function deleteLine($id, $lineid) + { + } + /** + * Update invoice + * + * @param int $id Id of invoice to update + * @param array $request_data Datas + * @return Object|false Object with cleaned properties + */ + public function put($id, $request_data = \null) + { + } + /** + * Delete invoice + * + * @param int $id Invoice ID + * @return array + */ + public function delete($id) + { + } + /** + * Add a line to a given invoice + * + * Example of POST query : + * { + * "desc": "Desc", "subprice": "1.00000000", "qty": "1", "tva_tx": "20.000", "localtax1_tx": "0.000", "localtax2_tx": "0.000", + * "fk_product": "1", "remise_percent": "0", "date_start": "", "date_end": "", "fk_code_ventilation": 0, "info_bits": "0", + * "fk_remise_except": null, "product_type": "1", "rang": "-1", "special_code": "0", "fk_parent_line": null, "fk_fournprice": null, + * "pa_ht": "0.00000000", "label": "", "array_options": [], "situation_percent": "100", "fk_prev_id": null, "fk_unit": null + * } + * + * @param int $id Id of invoice + * @param array $request_data InvoiceLine data + * + * @url POST {id}/lines + * + * @return int + * + * @throws RestException 304 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 400 + */ + public function postLine($id, $request_data = \null) + { + } + /** + * Adds a contact to an invoice + * + * @param int $id Order ID + * @param int $fk_socpeople Id of thirdparty contact (if source = 'external') or id of user (if source = 'internal') to link + * @param string $type_contact Type of contact (code). Must a code found into table llx_c_type_contact. For example: BILLING + * @param string $source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user) + * @param int $notrigger Disable all triggers + * + * @url POST {id}/contacts + * + * @return object + * + * @throws RestException 304 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 500 System error + * + */ + public function addContact($id, $fk_socpeople, $type_contact, $source, $notrigger = 0) + { + } + /** + * Sets an invoice as draft + * + * @param int $id Order ID + * @param int $idwarehouse Warehouse ID + * @return Object Object with cleaned properties + * + * @url POST {id}/settodraft + * + * @throws RestException 304 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 500 System error + * + */ + public function settodraft($id, $idwarehouse = -1) + { + } + /** + * Validate an invoice + * + * If you get a bad value for param notrigger check that ou provide this in body + * { + * "idwarehouse": 0, + * "notrigger": 0 + * } + * + * @param int $id Invoice ID + * @param string $force_number force ref invoice + * @param int $idwarehouse Warehouse ID + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return Object|false Object with cleaned properties + * + * @url POST {id}/validate + */ + public function validate($id, $force_number = '', $idwarehouse = 0, $notrigger = 0) + { + } + /** + * Sets an invoice as paid + * + * @param int $id Order ID + * @param string $close_code Code filled if we classify to 'Paid completely' when payment is not complete (for escompte for example) + * @param string $close_note Comment defined if we classify to 'Paid' when payment is not complete (for escompte for example) + * @return Object Object with cleaned properties + * + * @url POST {id}/settopaid + * + * @throws RestException 304 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 500 System error + */ + public function settopaid($id, $close_code = '', $close_note = '') + { + } + /** + * Sets an invoice as unpaid + * + * @param int $id Order ID + * @return Object Object with cleaned properties + * + * @url POST {id}/settounpaid + * + * @throws RestException 304 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 500 System error + */ + public function settounpaid($id) + { + } + /** + * Get discount from invoice + * + * @param int $id Id of invoice + * @return Object Object with cleaned properties + * + * @url GET {id}/discount + */ + public function getDiscount($id) + { + } + /** + * Create a discount (credit available) for a credit note or a deposit. + * + * @param int $id Invoice ID + * @return Object Object with cleaned properties + * + * @url POST {id}/markAsCreditAvailable + * + * @throws RestException 304 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 500 System error + */ + public function markAsCreditAvailable($id) + { + } + /** + * Add a discount line into an invoice (as an invoice line) using an existing absolute discount + * + * Note that this consume the discount. + * + * @param int $id Id of invoice + * @param int $discountid Id of discount + * @return int + * + * @url POST {id}/usediscount/{discountid} + * + * @throws RestException 400 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 405 + */ + public function useDiscount($id, $discountid) + { + } + /** + * Add an available credit note discount to payments of an existing invoice. + * + * Note that this consume the credit note. + * + * @param int $id Id of invoice + * @param int $discountid Id of a discount coming from a credit note + * @return int + * + * @url POST {id}/usecreditnote/{discountid} + * + * @throws RestException 400 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 405 + */ + public function useCreditNote($id, $discountid) + { + } + /** + * Get list of payments of a given invoice + * + * @param int $id Id of invoice + * @return array + * + * @url GET {id}/payments + * + * @throws RestException 400 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 405 + */ + public function getPayments($id) + { + } + /** + * Add payment line to a specific invoice with the remain to pay as amount. + * + * @param int $id Id of invoice + * @param string $datepaye {@from body} Payment date {@type timestamp} + * @param int $paymentid {@from body} Payment mode Id {@min 1} + * @param string $closepaidinvoices {@from body} Close paid invoices {@choice yes,no} + * @param int $accountid {@from body} Account Id {@min 1} + * @param string $num_payment {@from body} Payment number (optional) + * @param string $comment {@from body} Note private (optional) + * @param string $chqemetteur {@from body} Payment issuer (mandatory if paymentcode = 'CHQ') + * @param string $chqbank {@from body} Issuer bank name (optional) + * + * @url POST {id}/payments + * + * @return int Payment ID + * + * @throws RestException 400 + * @throws RestException 401 + * @throws RestException 404 + */ + public function addPayment($id, $datepaye, $paymentid, $closepaidinvoices, $accountid, $num_payment = '', $comment = '', $chqemetteur = '', $chqbank = '') + { + } + /** + * Add a payment to pay partially or completely one or several invoices. + * Warning: Take care that all invoices are owned by the same customer. + * Example of value for parameter arrayofamounts: {"1": {"amount": "99.99", "multicurrency_amount": ""}, "2": {"amount": "", "multicurrency_amount": "10"}} + * + * @param array $arrayofamounts {@from body} Array with id of invoices with amount to pay for each invoice + * @param string $datepaye {@from body} Payment date {@type timestamp} + * @param int $paymentid {@from body} Payment mode Id {@min 1} + * @param string $closepaidinvoices {@from body} Close paid invoices {@choice yes,no} + * @param int $accountid {@from body} Account Id {@min 1} + * @param string $num_payment {@from body} Payment number (optional) + * @param string $comment {@from body} Note private (optional) + * @param string $chqemetteur {@from body} Payment issuer (mandatory if paiementcode = 'CHQ') + * @param string $chqbank {@from body} Issuer bank name (optional) + * @param string $ref_ext {@from body} External reference (optional) + * @param bool $accepthigherpayment {@from body} Accept higher payments that it remains to be paid (optional) + * + * @url POST /paymentsdistributed + * + * @return int Payment ID + * + * @throws RestException 400 + * @throws RestException 401 + * @throws RestException 403 + * @throws RestException 404 + */ + public function addPaymentDistributed($arrayofamounts, $datepaye, $paymentid, $closepaidinvoices, $accountid, $num_payment = '', $comment = '', $chqemetteur = '', $chqbank = '', $ref_ext = '', $accepthigherpayment = \false) + { + } + /** + * Update a payment + * + * @param int $id Id of payment + * @param string $num_payment Payment number + * + * @url PUT payments/{id} + * + * @return array + * + * @throws RestException 400 Bad parameters + * @throws RestException 401 Not allowed + * @throws RestException 404 Not found + */ + public function putPayment($id, $num_payment = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensible object datas + * + * @param Object $object Object to clean + * @return Object Object with cleaned properties + */ + protected function _cleanObjectDatas($object) + { + } + /** + * Get properties of a template invoice object + * + * Return an array with invoice information + * + * @param int $id ID of template invoice + * @param int $contact_list 0:Return array contains all properties, 1:Return array contains just id, -1: Do not return contacts/adddesses + * @return Object Object with cleaned properties + * + * @url GET templates/{id} + * + * @throws RestException + */ + public function getTemplateInvoice($id, $contact_list = 1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensible object datas + * + * @param Object $object Object to clean + * @return Object Object with cleaned properties + */ + protected function _cleanTemplateObjectDatas($object) + { + } + } + /** + * Superclass for invoices classes + */ + abstract class CommonInvoice extends \CommonObject + { + use \CommonIncoterm; + /** + * @var string Label used as ref for template invoices + */ + public $title; + /** + * @var int Type of invoice (See TYPE_XXX constants) + */ + public $type = self::TYPE_STANDARD; + /** + * @var int Sub type of invoice (A subtype code coming from llx_invoice_subtype table. May be used by some countries like Greece) + */ + public $subtype; + /** + * @var int Thirdparty ID + * @deprecated + * @see $socid + */ + public $fk_soc; + /** + * @var int Thirdparty ID + */ + public $socid; + public $paye; + /** + * Invoice date (date) + * + * @var integer + */ + public $date; + /** + * @var int Deadline for payment + */ + public $date_lim_reglement; + public $cond_reglement_id; + // Id in llx_c_paiement + public $cond_reglement_code; + // Code in llx_c_paiement + public $cond_reglement_label; + public $cond_reglement_doc; + // Code in llx_c_paiement + public $mode_reglement_id; + public $mode_reglement_code; + // Code in llx_c_paiement + /** + * @var string + */ + public $mode_reglement; + /** + * @var double + */ + public $revenuestamp; + public $totalpaid; + // duplicate with sumpayed + public $totaldeposits; + // duplicate with sumdeposit + public $totalcreditnotes; + // duplicate with sumcreditnote + public $sumpayed; + public $sumpayed_multicurrency; + public $sumdeposit; + public $sumdeposit_multicurrency; + public $sumcreditnote; + public $sumcreditnote_multicurrency; + public $remaintopay; + /** + * @var int + */ + public $stripechargedone; + /** + * @var int + */ + public $stripechargeerror; + /** + * Payment description + * @var string + */ + public $description; + /** + * @var string + * @deprecated + * @see $ref_customer + */ + public $ref_client; + /** + * @var int Situation cycle reference number + */ + public $situation_cycle_ref; + /** + * ! Closing after partial payment: discount_vat, badsupplier, abandon + * ! Closing when no payment: replaced, abandoned + * @var string Close code + */ + public $close_code; + /** + * ! Comment if paid without full payment + * @var string Close note + */ + public $close_note; + /** + * ! Populated by payment modules like Stripe + * @var string[] Messages returned by an online payment module + */ + public $postactionmessages; + /** + * Standard invoice + */ + const TYPE_STANDARD = 0; + /** + * Replacement invoice + */ + const TYPE_REPLACEMENT = 1; + /** + * Credit note invoice + */ + const TYPE_CREDIT_NOTE = 2; + /** + * Deposit invoice + */ + const TYPE_DEPOSIT = 3; + /** + * Proforma invoice. + * @deprecated Remove this. A "proforma invoice" is an order with a look of invoice, not an invoice ! + */ + const TYPE_PROFORMA = 4; + /** + * Situation invoice + */ + const TYPE_SITUATION = 5; + /** + * Draft status + */ + const STATUS_DRAFT = 0; + /** + * Validated (need to be paid) + */ + const STATUS_VALIDATED = 1; + /** + * Classified paid. + * If paid partially, $this->close_code can be: + * - CLOSECODE_DISCOUNTVAT + * - CLOSECODE_BADDEBT + * If paid completely, this->close_code will be null + */ + const STATUS_CLOSED = 2; + /** + * Classified abandoned and no payment done. + * $this->close_code can be: + * - CLOSECODE_BADDEBT + * - CLOSECODE_ABANDONED + * - CLOSECODE_REPLACED + */ + const STATUS_ABANDONED = 3; + /** + * Return remain amount to pay. Property ->id and ->total_ttc must be set. + * This does not include open direct debit requests. + * + * @param int $multicurrency Return multicurrency_amount instead of amount + * @return float Remain of amount to pay + */ + public function getRemainToPay($multicurrency = 0) + { + } + /** + * Return amount of payments already done. This must include ONLY the record into the payment table. + * Payments dones using discounts, credit notes, etc are not included. + * + * @param int $multicurrency Return multicurrency_amount instead of amount. -1=Return both. + * @return float|int|array Amount of payment already done, <0 and set ->error if KO + * @see getSumDepositsUsed(), getSumCreditNotesUsed() + */ + public function getSommePaiement($multicurrency = 0) + { + } + /** + * Return amount (with tax) of all deposits invoices used by invoice. + * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on for sale invoices (not recommended), + * of FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on for purchase invoices (not recommended). + * + * @param int $multicurrency Return multicurrency_amount instead of amount + * @return float Return integer <0 and set ->error if KO, Sum of deposits amount otherwise + * @see getSommePaiement(), getSumCreditNotesUsed() + */ + public function getSumDepositsUsed($multicurrency = 0) + { + } + /** + * Return amount (with tax) of all credit notes invoices + excess received used by invoice + * + * @param int $multicurrency Return multicurrency_amount instead of amount + * @return float Return integer <0 and set ->error if KO, Sum of credit notes and deposits amount otherwise + * @see getSommePaiement(), getSumDepositsUsed() + */ + public function getSumCreditNotesUsed($multicurrency = 0) + { + } + /** + * Return amount (with tax) of all converted amount for this credit note + * + * @param int $multicurrency Return multicurrency_amount instead of amount + * @return float Return integer <0 if KO, Sum of credit notes and deposits amount otherwise + */ + public function getSumFromThisCreditNotesNotUsed($multicurrency = 0) + { + } + /** + * Returns array of credit note ids from the invoice + * + * @return array Array of credit note ids + */ + public function getListIdAvoirFromInvoice() + { + } + /** + * Returns the id of the invoice that replaces it + * + * @param string $option status filter ('', 'validated', ...) + * @return int Return integer <0 si KO, 0 if no invoice replaces it, id of invoice otherwise + */ + public function getIdReplacingInvoice($option = '') + { + } + /** + * Return list of payments + * + * @see $error Empty string '' if no error. + * + * @param string $filtertype 1 to filter on type of payment == 'PRE' + * @param int $multicurrency Return multicurrency_amount instead of amount + * @return array Array with list of payments + */ + public function getListOfPayments($filtertype = '', $multicurrency = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return if an invoice can be deleted + * Rule is: + * If invoice is draft and has a temporary ref -> yes (1) + * If hidden option INVOICE_CAN_NEVER_BE_REMOVED is on -> no (0) + * If invoice is dispatched in bookkeeping -> no (-1) + * If invoice has a definitive ref, is not last and INVOICE_CAN_ALWAYS_BE_REMOVED off -> no (-2) + * If invoice not last in a cycle -> no (-3) + * If there is payment -> no (-4) + * Otherwise -> yes (2) + * + * @return int Return integer <=0 if no, >0 if yes + */ + public function is_erasable() + { + } + /** + * Return if an invoice was dispatched into bookkeeping + * + * @return int Return integer <0 if KO, 0=no, 1=yes + */ + public function getVentilExportCompta() + { + } + /** + * Return next reference of invoice not already used (or last reference) + * + * @param Societe $soc Thirdparty object + * @param string $mode 'next' for next value or 'last' for last value + * @return string free ref or last ref + */ + public function getNextNumRef($soc, $mode = 'next') + { + } + /** + * Return label of type of invoice + * + * @param int $withbadge 1=Add span for badge css, 2=Add span and show short label + * @return string Label of type of invoice + */ + public function getLibType($withbadge = 0) + { + } + /** + * Return label of invoice subtype + * + * @param string $table table of invoice + * @return string|int Label of invoice subtype or -1 if error + */ + public function getSubtypeLabel($table = '') + { + } + /** + * Retrieve a list of invoice subtype labels or codes. + * + * @param int $mode 0=Return id+label, 1=Return code+id + * @return array Array of subtypes + */ + public function getArrayOfInvoiceSubtypes($mode = 0) + { + } + /** + * Return label of object status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, 1 otherwise) + * @return string Label of status + */ + public function getLibStatut($mode = 0, $alreadypaid = -1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return label of a status + * + * @param int $paye Status field paye + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=long label + picto + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, -1 otherwise) + * @param int $type Type invoice. If -1, we use $this->type + * @return string Label of status + */ + public function LibStatut($paye, $status, $mode = 0, $alreadypaid = -1, $type = -1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns an invoice payment deadline based on the invoice settlement + * conditions and billing date. + * + * @param int $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition. + * @return int|string Date limit of payment if OK, <0 or string if KO + */ + public function calculate_date_lim_reglement($cond_reglement = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Create a withdrawal request for a direct debit order or a credit transfer order. + * Use the remain to pay excluding all existing open direct debit requests. + * + * @param User $fuser User asking the direct debit transfer + * @param float $amount Amount we request direct debit for + * @param string $type 'direct-debit' or 'bank-transfer' + * @param string $sourcetype Source ('facture' or 'supplier_invoice') + * @param int $checkduplicateamongall 0=Default (check among open requests only to find if request already exists). 1=Check also among requests completely processed and cancel if at least 1 request exists whatever is its status. + * @return int Return integer <0 if KO, 0 if a request already exists, >0 if OK + */ + public function demande_prelevement($fuser, $amount = 0, $type = 'direct-debit', $sourcetype = 'facture', $checkduplicateamongall = 0) + { + } + /** + * Create a payment with Stripe card + * Must take amount using Stripe and record an event into llx_actioncomm + * Record bank payment + * Send email to customer ? + * + * @param User $fuser User asking the direct debit transfer + * @param int $id Invoice ID with remain to pay + * @param string $sourcetype Source ('facture' or 'supplier_invoice') + * @return int Return integer <0 if KO, >0 if OK + */ + public function makeStripeCardRequest($fuser, $id, $sourcetype = 'facture') + { + } + /** + * Create a direct debit order into prelevement_bons for a given prelevement_request, then + * Send the payment order to the service (for a direct debit order or a credit transfer order) and record an event in llx_actioncomm. + * + * @param User $fuser User asking the direct debit transfer + * @param int $did ID of unitary payment request to pay + * @param string $type 'direct-debit' or 'bank-transfer' + * @param string $sourcetype Source ('facture' or 'supplier_invoice') + * @param string $service 'StripeTest', 'StripeLive', ... + * @param string $forcestripe To force another stripe env: 'cus_account@pk_...:sk_...' + * @return int Return integer <0 if KO, >0 if OK + */ + public function makeStripeSepaRequest($fuser, $did, $type = 'direct-debit', $sourcetype = 'facture', $service = '', $forcestripe = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Remove a direct debit request or a credit transfer request + * + * @param User $fuser User making delete + * @param int $did ID of request to delete + * @return int Return integer <0 if OK, >0 if KO + */ + public function demande_prelevement_delete($fuser, $did) + { + } + /** + * Build string for EPC QR Code + * + * @return string String for EPC QR Code + */ + public function buildEPCQrCodeString() + { + } + /** + * Build string for ZATCA QR Code (Arabi Saudia) + * + * @return string String for ZATCA QR Code + */ + public function buildZATCAQRString() + { + } + /** + * Build string for QR-Bill (Switzerland) + * + * @return string String for Switzerland QR Code if QR-Bill + */ + public function buildSwitzerlandQRString() + { + } + } + /** + * Class to manage invoice templates + */ + class FactureRec extends \CommonInvoice + { + const TRIGGER_PREFIX = 'BILLREC'; + /** + * @var string ID to identify managed object + */ + public $element = 'facturerec'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'facture_rec'; + /** + * @var string Name of subtable line + */ + public $table_element_line = 'facturedet_rec'; + /** + * @var string Field with ID of parent key if this field has a parent + */ + public $fk_element = 'fk_facture'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'bill'; + /** + * @var int Entity + */ + public $entity; + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'titre'; + /** + * @var string The label of recurring invoice + */ + public $title; + /** + * @var string The label of recurring invoice + * @deprecated Use $title instead + */ + public $titre; + /** + * @var double + */ + public $multicurrency_subprice; + public $socid; + public $number; + public $date; + //public $remise; + //public $remise_absolue; + //public $remise_percent; + /** + * @deprecated + * @see $total_ht + */ + public $total; + /** + * @deprecated + * @see $total_tva + */ + public $tva; + public $date_last_gen; + public $date_when; + public $nb_gen_done; + public $nb_gen_max; + public $user_author; + /** + * @var int Frequency + */ + public $frequency; + /** + * @var string Unit frequency + */ + public $unit_frequency; + public $rang; + /** + * @var int special code + */ + public $special_code; + public $usenewprice = 0; + /** + * @var int Deadline for payment + */ + public $date_lim_reglement; + public $cond_reglement_code; + // Code in llx_c_paiement + public $mode_reglement_code; + // Code in llx_c_paiement + public $suspended; + // status + public $auto_validate; + // 0 to create in draft, 1 to create and validate the new invoice + public $generate_pdf; + // 1 to generate PDF on invoice generation (default) + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), 'titre' => array('type' => 'varchar(100)', 'label' => 'Titre', 'enabled' => 1, 'showoncombobox' => 1, 'visible' => -1, 'position' => 15), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 20, 'index' => 1), 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'notnull' => 1, 'position' => 25), 'subtype' => array('type' => 'smallint(6)', 'label' => 'InvoiceSubtype', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 30), 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 35), 'total_tva' => array('type' => 'double(24,8)', 'label' => 'Tva', 'enabled' => 1, 'visible' => -1, 'position' => 55, 'isameasure' => 1), 'localtax1' => array('type' => 'double(24,8)', 'label' => 'Localtax1', 'enabled' => 1, 'visible' => -1, 'position' => 60, 'isameasure' => 1), 'localtax2' => array('type' => 'double(24,8)', 'label' => 'Localtax2', 'enabled' => 1, 'visible' => -1, 'position' => 65, 'isameasure' => 1), 'total_ht' => array('type' => 'double(24,8)', 'label' => 'Total', 'enabled' => 1, 'visible' => -1, 'position' => 70, 'isameasure' => 1), 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'Total ttc', 'enabled' => 1, 'visible' => -1, 'position' => 75, 'isameasure' => 1), 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 80), 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Fk projet', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 85), 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'Fk cond reglement', 'enabled' => 1, 'visible' => -1, 'position' => 90), 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'Fk mode reglement', 'enabled' => 1, 'visible' => -1, 'position' => 95), 'date_lim_reglement' => array('type' => 'date', 'label' => 'Date lim reglement', 'enabled' => 1, 'visible' => -1, 'position' => 100), 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 105), 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 110), 'modelpdf' => array('type' => 'varchar(255)', 'label' => 'Modelpdf', 'enabled' => 1, 'visible' => -1, 'position' => 115), 'date_when' => array('type' => 'datetime', 'label' => 'Date when', 'enabled' => 1, 'visible' => -1, 'position' => 130), 'date_last_gen' => array('type' => 'datetime', 'label' => 'Date last gen', 'enabled' => 1, 'visible' => -1, 'position' => 135), 'nb_gen_done' => array('type' => 'integer', 'label' => 'Nb gen done', 'enabled' => 1, 'visible' => -1, 'position' => 140), 'nb_gen_max' => array('type' => 'integer', 'label' => 'Nb gen max', 'enabled' => 1, 'visible' => -1, 'position' => 145), 'frequency' => array('type' => 'integer', 'label' => 'Frequency', 'enabled' => 1, 'visible' => -1, 'position' => 150), 'unit_frequency' => array('type' => 'varchar(2)', 'label' => 'UnitFrequency', 'enabled' => 1, 'visible' => -1, 'position' => 152), 'usenewprice' => array('type' => 'integer', 'label' => 'UseNewPrice', 'enabled' => 1, 'visible' => 0, 'position' => 155), 'revenuestamp' => array('type' => 'double(24,8)', 'label' => 'RevenueStamp', 'enabled' => 1, 'visible' => -1, 'position' => 160, 'isameasure' => 1), 'auto_validate' => array('type' => 'integer', 'label' => 'Auto validate', 'enabled' => 1, 'visible' => -1, 'position' => 165), 'generate_pdf' => array('type' => 'integer', 'label' => 'Generate pdf', 'enabled' => 1, 'visible' => -1, 'position' => 170), 'fk_account' => array('type' => 'integer', 'label' => 'Fk account', 'enabled' => 'isModEnabled("bank")', 'visible' => -1, 'position' => 175), 'fk_multicurrency' => array('type' => 'integer', 'label' => 'Fk multicurrency', 'enabled' => 1, 'visible' => -1, 'position' => 180), 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'Multicurrency code', 'enabled' => 1, 'visible' => -1, 'position' => 185), 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'Multicurrency tx', 'enabled' => 1, 'visible' => -1, 'position' => 190, 'isameasure' => 1), 'multicurrency_total_ht' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total ht', 'enabled' => 1, 'visible' => -1, 'position' => 195, 'isameasure' => 1), 'multicurrency_total_tva' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total tva', 'enabled' => 1, 'visible' => -1, 'position' => 200, 'isameasure' => 1), 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total ttc', 'enabled' => 1, 'visible' => -1, 'position' => 205, 'isameasure' => 1), 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 210), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 215), 'suspended' => array('type' => 'integer', 'label' => 'Suspended', 'enabled' => 1, 'visible' => -1, 'position' => 225)); + // END MODULEBUILDER PROPERTIES + const STATUS_NOTSUSPENDED = 0; + const STATUS_SUSPENDED = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create a predefined invoice + * + * @param User $user User object + * @param int $facid Id of source invoice + * @param int $notrigger No trigger + * @param array $onlylines Only the lines of the array + * @return int Return integer <0 if KO, id of invoice created if OK + */ + public function create($user, $facid, $notrigger = 0, $onlylines = array()) + { + } + /** + * Update a line invoice_rec. + * + * @param User $user User + * @param int $notrigger No trigger + * @return int Return integer <0 if KO, Id of line if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Load object and lines + * + * @param int $rowid Id of object to load + * @param string $ref Reference of recurring invoice + * @param string $ref_ext External reference of invoice + * @param int $noextrafields 0=Default to load extrafields, 1=No extrafields + * @param int $nolines 0=Default to load lines, 1=No lines + * @return int >0 if OK, <0 if KO, 0 if not found + */ + public function fetch($rowid, $ref = '', $ref_ext = '', $noextrafields = 0, $nolines = 0) + { + } + /** + * Create an array of invoice lines + * + * @return int >0 if OK, <0 if KO + */ + public function getLinesArray() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Get lines of template invoices into this->lines + * + * @return int 1 if OK, < 0 if KO + */ + public function fetch_lines() + { + } + /** + * Delete template invoice + * + * @param User $user User that delete. + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @param int $idwarehouse Id warehouse to use for stock change. + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0, $idwarehouse = -1) + { + } + /** + * Add a line to invoice + * + * @param string $desc Description de la ligne + * @param double $pu_ht Prix unitaire HT (> 0 even for credit note) + * @param double $qty Quantite + * @param double $txtva Taux de tva force, sinon -1 + * @param double $txlocaltax1 Local tax 1 rate (deprecated) + * @param double $txlocaltax2 Local tax 2 rate (deprecated) + * @param int $fk_product Product/Service ID predefined + * @param double $remise_percent Percentage discount of the line + * @param string $price_base_type HT or TTC + * @param int $info_bits VAT npr or not ? + * @param int $fk_remise_except Id remise + * @param double $pu_ttc Prix unitaire TTC (> 0 even for credit note) + * @param int $type Type of line (0=product, 1=service) + * @param int $rang Position of line + * @param int $special_code Special code + * @param string $label Label of the line + * @param string $fk_unit Unit + * @param double $pu_ht_devise Unit price in currency + * @param int $date_start_fill 1=Flag to fill start date when generating invoice + * @param int $date_end_fill 1=Flag to fill end date when generating invoice + * @param int $fk_fournprice Supplier price id (to calculate margin) or '' + * @param int $pa_ht Buying price of line (to calculate margin) or '' + * @param int $fk_parent_line Id of parent line + * @return int Return integer <0 if KO, Id of line if OK + */ + public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = 0, $pu_ttc = 0, $type = 0, $rang = -1, $special_code = 0, $label = '', $fk_unit = \null, $pu_ht_devise = 0, $date_start_fill = 0, $date_end_fill = 0, $fk_fournprice = \null, $pa_ht = 0, $fk_parent_line = 0) + { + } + /** + * Update a line to invoice + * + * @param int $rowid Id of line to update + * @param string $desc Description de la ligne + * @param double $pu_ht Prix unitaire HT (> 0 even for credit note) + * @param double $qty Quantite + * @param double $txtva Taux de tva force, sinon -1 + * @param double $txlocaltax1 Local tax 1 rate (deprecated) + * @param double $txlocaltax2 Local tax 2 rate (deprecated) + * @param int $fk_product Product/Service ID predefined + * @param double $remise_percent Percentage discount of the line + * @param string $price_base_type HT or TTC + * @param int $info_bits Bits of type of lines + * @param int $fk_remise_except Id remise + * @param double $pu_ttc Prix unitaire TTC (> 0 even for credit note) + * @param int $type Type of line (0=product, 1=service) + * @param int $rang Position of line + * @param int $special_code Special code + * @param string $label Label of the line + * @param string $fk_unit Unit + * @param double $pu_ht_devise Unit price in currency + * @param int $notrigger disable line update trigger + * @param int $date_start_fill 1=Flag to fill start date when generating invoice + * @param int $date_end_fill 1=Flag to fill end date when generating invoice + * @param int $fk_fournprice Id of origin supplier price + * @param int $pa_ht Price (without tax) of product for margin calculation + * @param int $fk_parent_line Id of parent line + * @return int Return integer <0 if KO, Id of line if OK + */ + public function updateline($rowid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = 0, $pu_ttc = 0, $type = 0, $rang = -1, $special_code = 0, $label = '', $fk_unit = \null, $pu_ht_devise = 0, $notrigger = 0, $date_start_fill = 0, $date_end_fill = 0, $fk_fournprice = \null, $pa_ht = 0, $fk_parent_line = 0) + { + } + /** + * Return the next date of + * + * @return int|false false if KO, timestamp if OK + */ + public function getNextDate() + { + } + /** + * Return if maximum number of generation is reached + * + * @return boolean False by default, True if maximum number of generation is reached + */ + public function isMaxNbGenReached() + { + } + /** + * Format string to output with by striking the string if max number of generation was reached + * + * @param string $ret Default value to output + * @return string html formatted string + */ + public function strikeIfMaxNbGenReached($ret) + { + } + /** + * Create all recurrents invoices (for all entities if multicompany is used). + * A result may also be provided into this->output. + * + * WARNING: This method change temporarily context $conf->entity to be in correct context for each recurring invoice found. + * + * @param int $restrictioninvoiceid 0=All qualified template invoices found. > 0 = restrict action on invoice ID + * @param int $forcevalidation 1=Force validation of invoice whatever is template auto_validate flag. + * @param int $notrigger Disable the trigger + * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) + */ + public function createRecurringInvoices($restrictioninvoiceid = 0, $forcevalidation = 0, $notrigger = 0) + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int $withpicto Add picto into link + * @param string $option Where point the link + * @param int $max Maxlength of ref + * @param int $short 1=Return just URL + * @param string $moretitle Add more text to title tooltip + * @param int $notooltip 1=Disable tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1) + { + } + /** + * Return label of object status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto + * @param integer $alreadypaid Not used on recurring invoices + * @return string Label of status + */ + public function getLibStatut($mode = 0, $alreadypaid = -1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return label of a status + * + * @param int $recur Is it a recurring invoice ? + * @param int $status Id status (suspended or not) + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=long label + picto + * @param integer $alreadypaid Not used for recurring invoices + * @param int $type Type invoice + * @return string Label of status + */ + public function LibStatut($recur, $status, $mode = 0, $alreadypaid = -1, $type = 0) + { + } + /** + * Return next reference of invoice not already used (or last reference) + * + * @param Societe $soc Thirdparty object + * @param string $mode 'next' for next value or 'last' for last value + * @return string free ref or last ref + */ + public function getNextNumRef($soc, $mode = 'next') + { + } + /** + * Load miscellaneous information for tab "Info" + * + * @param int $id Id of object to load + * @return void + */ + public function info($id) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines + * @return int + */ + public function initAsSpecimen($option = '') + { + } + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty(\DoliDB $dbs, $origin_id, $dest_id) + { + } + /** + * Function used to replace a product id with another one. + * + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old product id + * @param int $dest_id New product id + * @return bool + */ + public static function replaceProduct(\DoliDB $dbs, $origin_id, $dest_id) + { + } + /** + * Update frequency and unit + * + * @param int $frequency value of frequency + * @param string $unit unit of frequency (d, m, y) + * @param int $notrigger Disable the trigger + * @return int Return integer <0 if KO, >0 if OK + */ + public function setFrequencyAndUnit($frequency, $unit, $notrigger = 0) + { + } + /** + * Update the next date of execution + * + * @param datetime $date date of execution + * @param int $increment_nb_gen_done 0 do nothing more, >0 increment nb_gen_done + * @param int $notrigger Disable the trigger + * @return int Return integer <0 if KO, >0 if OK + */ + public function setNextDate($date, $increment_nb_gen_done = 0, $notrigger = 0) + { + } + /** + * Update the maximum period + * + * @param int $nb number of maximum period + * @param int $notrigger Disable the trigger + * @return int Return integer <0 if KO, >0 if OK + */ + public function setMaxPeriod($nb, $notrigger = 0) + { + } + /** + * Update the auto validate flag of invoice + * + * @param int $validate 0 to create in draft, 1 to create and validate invoice + * @param int $notrigger Disable the trigger + * @return int Return integer <0 if KO, >0 if OK + */ + public function setAutoValidate($validate, $notrigger = 0) + { + } + /** + * Update the auto generate documents + * + * @param int $validate 0 no document, 1 to generate document + * @param int $notrigger Disable the trigger + * @return int Return integer <0 if KO, >0 if OK + */ + public function setGeneratePdf($validate, $notrigger = 0) + { + } + /** + * Update the model for documents + * + * @param string $model model of document generator + * @param int $notrigger Disable the trigger + * @return int Return integer <0 if KO, >0 if OK + */ + public function setModelPdf($model, $notrigger = 0) + { + } + } + /** + * Parent class of all other business classes for details of elements (invoices, contracts, proposals, orders, ...) + */ + abstract class CommonInvoiceLine extends \CommonObjectLine + { + /** + * Custom label of line. Not used by default. + * @deprecated + */ + public $label; + /** + * @deprecated + * @see $product_ref + */ + public $ref; + // Product ref (deprecated) + /** + * @deprecated + * @see $product_label + */ + public $libelle; + // Product label (deprecated) + /** + * Type of the product. 0 for product 1 for service + * @var int + */ + public $product_type = 0; + /** + * Product ref + * @var string + */ + public $product_ref; + /** + * Product label + * @var string + */ + public $product_label; + /** + * Product description + * @var string + */ + public $product_desc; + /** + * Quantity + * @var double + */ + public $qty; + /** + * Unit price before taxes + * @var float + */ + public $subprice; + /** + * Unit price before taxes + * @var float + * @deprecated + */ + public $price; + /** + * Id of corresponding product + * @var int + */ + public $fk_product; + /** + * VAT code + * @var string + */ + public $vat_src_code; + /** + * VAT % Vat rate can be like "21.30 (CODE)" + * @var string|float + */ + public $tva_tx; + /** + * Local tax 1 % + * @var float + */ + public $localtax1_tx; + /** + * Local tax 2 % + * @var float + */ + public $localtax2_tx; + /** + * Local tax 1 type + * @var int<0,6> From 1 to 6, or 0 if not found + * @see getLocalTaxesFromRate() + */ + public $localtax1_type; + /** + * Local tax 2 type + * @var int<0,6> From 1 to 6, or 0 if not found + * @see getLocalTaxesFromRate() + */ + public $localtax2_type; + /** + * Percent of discount + * @var float + */ + public $remise_percent; + /** + * Fixed discount + * @var float + * @deprecated + */ + public $remise; + /** + * Total amount before taxes + * @var float + */ + public $total_ht; + /** + * Total VAT amount + * @var float + */ + public $total_tva; + /** + * Total local tax 1 amount + * @var float + */ + public $total_localtax1; + /** + * Total local tax 2 amount + * @var float + */ + public $total_localtax2; + /** + * Total amount with taxes + * @var float + */ + public $total_ttc; + public $date_start_fill; + // If set to 1, when invoice is created from a template invoice, it will also auto set the field date_start at creation + public $date_end_fill; + // If set to 1, when invoice is created from a template invoice, it will also auto set the field date_end at creation + public $buy_price_ht; + public $buyprice; + // For backward compatibility + public $pa_ht; + // For backward compatibility + public $marge_tx; + public $marque_tx; + /** + * List of cumulative options: + * Bit 0: 0 for common VAT - 1 if VAT french NPR + * Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except) + * @var int + */ + public $info_bits = 0; + /** + * List of special options to define line: + * 1: shipment cost lines + * 2: ecotaxe + * 3: ?? + * id of module: a meaning for the module + * @var int + */ + public $special_code = 0; + /** + * @deprecated Use user_creation_id + */ + public $fk_user_author; + /** + * @deprecated Use user_modification_id + */ + public $fk_user_modif; + public $fk_accounting_account; + } + /** + * Class to manage invoice lines of templates. + * Saved into database table llx_facturedet_rec + */ + class FactureLigneRec extends \CommonInvoiceLine + { + /** + * @var string ID to identify managed object + */ + public $element = 'facturedetrec'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'facturedet_rec'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'facturerec'; + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_facture'; + //! From llx_facturedet_rec + //! Id facture + public $fk_facture; + //! Id parent line + public $fk_parent_line; + public $fk_product_fournisseur_price; + public $fk_fournprice; + // For backward compatibility + public $rang; + //public $situation_percent; // Not supported on recurring invoice line + public $desc; + public $description; + public $fk_product_type; + // Use instead product_type + public $fk_contract_line; + /** + * Delete line in database + * + * @param User $user Object user + * @param int $notrigger Disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Get line of template invoice + * + * @param int $rowid Id of invoice + * @return int 1 if OK, < 0 if KO + */ + public function fetch($rowid) + { + } + /** + * Update a line to invoice_rec. + * + * @param User $user User + * @param int $notrigger No trigger + * @return int Return integer <0 if KO, Id of line if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + } + /** + * Class to manage invoices + */ + class Facture extends \CommonInvoice + { + /** + * @var string ID to identify managed object + */ + public $element = 'facture'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'facture'; + /** + * @var string Name of subtable line + */ + public $table_element_line = 'facturedet'; + /** + * @var string Fieldname with ID of parent key if this field has a parent + */ + public $fk_element = 'fk_facture'; + /** + * @var string String with name of icon for myobject. + */ + public $picto = 'bill'; + /** + * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user + * @var integer + */ + public $restrictiononfksoc = 1; + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + /** + * @var int ID + * @deprecated Use $user_creation_id + */ + public $fk_user_author; + /** + * @var int|null ID + * @deprecated Use $user_validation_id + */ + public $fk_user_valid; + /** + * @var int ID + * @deprecated Use $user_modification_id + */ + public $fk_user_modif; + /** + * @var string + */ + public $datem; + /** + * @var null|int|'' Date expected for delivery + */ + public $delivery_date; + // Date expected of shipment (date of start of shipment, not the reception that occurs some days after) + /** + * @var string customer ref + * @deprecated + * @see $ref_customer + */ + public $ref_client; + /** + * @var string customer ref + */ + public $ref_customer; + /** + * @var float + */ + public $total_ht; + /** + * @var float + */ + public $total_tva; + /** + * @var float + */ + public $total_localtax1; + /** + * @var float + */ + public $total_localtax2; + /** + * @var float + */ + public $total_ttc; + /** + * @var float + */ + public $revenuestamp; + /** + * @var float|string + */ + public $resteapayer; + /** + * + * @var int<0,1> 1 if invoice paid COMPLETELY, 0 otherwise + * @deprecated * Use statut and close_code) + */ + public $paye; + /** + * @var string key of module source when invoice generated from a dedicated module ('cashdesk', 'takepos', ...) + */ + public $module_source; + /** + * @var int key of pos source ('0', '1', ...) + */ + public $pos_source; + /** + * @var int id of template invoice when generated from a template invoice + */ + public $fk_fac_rec_source; + /** + * @var int id of source invoice if replacement invoice or credit note + */ + public $fk_facture_source; + public $linked_objects = array(); + /** + * @var int ID Field to store bank id to use when payment mode is withdraw + */ + public $fk_bank; + /** + * @var CommonInvoiceLine[] + */ + public $lines = array(); + /** + * @var FactureLigne + */ + public $line; + /** + * @var array (Encoded as JSON in database) + */ + public $extraparams = array(); + /** + * @var int ID facture rec + */ + public $fac_rec; + /** + * @var string + */ + public $date_pointoftax; + /** + * @var int Situation cycle reference number + */ + public $situation_cycle_ref; + /** + * @var int Situation counter inside the cycle + */ + public $situation_counter; + /** + * @var int Final situation flag + */ + public $situation_final; + /** + * @var Facture[] Table of previous situations + */ + public $tab_previous_situation_invoice = array(); + /** + * @var Facture[] Table of next situations + */ + public $tab_next_situation_invoice = array(); + /** + * @var static object oldcopy + */ + public $oldcopy; + /** + * @var float percentage of retainage + */ + public $retained_warranty; + /** + * @var int timestamp of date limit of retainage + */ + public $retained_warranty_date_limit; + /** + * @var int Code in llx_c_paiement + */ + public $retained_warranty_fk_cond_reglement; + /** + * @var int availability ID + */ + public $availability_id; + /** + * @var string + */ + public $date_closing; + /** + * @var int + */ + public $source; + /** + * @var float Percent of discount ("remise" in French) + * @deprecated The discount percent is on line level now + */ + public $remise_percent; + /** + * @var string payment url + */ + public $online_payment_url; + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array( + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 1), + 'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 5), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 20, 'index' => 1), + 'ref_client' => array('type' => 'varchar(255)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => -1, 'position' => 10), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 12), + 'type' => array('type' => 'smallint(6)', 'label' => 'Type', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 15), + 'subtype' => array('type' => 'smallint(6)', 'label' => 'InvoiceSubtype', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 15), + //'increment' =>array('type'=>'varchar(10)', 'label'=>'Increment', 'enabled'=>1, 'visible'=>-1, 'position'=>45), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 50), + 'datef' => array('type' => 'date', 'label' => 'DateInvoice', 'enabled' => 1, 'visible' => 1, 'position' => 20), + 'date_valid' => array('type' => 'date', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 22), + 'date_lim_reglement' => array('type' => 'date', 'label' => 'DateDue', 'enabled' => 1, 'visible' => 1, 'position' => 25), + 'date_closing' => array('type' => 'datetime', 'label' => 'Date closing', 'enabled' => 1, 'visible' => -1, 'position' => 30), + 'paye' => array('type' => 'smallint(6)', 'label' => 'InvoicePaidCompletely', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 80), + //'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>85), + //'remise_percent' =>array('type'=>'double', 'label'=>'RelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>90), + //'remise_absolue' =>array('type'=>'double', 'label'=>'CustomerRelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>91), + //'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>100), + 'close_code' => array('type' => 'varchar(16)', 'label' => 'EarlyClosingReason', 'enabled' => 1, 'visible' => -1, 'position' => 92), + 'close_note' => array('type' => 'varchar(128)', 'label' => 'EarlyClosingComment', 'enabled' => 1, 'visible' => -1, 'position' => 93), + 'total_ht' => array('type' => 'double(24,8)', 'label' => 'AmountHT', 'enabled' => 1, 'visible' => 1, 'position' => 95, 'isameasure' => 1), + 'total_tva' => array('type' => 'double(24,8)', 'label' => 'AmountVAT', 'enabled' => 1, 'visible' => -1, 'position' => 100, 'isameasure' => 1), + 'localtax1' => array('type' => 'double(24,8)', 'label' => 'LT1', 'enabled' => 1, 'visible' => -1, 'position' => 110, 'isameasure' => 1), + 'localtax2' => array('type' => 'double(24,8)', 'label' => 'LT2', 'enabled' => 1, 'visible' => -1, 'position' => 120, 'isameasure' => 1), + 'revenuestamp' => array('type' => 'double(24,8)', 'label' => 'RevenueStamp', 'enabled' => 1, 'visible' => -1, 'position' => 115, 'isameasure' => 1), + 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'AmountTTC', 'enabled' => 1, 'visible' => 1, 'position' => 130, 'isameasure' => 1), + 'fk_facture_source' => array('type' => 'integer', 'label' => 'SourceInvoice', 'enabled' => 1, 'visible' => -1, 'position' => 170), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Project', 'enabled' => 1, 'visible' => -1, 'position' => 175), + 'fk_account' => array('type' => 'integer', 'label' => 'Fk account', 'enabled' => 1, 'visible' => -1, 'position' => 180), + 'fk_currency' => array('type' => 'varchar(3)', 'label' => 'CurrencyCode', 'enabled' => 1, 'visible' => -1, 'position' => 185), + 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'PaymentTerm', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 190), + 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'PaymentMode', 'enabled' => 1, 'visible' => -1, 'position' => 195), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 205), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 210), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 215), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 225), + 'situation_cycle_ref' => array('type' => 'smallint(6)', 'label' => 'Situation cycle ref', 'enabled' => '$conf->global->INVOICE_USE_SITUATION', 'visible' => -1, 'position' => 230), + 'situation_counter' => array('type' => 'smallint(6)', 'label' => 'Situation counter', 'enabled' => '$conf->global->INVOICE_USE_SITUATION', 'visible' => -1, 'position' => 235), + 'situation_final' => array('type' => 'smallint(6)', 'label' => 'Situation final', 'enabled' => 'empty($conf->global->INVOICE_USE_SITUATION) ? 0 : 1', 'visible' => -1, 'position' => 240), + 'retained_warranty' => array('type' => 'double', 'label' => 'Retained warranty', 'enabled' => '$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible' => -1, 'position' => 245), + 'retained_warranty_date_limit' => array('type' => 'date', 'label' => 'Retained warranty date limit', 'enabled' => '$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible' => -1, 'position' => 250), + 'retained_warranty_fk_cond_reglement' => array('type' => 'integer', 'label' => 'Retained warranty fk cond reglement', 'enabled' => '$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible' => -1, 'position' => 255), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 260), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 265), + 'date_pointoftax' => array('type' => 'date', 'label' => 'DatePointOfTax', 'enabled' => '$conf->global->INVOICE_POINTOFTAX_DATE', 'visible' => -1, 'position' => 270), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'MulticurrencyID', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 275), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'Currency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 280), + 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'CurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 285, 'isameasure' => 1), + 'multicurrency_total_ht' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountHT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 290, 'isameasure' => 1), + 'multicurrency_total_tva' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountVAT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 291, 'isameasure' => 1), + 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountTTC', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 292, 'isameasure' => 1), + 'fk_fac_rec_source' => array('type' => 'integer', 'label' => 'RecurringInvoiceSource', 'enabled' => 1, 'visible' => -1, 'position' => 305), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => -1, 'position' => 310), + 'module_source' => array('type' => 'varchar(32)', 'label' => 'POSModule', 'enabled' => "(isModEnabled('cashdesk') || isModEnabled('takepos') || getDolGlobalInt('INVOICE_SHOW_POS'))", 'visible' => -1, 'position' => 315), + 'pos_source' => array('type' => 'varchar(32)', 'label' => 'POSTerminal', 'enabled' => "(isModEnabled('cashdesk') || isModEnabled('takepos') || getDolGlobalInt('INVOICE_SHOW_POS'))", 'visible' => -1, 'position' => 320), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 500), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModificationShort', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 502), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -1, 'position' => 506), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModification', 'enabled' => 1, 'visible' => -1, 'notnull' => -1, 'position' => 508), + 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 510), + 'fk_user_closing' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserClosing', 'enabled' => 1, 'visible' => -1, 'position' => 512), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 900), + 'fk_statut' => array('type' => 'smallint(6)', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 1000, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 2 => 'Paid', 3 => 'Abandonned')), + ); + // END MODULEBUILDER PROPERTIES + /** + * Standard invoice + */ + const TYPE_STANDARD = 0; + /** + * Replacement invoice + */ + const TYPE_REPLACEMENT = 1; + /** + * Credit note invoice + */ + const TYPE_CREDIT_NOTE = 2; + /** + * Deposit invoice + */ + const TYPE_DEPOSIT = 3; + /** + * Proforma invoice (should not be used. a proforma is an order) + */ + const TYPE_PROFORMA = 4; + /** + * Situation invoice + */ + const TYPE_SITUATION = 5; + /** + * Draft status + */ + const STATUS_DRAFT = 0; + /** + * Validated (need to be paid) + */ + const STATUS_VALIDATED = 1; + /** + * Classified paid. + * If paid partially, $this->close_code can be: + * - CLOSECODE_DISCOUNTVAT + * - CLOSECODE_BADDEBT + * If paid completely, this->close_code will be null + */ + const STATUS_CLOSED = 2; + /** + * Classified abandoned and no payment done. + * $this->close_code can be: + * - CLOSECODE_BADDEBT + * - CLOSECODE_ABANDONED + * - CLOSECODE_REPLACED + */ + const STATUS_ABANDONED = 3; + const CLOSECODE_DISCOUNTVAT = 'discount_vat'; + // Abandoned remain - escompte + const CLOSECODE_BADDEBT = 'badcustomer'; + // Abandoned remain - bad customer + const CLOSECODE_BANKCHARGE = 'bankcharge'; + // Abandoned remain - bank charge + const CLOSECODE_OTHER = 'other'; + // Abandoned remain - other + const CLOSECODE_ABANDONED = 'abandon'; + // Abandoned - other + const CLOSECODE_REPLACED = 'replaced'; + // Closed after doing a replacement invoice + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create invoice in database. + * Note: this->ref can be set or empty. If empty, we will use "(PROV999)" + * Note: this->fac_rec must be set to create invoice from a recurring invoice + * + * @param User $user Object user that create + * @param int $notrigger 1=Does not execute triggers, 0 otherwise + * @param int $forceduedate If set, do not recalculate due date from payment condition but force it with value + * @return int Return integer <0 if KO, >0 if OK + */ + public function create(\User $user, $notrigger = 0, $forceduedate = 0) + { + } + /** + * Create a new invoice in database from current invoice + * + * @param User $user Object user that ask creation + * @param int<0,1> $invertdetail Reverse sign of amounts for lines + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function createFromCurrent(\User $user, $invertdetail = 0) + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $user User that clone + * @param int $fromid Id of object to clone + * @return int New id of clone + */ + public function createFromClone(\User $user, $fromid = 0) + { + } + /** + * Load an object from an order and create a new invoice into database + * + * @param Facture $object Object source + * @param User $user Object user + * @return int<-1,1> Return integer <0 if KO, 0 if nothing done, 1 if OK + */ + public function createFromOrder($object, \User $user) + { + } + /** + * Load an object from a contract and create a new invoice into database + * + * @param Facture $object Object source + * @param User $user Object user + * @param int[] $lines Ids of lines to use for invoice. If empty, all lines will be used. + * @return int Return integer <0 if KO, 0 if nothing done, 1 if OK + */ + public function createFromContract($object, \User $user, $lines = array()) + { + } + /** + * Creates a deposit from a proposal or an order by grouping lines by VAT rates + * + * @param Propal|Commande $origin The original proposal or order + * @param int $date Invoice date + * @param int $payment_terms_id Invoice payment terms + * @param User $user Object user + * @param int<0,1> $notrigger 1=Does not execute triggers, 0= execute triggers + * @param bool $autoValidateDeposit Whether to automatically validate the deposit created + * @param array $overrideFields Array of fields to force values + * @return ?Facture The deposit created, or null if error (populates $origin->error in this case) + */ + public static function createDepositFromOrigin(\CommonObject $origin, $date, $payment_terms_id, \User $user, $notrigger = 0, $autoValidateDeposit = \false, $overrideFields = array()) + { + } + /** + * getTooltipContentArray + * + * @param array $params params to construct tooltip data + * @return array Data to show in tooltip + * @since v18 + */ + public function getTooltipContentArray($params) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param int $withpicto Add picto into link + * @param string $option Where point the link + * @param int $max Maxlength of ref + * @param int $short 1=Return just URL + * @param string $moretitle Add more text to title tooltip + * @param int $notooltip 1=Disable tooltip + * @param int $addlinktonotes 1=Add link to notes + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param string $target Target of link ('', '_self', '_blank', '_parent', '_backoffice', ...) + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $addlinktonotes = 0, $save_lastsearch_value = -1, $target = '') + { + } + /** + * Get object from database. Get also lines. + * + * @param int $rowid Id of object to load + * @param string $ref Reference of invoice + * @param string $ref_ext External reference of invoice + * @param int $notused Not used + * @param bool $fetch_situation Load also the previous and next situation invoice into $tab_previous_situation_invoice and $tab_next_situation_invoice + * @return int >0 if OK, <0 if KO, 0 if not found + */ + public function fetch($rowid, $ref = '', $ref_ext = '', $notused = 0, $fetch_situation = \false) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load all detailed lines into this->lines + * + * @param int $only_product Return only physical products + * @param int $loadalsotranslation Return translation for products + * + * @return int 1 if OK, < 0 if KO + */ + public function fetch_lines($only_product = 0, $loadalsotranslation = 0) + { + } + /** + * Fetch previous and next situations invoices. + * Return all previous and next invoices (both standard and credit notes). + * + * @return void + */ + public function fetchPreviousNextSituationInvoice() + { + } + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Add a discount line into an invoice (as an invoice line) using an existing absolute discount (Consume the discount) + * + * @param int $idremise Id of absolute discount from table llx_societe_remise_except + * @return int >0 if OK, <0 if KO + */ + public function insert_discount($idremise) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set customer ref + * + * @param string $ref_client Customer ref + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_ref_client($ref_client, $notrigger = 0) + { + } + /** + * Delete invoice + * + * @param User $user User making the deletion. + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @param int $idwarehouse Id warehouse to use for stock change. + * @return int Return integer <0 if KO, 0=Refused, >0 if OK + */ + public function delete($user, $notrigger = 0, $idwarehouse = -1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Tag the invoice as paid completely (if close_code is filled) => this->fk_statut=2, this->paye=1 + * or partially (if close_code filled) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0 + * + * @deprecated + * @see setPaid() + * @param User $user Object user that modify + * @param string $close_code Code set when forcing to set the invoice as fully paid while in practice it is incomplete (because of a discount (fr:escompte) for instance) + * @param string $close_note Comment set when forcing to set the invoice as fully paid while in practice it is incomplete (because of a discount (fr:escompte) for instance) + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_paid($user, $close_code = '', $close_note = '') + { + } + /** + * Tag the invoice as : + * - paid completely (if close_code is not filled) => this->fk_statut=2, this->paye=1 + * - or partially (if close_code filled) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0 + * + * @param User $user Object user that modify + * @param string $close_code Code set when forcing to set the invoice as fully paid while in practice it is incomplete (because of a discount (fr:escompte) for instance) + * @param string $close_note Comment set when forcing to set the invoice as fully paid while in practice it is incomplete (because of a discount (fr:escompte) for instance) + * @return int Return integer <0 if KO, >0 if OK + */ + public function setPaid($user, $close_code = '', $close_note = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Tags the invoice as incompletely paid and call the trigger BILL_UNPAYED + * This method is used when a direct debit (fr:prelevement) is refused + * or when a canceled invoice is reopened. + * + * @deprecated + * @see setUnpaid() + * @param User $user Object user that change status + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_unpaid($user) + { + } + /** + * Tag the invoice as incompletely paid and call the trigger BILL_UNPAYED + * This method is used when a direct debit (fr:prelevement) is refused + * or when a canceled invoice is reopened. + * + * @param User $user Object user that change status + * @return int Return integer <0 if KO, >0 if OK + */ + public function setUnpaid($user) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Tag invoice as canceled, with no payment on it (example for replacement invoice or payment never received) + call trigger BILL_CANCEL + * Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because + * of no payment even if merchandises were sent). + * + * @deprecated + * @see setCanceled() + * @param User $user Object user making change + * @param string $close_code Code of closing invoice (CLOSECODE_REPLACED, CLOSECODE_...) + * @param string $close_note Comment + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_canceled($user, $close_code = '', $close_note = '') + { + } + /** + * Tag invoice as canceled, with no payment on it (example for replacement invoice or payment never received) + call trigger BILL_CANCEL + * Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because + * of no payment even if merchandises were sent). + * + * @param User $user Object user making change + * @param string $close_code Code of closing invoice (CLOSECODE_REPLACED, CLOSECODE_...) + * @param string $close_note Comment + * @return int Return integer <0 if KO, >0 if OK + */ + public function setCanceled($user, $close_code = '', $close_note = '') + { + } + /** + * Tag invoice as validated + call trigger BILL_VALIDATE + * Object must have lines loaded with fetch_lines + * + * @param User $user Object user that validate + * @param string $force_number Reference to force on invoice + * @param int $idwarehouse Id of warehouse to use for stock decrease if option to decrease on stock is on (0=no decrease) + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @param int $batch_rule 0=do not decrement batch, else batch rule to use: 1=take lot/serial ordered by sellby and eatby dates + * @return int Return integer <0 if KO, 0=Nothing done because invoice is not a draft, >0 if OK + */ + public function validate($user, $force_number = '', $idwarehouse = 0, $notrigger = 0, $batch_rule = 0) + { + } + /** + * Update price of next invoice + * + * @param Translate $langs Translate object + * @return bool false if KO, true if OK + */ + public function updatePriceNextInvoice(&$langs) + { + } + /** + * Set draft status + * + * @param User $user Object user that modify + * @param int $idwarehouse Id warehouse to use for stock change. + * @return int Return integer <0 if KO, >0 if OK + */ + public function setDraft($user, $idwarehouse = -1) + { + } + /** + * Add an invoice line into database (linked to product/service or not). + * Note: ->thirdparty must be defined. + * Les parameters sont deja cense etre juste et avec valeurs finales a l'appel + * de cette method. Aussi, pour le taux tva, il doit deja avoir ete defini + * par l'appelant par la method get_default_tva(societe_vendeuse,societe_acheteuse,produit) + * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) + * + * @param string $desc Description of line + * @param float $pu_ht Unit price without tax (> 0 even for credit note) + * @param float $qty Quantity + * @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') + * @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside) + * @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside) + * @param int $fk_product Id of predefined product/service + * @param float $remise_percent Percent of discount on line + * @param int|string $date_start Date start of service + * @param int|string $date_end Date end of service + * @param int $fk_code_ventilation Code of dispatching into accountancy + * @param int $info_bits Bits of type of lines + * @param int $fk_remise_except Id discount used + * @param string $price_base_type 'HT' or 'TTC' + * @param float $pu_ttc Unit price with tax (> 0 even for credit note) + * @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used. + * @param int $rang Position of line (-1 means last value + 1) + * @param int $special_code Special code (also used by externals modules!) + * @param string $origin Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be 'orderdet', 'propaldet'..., else 'order','propal,'.... + * @param int $origin_id Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be Id of origin object (aka line id), else object id + * @param int $fk_parent_line Id of parent line + * @param int $fk_fournprice Supplier price id (to calculate margin) or '' + * @param int $pa_ht Buying price of line (to calculate margin) or '' + * @param string $label Label of the line (deprecated, do not use) + * @param array $array_options extrafields array + * @param int $situation_percent Situation advance percentage + * @param int $fk_prev_id Previous situation line id reference + * @param int|null $fk_unit Code of the unit to use. Null to use the default one + * @param float $pu_ht_devise Unit price in foreign currency + * @param string $ref_ext External reference of the line + * @param int $noupdateafterinsertline No update after insert of line + * @return int Return integer <0 if KO, Id of line if OK + */ + public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $fk_code_ventilation = 0, $info_bits = 0, $fk_remise_except = 0, $price_base_type = 'HT', $pu_ttc = 0, $type = 0, $rang = -1, $special_code = 0, $origin = '', $origin_id = 0, $fk_parent_line = 0, $fk_fournprice = \null, $pa_ht = 0, $label = '', $array_options = array(), $situation_percent = 100, $fk_prev_id = 0, $fk_unit = \null, $pu_ht_devise = 0, $ref_ext = '', $noupdateafterinsertline = 0) + { + } + /** + * Update a detail line + * + * @param int $rowid Id of line to update + * @param string $desc Description of line + * @param float $pu Prix unitaire (HT ou TTC selon price_base_type) (> 0 even for credit note lines) + * @param float $qty Quantity + * @param float $remise_percent Percentage discount of the line + * @param int $date_start Date de debut de validite du service + * @param int $date_end Date de fin de validite du service + * @param float $txtva VAT Rate (Can be '8.5', '8.5 (ABC)') + * @param float $txlocaltax1 Local tax 1 rate + * @param float $txlocaltax2 Local tax 2 rate + * @param string $price_base_type HT or TTC + * @param int $info_bits Miscellaneous information + * @param int $type Type of line (0=product, 1=service) + * @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines). + * @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules) + * @param int $fk_fournprice Id of origin supplier price + * @param int $pa_ht Price (without tax) of product when it was bought + * @param string $label Label of the line (deprecated, do not use) + * @param int $special_code Special code (also used by externals modules!) + * @param array $array_options extrafields array + * @param int $situation_percent Situation advance percentage + * @param ?int $fk_unit Code of the unit to use. Null to use the default one + * @param float $pu_ht_devise Unit price in currency + * @param int<0,1> $notrigger disable line update trigger + * @param string $ref_ext External reference of the line + * @param integer $rang rank of line + * @return int Return integer < 0 if KO, > 0 if OK + */ + public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = self::TYPE_STANDARD, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = \null, $pa_ht = 0, $label = '', $special_code = 0, $array_options = array(), $situation_percent = 100, $fk_unit = \null, $pu_ht_devise = 0, $notrigger = 0, $ref_ext = '', $rang = 0) + { + } + /** + * Check if the percent edited is lower of next invoice line + * + * @param int $idline id of line to check + * @param float $situation_percent progress percentage need to be test + * @return bool false if KO, true if OK + */ + public function checkProgressLine($idline, $situation_percent) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update invoice line with percentage + * + * @param FactureLigne $line Invoice line + * @param int $percent Percentage + * @param boolean $update_price Update object price + * @return void + */ + public function update_percent($line, $percent, $update_price = \true) + { + } + /** + * Delete line in database + * + * @param int $rowid Id of line to delete + * @param int $id Id of object (for a check) + * @return int Return integer <0 if KO, >0 if OK + */ + public function deleteLine($rowid, $id = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set percent discount + * + * @deprecated + * @see setDiscount() + * @param User $user User that set discount + * @param double $remise Discount + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_remise($user, $remise, $notrigger = 0) + { + } + /** + * Set percent discount + * + * @param User $user User that set discount + * @param float $remise Discount + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function setDiscount($user, $remise, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set absolute discount + * + * @param User $user User that set discount + * @param double $remise Discount + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + /* + public function set_remise_absolue($user, $remise, $notrigger = 0) + { + // phpcs:enable + if (empty($remise)) { + $remise = 0; + } + + if ($user->hasRight('facture', 'creer')) { + $error = 0; + + $this->db->begin(); + + $remise = price2num($remise); + + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; + $sql .= ' SET remise_absolue = '.((float) $remise); + $sql .= " WHERE rowid = ".((int) $this->id); + $sql .= ' AND fk_statut = '.self::STATUS_DRAFT; + + dol_syslog(__METHOD__, LOG_DEBUG); + $resql = $this->db->query($sql); + if (!$resql) { + $this->errors[] = $this->db->error(); + $error++; + } + + if (!$error) { + $this->oldcopy = clone $this; + $this->remise_absolue = $remise; + $this->update_price(1); + } + + if (!$notrigger && empty($error)) { + // Call trigger + $result = $this->call_trigger('BILL_MODIFY', $user); + if ($result < 0) { + $error++; + } + // End call triggers + } + + if (!$error) { + $this->db->commit(); + return 1; + } else { + foreach ($this->errors as $errmsg) { + dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); + $this->error .= ($this->error ? ', '.$errmsg : $errmsg); + } + $this->db->rollback(); + return -1 * $error; + } + } + + return 0; + } + */ + /** + * Return next reference of customer invoice not already used (or last reference) + * according to numbering module defined into constant FACTURE_ADDON + * + * @param Societe $soc object company + * @param string $mode 'next' for next value or 'last' for last value + * @return string free ref or last ref + */ + public function getNextNumRef($soc, $mode = 'next') + { + } + /** + * Load miscellaneous information for tab "Info" + * + * @param int $id Id of object to load + * @return void + */ + public function info($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of invoices (eventually filtered on a user) into an array + * + * @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name) + * @param int $draft 0=not draft, 1=draft + * @param User $excluser Object user to exclude + * @param int $socid Id third party + * @param int $limit For pagination + * @param int $offset For pagination + * @param string $sortfield Sort criteria + * @param string $sortorder Sort order + * @return array|int -1 if KO, array with result if OK + */ + public function liste_array($shortlist = 0, $draft = 0, $excluser = \null, $socid = 0, $limit = 0, $offset = 0, $sortfield = 'f.datef,f.rowid', $sortorder = 'DESC') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of invoices qualified to be replaced by another invoice. + * Invoices matching the following rules are returned: + * (Status validated or abandoned for a reason 'other') + not paid + no payment at all + not already replaced + * + * @param int $socid Id thirdparty + * @return array|int Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) + */ + public function list_replacable_invoices($socid = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of invoices qualified to be corrected by a credit note. + * Invoices matching the following rules are returned: + * (validated + payment on process) or classified (paid completely or paid partiely) + not already replaced + not already a credit note + * + * @param int $socid Id thirdparty + * @return array|int Array of invoices ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>) + */ + public function list_qualified_avoir_invoices($socid = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK + */ + public function load_board($user) + { + } + /* gestion des contacts d'une facture */ + /** + * Retourne id des contacts clients de facturation + * + * @return int[] Liste des id contacts facturation + */ + public function getIdBillingContact() + { + } + /** + * Retourne id des contacts clients de livraison + * + * @return int[] Liste des id contacts livraison + */ + public function getIdShippingContact() + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines + * @return int + */ + public function initAsSpecimen($option = '') + { + } + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function loadStateBoard() + { + } + /** + * Create an array of invoice lines + * + * @return int<-1,1> >0 if OK, <0 if KO + */ + public function getLinesArray() + { + } + /** + * Create a document onto disk according to template module. + * + * @param string $modele Generator to use. Caller must set it to obj->model_pdf or GETPOST('model','alpha') for example. + * @param Translate $outputlangs Object lang to use for translation + * @param int<0,1> $hidedetails Hide details of lines + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $hideref Hide ref + * @param ?array $moreparams Array to provide more information + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = \null) + { + } + /** + * Gets the smallest reference available for a new cycle + * + * @return int >= 1 if OK, -1 if error + */ + public function newCycle() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Checks if the invoice is the first of a cycle + * + * @return boolean + */ + public function is_first() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns an array containing the previous situations as Facture objects + * + * @return mixed -1 if error, array of previous situations + */ + public function get_prev_sits() + { + } + /** + * Sets the invoice as a final situation + * + * @param User $user Object user + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function setFinal(\User $user, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Checks if the invoice is the last in its cycle + * + * @return bool Last of the cycle status + */ + public function is_last_in_cycle() + { + } + /** + * Replace a thirdparty id with another one. + * + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty(\DoliDB $dbs, $origin_id, $dest_id) + { + } + /** + * Replace a product id with another one. + * + * @param DoliDB $db Database handler + * @param int $origin_id Old product id + * @param int $dest_id New product id + * @return bool + */ + public static function replaceProduct(\DoliDB $db, $origin_id, $dest_id) + { + } + /** + * Is the customer invoice delayed? + * + * @return bool + */ + public function hasDelay() + { + } + /** + * Currently used for documents generation : to know if retained warranty need to be displayed + * @return bool + */ + public function displayRetainedWarranty() + { + } + /** + * @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT) + * @return float or -1 if not available + */ + public function getRetainedWarrantyAmount($rounding = -1) + { + } + /** + * Change the retained warranty + * + * @param float $value value of retained warranty + * @return int >0 if OK, <0 if KO + */ + public function setRetainedWarranty($value) + { + } + /** + * Change the retained_warranty_date_limit + * + * @param int $timestamp date limit of retained warranty in timestamp format + * @param string $dateYmd date limit of retained warranty in Y m d format + * @return int >0 if OK, <0 if KO + */ + public function setRetainedWarrantyDateLimit($timestamp, $dateYmd = '') + { + } + /** + * Send reminders by emails for invoices validated that are due. + * CAN BE A CRON TASK + * + * @param int $nbdays Delay before due date (or after if delay is negative) + * @param string $paymentmode '' or 'all' by default (no filter), or 'LIQ', 'CHQ', CB', ... + * @param int|string $template Name (or id) of email template (Must be a template of type 'facture_send') + * @param string $datetouse 'duedate' (default) or 'invoicedate' + * @param string $forcerecipient Force email of recipient (for example to send the email to an accountant supervisor instead of the customer) + * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) + */ + public function sendEmailsRemindersOnInvoiceDueDate($nbdays = 0, $paymentmode = 'all', $template = '', $datetouse = 'duedate', $forcerecipient = '') + { + } + /** + * See if current invoice date is posterior to the last invoice date among validated invoices of same type. + * + * @param boolean $allow_validated_drafts return true if the invoice has been validated before returning to DRAFT state. + * @return array{0?:bool,1?:string} return array + */ + public function willBeLastOfSameType($allow_validated_drafts = \false) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /** + * Class to manage invoice lines. + * Saved into database table llx_facturedet + */ + class FactureLigne extends \CommonInvoiceLine + { + /** + * @var string ID to identify managed object + */ + public $element = 'facturedet'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'facturedet'; + /** + * @var FactureLigne + */ + public $oldline; + //! From llx_facturedet + /** + * @var int Id facture + */ + public $fk_facture; + /** + * @var int Id parent line + */ + public $fk_parent_line; + /** + * @var string Description ligne + */ + public $desc; + /** + * @var string External reference of the line + */ + public $ref_ext; + /** + * @var int<0,6> + */ + public $localtax1_type; + // Local tax 1 type + /** + * @var int<0,6> + */ + public $localtax2_type; + // Local tax 2 type + /** + * @var int + */ + public $fk_remise_except; + // Link to line into llx_remise_except + /** + * @var int + */ + public $rang = 0; + /** + * @var int + */ + public $fk_fournprice; + /** + * @var string|int|float + */ + public $pa_ht; + /** + * @var string + */ + public $marge_tx; + /** + * @var string + */ + public $marque_tx; + /** + * @var int + */ + public $tva_npr; + /** + * @var float + */ + public $remise_percent; + /** + * @var string To store the batch to consume in stock when using a POS module + */ + public $batch; + /** + * @var int To store the warehouse where to consume stock when using a POS module + */ + public $fk_warehouse; + /** + * @var string + */ + public $origin; + /** + * @var int + */ + public $origin_id; + /** + * @var int Id in table llx_accounting_bookeeping to know accounting account for product line + */ + public $fk_code_ventilation = 0; + /** + * @var string|int + */ + public $date_start; + /** + * @var string|int + */ + public $date_end; + /** + * @var int<0,1> + */ + public $skip_update_total; + // Skip update price total for special lines + /** + * @var float Situation advance percentage (default 100 for standard invoices) + */ + public $situation_percent; + /** + * @var int Previous situation line id reference + */ + public $fk_prev_id; + /** + * Constructor + * + * @param DoliDB $db handler d'acces base de donnee + */ + public function __construct($db) + { + } + /** + * Load invoice line from database + * + * @param int $rowid id of invoice line to get + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($rowid) + { + } + /** + * Insert line into database + * + * @param int $notrigger 1 no triggers + * @param int $noerrorifdiscountalreadylinked 1=Do not make error if lines is linked to a discount and discount already linked to another + * @return int Return integer <0 if KO, >0 if OK + */ + public function insert($notrigger = 0, $noerrorifdiscountalreadylinked = 0) + { + } + /** + * Update line into database + * + * @param User $user User object + * @param int $notrigger Disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Delete line in database + * + * @param User $tmpuser User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($tmpuser = \null, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update DB line fields total_xxx + * Used by migration + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function update_total() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns situation_percent of the previous line. Used when INVOICE_USE_SITUATION = 1. + * Warning: If invoice is a replacement invoice, this->fk_prev_id is id of the replaced line. + * + * @param int $invoiceid Invoice id + * @param bool $include_credit_note Include credit note or not + * @return float|int Return previous situation percent, 0 or -1 if error + * @see get_allprev_progress() + **/ + public function get_prev_progress($invoiceid, $include_credit_note = \true) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns situation_percent of all the previous line. Used when INVOICE_USE_SITUATION = 2. + * Warning: If invoice is a replacement invoice, this->fk_prev_id is id of the replaced line. + * + * @param int $invoiceid Invoice id + * @param bool $include_credit_note Include credit note or not + * @return float >= 0 + * @see get_prev_progress() + */ + public function get_allprev_progress($invoiceid, $include_credit_note = \true) + { + } + } + /** + * Class to manage stats for invoices (customer and supplier) + */ + class FactureStats extends \Stats + { + public $socid; + public $userid; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; + public $from; + public $field; + public $where = ''; + public $join; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. + * @param string $mode Option ('customer', 'supplier') + * @param int $userid Id user for filter (creation user) + * @param int $typentid Id typent of thirdpary for filter + * @param int $categid Id category of thirdpary for filter + */ + public function __construct(\DoliDB $db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0) + { + } + /** + * Return orders number by month for a year + * + * @param int $year Year to scan + * @param int<0,2> $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{0:int<1,12>,1:int}> Array of values + */ + public function getNbByMonth($year, $format = 0) + { + } + /** + * Return invoices number per year + * + * @return array Array with number by year + */ + public function getNbByYear() + { + } + /** + * Return the invoices amount by month for a year + * + * @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{0:int<1,12>,1:int|float}> Array with amount by month + */ + public function getAmountByMonth($year, $format = 0) + { + } + /** + * Return average amount + * + * @param int $year Year to scan + * @return array,array{0:int<1,12>,1:int|float}> Array of values + */ + public function getAverageByMonth($year) + { + } + /** + * Return nb, total and average + * + * @return array Array of values + */ + public function getAllByYear() + { + } + /** + * Return nb, amount of predefined product for year + * + * @param int $year Year to scan + * @param int $limit Limit + * @return array,array{0:int<1,12>,1:int|float}> Array of values + */ + public function getAllByProduct($year, $limit = 10) + { + } + /** + * Return the invoices amount by year for a number of past years + * + * @param int<0,max> $numberYears Years to scan + * @param int<0,2> $format 0=Label of abscissa is a translated text, 1=Label of abscissa is year, 2=Label of abscissa is last number of year + * @return array Array with amount by year + */ + public function getAmountByYear($numberYears, $format = 0) + { + } + } + /* Copyright (C) 2007-2012 Laurent Destailleur + * Copyright (C) 2024 Frédéric France + * + * 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 . + */ + /** + * \file compta/facture/class/paymentterm.class.php + * \ingroup invoice + * \brief This file is an example for a CRUD class file (Create/Read/Update/Delete) + */ + /** + * Class to manage payment terms records in dictionary + */ + class PaymentTerm + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + //public $element='c_payment_term'; //!< Id that identify managed objects + //public $table_element='c_payment_term'; //!< Name of table without prefix where object is stored + public $context = array(); + /** + * @var int ID + */ + public $id; + /** + * @var int Entity ID + */ + public $entity; + public $code; + public $sortorder; + public $active; + public $libelle; + public $libelle_facture; + public $type_cdr; + public $nbjour; + public $decalage; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create in database + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id object + * @param string $code Code object + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $code = '') + { + } + /** + * Return id of default payment term + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function getDefaultId() + { + } + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $user User making the clone + * @param int $fromid Id of object to clone + * @return int New id of clone + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + } + /** + * Class to manage local tax + */ + class Localtax extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'localtax'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'localtax'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'payment'; + public $ltt; + public $datep; + public $datev; + public $amount; + /** + * @var int + */ + public $accountid; + /** + * @var string + */ + public $fk_type; + public $paymenttype; + /** + * @var int + */ + public $rappro; + /** + * @var string local tax + */ + public $label; + /** + * @var int ID + */ + public $fk_bank; + /** + * @var int ID + */ + public $fk_user_creat; + /** + * @var int ID + */ + public $fk_user_modif; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create in database + * + * @param User $user User that create + * @return int Return integer <0 if KO, >0 if OK + */ + public function create($user) + { + } + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=no, 1=yes (no update trigger) + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Object id + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Hum la function s'appelle 'Solde' elle doit a mon avis calcluer le solde de localtax, non ? + * + * @param int $year Year + * @return int ??? + */ + public function solde($year = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Total de la localtax des factures emises par la societe. + * + * @param int $year Year + * @return int ??? + */ + public function localtax_sum_collectee($year = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Total of localtax paid in invoice + * + * @param int $year Year + * @return int ??? + */ + public function localtax_sum_payee($year = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Total of localtax paid + * + * @param int $year Year + * @return int ??? + */ + public function localtax_sum_reglee($year = 0) + { + } + /** + * Add a payment of localtax + * + * @param User $user Object user that insert + * @return int Return integer <0 if KO, rowid in localtax table if OK + */ + public function addPayment($user) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update the link between localtax payment and the line into llx_bank + * + * @param int $id Id bank account + * @return int Return integer <0 if KO, >0 if OK + */ + public function update_fk_bank($id) + { + } + /** + * Returns clickable name + * + * @param int $withpicto 0=Link, 1=Picto into link, 2=Picto + * @param string $option What the link points to + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0, $option = '') + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /** + * Class to manage cheque delivery receipts + */ + class RemiseCheque extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'chequereceipt'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'bordereau_cheque'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'payment'; + public $num; + public $intitule; + //! Numero d'erreur Plage 1024-1279 + public $errno; + public $type = 'CHQ'; + // 'CHQ', 'TRA', ... + public $amount; + public $date_bordereau; + public $account_id; + public $account_label; + public $author_id; + public $nbcheque; + /** + * @var string Ref + */ + public $ref; + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Load record + * + * @param int $id Id record + * @param string $ref Ref record + * @return int Return integer <0 if KO, > 0 if OK + */ + public function fetch($id, $ref = '') + { + } + /** + * Create a receipt to send cheques + * + * @param User $user User making creation + * @param int $account_id Bank account for cheque receipt + * @param int $limit Limit ref of cheque to this + * @param array $toRemise array with cheques to remise + * @return int Return integer <0 if KO, >0 if OK + */ + public function create($user, $account_id, $limit, $toRemise) + { + } + /** + * Delete deposit from database + * + * @param User $user User that delete + * @return int + */ + public function delete($user) + { + } + /** + * Validate a receipt + * + * @param User $user User + * @return int Return integer <0 if KO, >0 if OK + */ + public function validate($user) + { + } + /** + * Return next reference of cheque receipts not already used (or last reference) + * according to numbering module defined into constant FACTURE_ADDON + * + * @param string $mode 'next' for next value or 'last' for last value + * @return string free ref or last ref + */ + public function getNextNumRef($mode = 'next') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @param string $type Type of payment mode deposit ('CHQ', 'TRA', ...) + * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK + */ + public function load_board($user, $type = 'CHQ') + { + } + /** + * Load indicators this->nb for the state board + * + * @param string $type Type of payment mode deposit ('CHQ', 'TRA', ...) + * @return int Return integer <0 if ko, >0 if ok + */ + public function loadStateBoard($type = 'CHQ') + { + } + /** + * Build document + * + * @param string $model Model name + * @param Translate $outputlangs Object langs + * @return int Return integer <0 if KO, >0 if OK + */ + public function generatePdf($model, $outputlangs) + { + } + /** + * Mets a jour le montant total + * + * @return int 0 en cas de success + */ + public function updateAmount() + { + } + /** + * Insere la remise en base + * + * @param int $account_id Compte bancaire concerne + * @return int + */ + public function removeCheck($account_id) + { + } + /** + * Check return management + * Reopen linked invoices and create a new negative payment. + * + * @param int $bank_id Id of bank transaction line concerned + * @param integer $rejection_date Date to use on the negative payment + * @return int Id of negative payment line created + */ + public function rejectCheck($bank_id, $rejection_date) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set the creation date + * + * @param User $user Object user + * @param int $date Date creation + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_date($user, $date) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set the ref of bordereau + * + * @param User $user Object user + * @param int $ref ref of bordereau + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_number($user, $ref) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines + * @return int + */ + public function initAsSpecimen($option = '') + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param string $option Indicate where the link points to + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /* Copyright (C) 2023 Laurent Destailleur + * + * 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 . + */ + /** + * \file htdocs/core/class/commondict.class.php + * \ingroup core + * \brief File of parent class of all other dictionary classes + */ + /** + * Parent class of all other dictionary classes + */ + abstract class CommonDict + { + /** + * @var DoliDB Database handler (result of a new DoliDB) + */ + public $db; + /** + * @var string Error string + * @see $errors + */ + public $error; + /** + * @var string[] Array of error strings + */ + public $errors = array(); + /** + * @var int The object identifier + */ + public $id; + /** + * @var int The environment ID when using a multicompany module + */ + public $entity; + /** + * @var string The code + */ + public $code; + /** + * @var string The label + */ + public $label; + /** + * @var int<0,1> 1 if the entry is active, 0 if not + */ + public $active; + } + /** + * Class Cpaiement + */ + class Cpaiement extends \CommonDict + { + /** + * @var string Id to identify managed objects + */ + public $element = 'cpaiement'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'c_paiement'; + /** + * @var string + * @deprecated + * @see $label + */ + public $libelle; + public $type; + public $active; + public $accountancy_code; + public $module; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = \null) + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimen() + { + } + } + /** + * Class to manage payments of customer invoices + */ + class Paiement extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'payment'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'paiement'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'payment'; + /** + * @var int Invoice ID + */ + public $facid; + /** + * @var int Company ID + */ + public $socid; + /** + * @var int|string + */ + public $datepaye; + /** + * @var int|string same than $datepaye + */ + public $date; + /** + * @deprecated + * @see $amount, $amounts + */ + public $total; + /** + * @deprecated + * @see $amount, $amounts + */ + public $montant; + /** + * @var float Total amount of payment (in the main currency) + */ + public $amount; + /** + * @var float Total amount of payment (in the currency of the bank account) + */ + public $multicurrency_amount; + /** + * @var float[] array: invoice ID => amount for that invoice (in the main currency) + */ + public $amounts = array(); + /** + * @var float[] array: invoice ID => amount for that invoice (in the invoice's currency) + */ + public $multicurrency_amounts = array(); + /** + * @var float[] Multicurrency rate (array: invoice ID => currency rate ("taux" in French) for that invoice) + */ + public $multicurrency_tx = array(); + /** + * @var string[] Multicurrency code (array: invoice ID => currency code for that invoice) + */ + public $multicurrency_code = array(); + /** + * @var float Excess received in TakePOS cash payment + */ + public $pos_change = 0.0; + public $author; + /** + * @var int ID of mode of payment. Is saved into fields fk_paiement on llx_paiement = id of llx_c_paiement. Can get value from code using ... + */ + public $paiementid; + /** + * @var string Code of mode of payment. + */ + public $paiementcode; + /** + * @var string Type of payment label + */ + public $type_label; + /** + * @var string Type of payment code (seems duplicate with $paiementcode); + */ + public $type_code; + /** + * @var string + * @deprecated + * @see $num_payment + */ + public $num_paiement; + /** + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") + */ + public $num_payment; + /** + * @var string Id of external payment mode + */ + public $ext_payment_id; + /** + * @var string Id of prelevement + */ + public $id_prelevement; + /** + * @var string num_prelevement + */ + public $num_prelevement; + /** + * @var string Name of external payment mode + */ + public $ext_payment_site; + /** + * @var int bank account id of payment + * @deprecated + * @see $fk_account + */ + public $bank_account; + /** + * @var int bank account id of payment + */ + public $fk_account; + /** + * @var int id of payment line in bank account + */ + public $bank_line; + // fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...) + // fk_paiement dans llx_paiement_facture est le rowid du paiement + /** + * @var int payment id + */ + public $fk_paiement; + // Type of payment + /** + * @var string payment external reference + */ + public $ref_ext; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Load payment from database + * + * @param int $id Id of payment to get + * @param string $ref Ref of payment to get (currently ref = id but this may change in future) + * @param int $fk_bank Id of bank line associated to payment + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = '', $fk_bank = 0) + { + } + /** + * Create payment of invoices into database. + * Use this->amounts to have list of invoices for the payment. + * For payment of a customer invoice, amounts are positive, for payment of credit note, amounts are negative + * + * @param User $user Object user + * @param int $closepaidinvoices 1=Also close paid invoices to paid, 0=Do nothing more + * @param Societe $thirdparty Thirdparty + * @return int id of created payment, < 0 if error + */ + public function create($user, $closepaidinvoices = 0, $thirdparty = \null) + { + } + /** + * Delete a payment and generated links into account + * - Si le paiement porte sur un ecriture compte qui est rapprochee, on refuse + * - Si le paiement porte sur au moins une facture a "payee", on refuse + * + * @param User $user User making the deletion + * @param int $notrigger No trigger + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Add a record into bank for payment + links between this bank record and sources of payment. + * All payment properties (this->amount, this->amounts, ...) must have been set first like after a call to create(). + * + * @param User $user Object of user making payment + * @param string $mode 'payment', 'payment_supplier' + * @param string $label Label to use in bank record + * @param int $accountid Id of bank account to do link with + * @param string $emetteur_nom Name of transmitter + * @param string $emetteur_banque Name of bank + * @param int $notrigger No trigger + * @param string $accountancycode When we record a free bank entry, we must provide accounting account if accountancy module is on. + * @param string $addbankurl 'direct-debit' or 'credit-transfer': Add another entry into bank_url. + * @return int Return integer <0 if KO, bank_line_id if OK + */ + public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque, $notrigger = 0, $accountancycode = '', $addbankurl = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update the link between the Payment and the line generated in llx_bank + * + * @param int $id_bank Id compte bancaire + * @return int Return integer <0 if KO, >0 if OK + */ + public function update_fk_bank($id_bank) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Updates the payment date + * + * @param int $date New date + * @return int Return integer <0 if KO, 0 if OK + */ + public function update_date($date) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Updates the payment number + * + * @param string $num_payment New num + * @return int Return integer <0 if KO, 0 if OK + */ + public function update_num($num_payment) + { + } + /** + * Validate payment + * + * @param User|null $user User making validation + * @return int Return integer <0 if KO, >0 if OK + * @deprecated + */ + public function valide(\User $user = \null) + { + } + /** + * Validate payment + * + * @param User|null $user User making validation + * @return int Return integer <0 if KO, >0 if OK + */ + public function validate(\User $user = \null) + { + } + /** + * Reject payment + * + * @param User|null $user User making reject + * @return int Return integer <0 if KO, >0 if OK + */ + public function reject(\User $user = \null) + { + } + /** + * Information sur l'objet + * + * @param int $id id du paiement don't il faut afficher les infos + * @return void + */ + public function info($id) + { + } + /** + * Return list of invoices the payment is related to. + * + * @param string $filter Filter + * @return int|array Return integer <0 if KO or array of invoice id + * @see getAmountsArray() + */ + public function getBillsArray($filter = '') + { + } + /** + * Return list of amounts of payments. + * + * @return int|array Array of amount of payments + * @see getBillsArray() + */ + public function getAmountsArray() + { + } + /** + * Return next reference of customer invoice not already used (or last reference) + * according to numbering module defined into constant FACTURE_ADDON + * + * @param Societe $soc object company + * @param string $mode 'next' for next value or 'last' for last value + * @return string free ref or last ref + */ + public function getNextNumRef($soc, $mode = 'next') + { + } + /** + * get the right way of payment + * + * @return string 'dolibarr' if standard comportment or paid in main currency, 'customer' if payment received from multicurrency inputs + */ + public function getWay() + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines + * @return int + */ + public function initAsSpecimen($option = '') + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param string $option What the link points to + * @param string $mode 'withlistofinvoices'=Include list of invoices into tooltip + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more CSS + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0, $option = '', $mode = 'withlistofinvoices', $notooltip = 0, $morecss = '') + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load the third party of object, from id into this->thirdparty. + * For payments, take the thirdparty linked to the first invoice found. This is enough because payments are done on invoices of the same thirdparty. + * + * @param int $force_thirdparty_id Force thirdparty id + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch_thirdparty($force_thirdparty_id = 0) + { + } + /** + * Return if payment is reconciled + * + * @return boolean True if payment is reconciled + */ + public function isReconciled() + { + } + } + /** + * Class to manage withdrawal receipts + */ + class BonPrelevement extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'widthdraw'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'prelevement_bons'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'payment'; + public $date_echeance; + public $raison_sociale; + public $reference_remise; + public $emetteur_code_guichet; + public $emetteur_numero_compte; + public $emetteur_code_banque; + public $emetteur_number_key; + public $sepa_xml_pti_in_ctti; + public $emetteur_iban; + public $emetteur_bic; + public $emetteur_ics; + public $user_trans; + public $user_credit; + public $total; + public $fetched; + public $labelStatus = array(); + public $factures = array(); + /** + * @var array + */ + public $methodes_trans = array(); + public $invoice_in_error = array(); + public $thirdparty_in_error = array(); + /** + * @var resource Handler of the file for direct debit or credit transfer order + */ + public $file; + /** + * @var string filename + */ + public $filename; + const STATUS_DRAFT = 0; + const STATUS_TRANSFERED = 1; + const STATUS_CREDITED = 2; + // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type + const STATUS_DEBITED = 2; + // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type + /** + * 'type' field format: + * 'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', + * 'select' (list of values are in 'options'), + * 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]', + * 'chkbxlst:...', + * 'varchar(x)', + * 'text', 'text:none', 'html', + * 'double(24,8)', 'real', 'price', + * 'date', 'datetime', 'timestamp', 'duration', + * 'boolean', 'checkbox', 'radio', 'array', + * 'mail', 'phone', 'url', 'password', 'ip' + * Note: Filter must be a Dolibarr filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled("multicurrency")' ...) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0') + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage) + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'validate' is 1 if need to validate with $this->validateField() + * 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value) + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => 0), 'ref' => array('type' => 'varchar(12)', 'label' => 'Ref', 'enabled' => 1, 'position' => 15, 'notnull' => 0, 'visible' => -1, 'csslist' => 'tdoverflowmax150', 'showoncombobox' => 1), 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 25, 'notnull' => 0, 'visible' => -1), 'amount' => array('type' => 'double(24,8)', 'label' => 'Amount', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => -1), 'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'position' => 500, 'notnull' => 0, 'visible' => -1, 'arrayofkeyval' => array(0 => 'Wait', 1 => 'Transfered', 2 => 'Credited')), 'credite' => array('type' => 'smallint(6)', 'label' => 'Credite', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1), 'note' => array('type' => 'text', 'label' => 'Note', 'enabled' => 1, 'position' => 45, 'notnull' => 0, 'visible' => -1), 'date_trans' => array('type' => 'datetime', 'label' => 'Datetrans', 'enabled' => 1, 'position' => 50, 'notnull' => 0, 'visible' => -1), 'method_trans' => array('type' => 'smallint(6)', 'label' => 'Methodtrans', 'enabled' => 1, 'position' => 55, 'notnull' => 0, 'visible' => -1), 'fk_user_trans' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fkusertrans', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), 'date_credit' => array('type' => 'datetime', 'label' => 'Datecredit', 'enabled' => 1, 'position' => 65, 'notnull' => 0, 'visible' => -1), 'fk_user_credit' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fkusercredit', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), 'type' => array('type' => 'varchar(16)', 'label' => 'Type', 'enabled' => 1, 'position' => 75, 'notnull' => 0, 'visible' => -1), 'fk_bank_account' => array('type' => 'integer', 'label' => 'Fkbankaccount', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx')); + public $rowid; + public $ref; + public $datec; + public $amount; + /** + * @var int Status + * @deprecated + */ + public $statut; + /** + * @var int Status + */ + public $status; + public $credite; + public $note; + public $date_trans; + /** + * @var int Current transport method, index to $methodes_trans + */ + public $method_trans; + public $fk_user_trans; + public $date_credit; + public $fk_user_credit; + public $type; + public $fk_bank_account; + // END MODULEBUILDER PROPERTIES + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Add invoice to withdrawal + * + * @param int $invoice_id ID of invoice to add or ID of salary to add + * @param int $client_id id invoice customer + * @param string $client_nom customer name + * @param int $amount amount of invoice + * @param string $code_banque code of bank withdrawal + * @param string $code_guichet code of bank's office + * @param string $number bank account number + * @param string $number_key number key of account number + * @param string $type 'debit-order' or 'bank-transfer' + * @param string $sourcetype 'salary' for salary, '' for invoices + * @return int >0 if OK, <0 if KO + */ + public function AddFacture($invoice_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key, $type = 'debit-order', $sourcetype = '') + { + } + /** + * Add line to withdrawal + * + * @param int $line_id ID of line added (returned parameter) + * @param int $client_id ID of thirdparty for invoices, ID of user for salaries + * @param string $client_nom customer name + * @param int $amount amount of invoice + * @param string $code_banque code of bank withdrawal + * @param string $code_guichet code of bank's office + * @param string $number bank account number + * @param string $number_key number key of account number + * @param string $sourcetype 'salary' for salary, '' for invoices + * @return int >0 if OK, <0 if KO + */ + public function addline(&$line_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key, $sourcetype = '') + { + } + /** + * Return error string + * + * @param int $error Id of error + * @return string Error string + */ + public function getErrorString($error) + { + } + /** + * Get object and lines from database + * + * @param int $rowid Id of object to load + * @param string $ref Ref of direct debit + * @return int >0 if OK, 0=Not found, <0 if KO + */ + public function fetch($rowid, $ref = '') + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set direct debit or credit transfer order to "paid" status. + * Then create the payment for each invoice or salary of the prelemevement_bon. + * + * @param User $user Id of user + * @param int $date date of action + * @param string $type 'salary' for type=salary + * @return int >0 if OK, <0 if KO + */ + public function set_infocredit($user, $date, $type = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set withdrawal to transmitted status + * + * @param User $user Id of user + * @param int $date Date of action + * @param int $method Method of transmission to bank (0=Internet, 1=Api...) + * @return int >0 if OK, <0 if KO + */ + public function set_infotrans($user, $date, $method) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns amount waiting for direct debit payment or credit transfer payment + * + * @param string $mode 'direct-debit' or 'bank-transfer' + * @param string $type for type=salary + * @return float Return integer 0 if OK, <0 if KO + */ + public function delete($user = \null, $notrigger = 0) + { + } + /** + * Returns clickable name (with picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string URL of target + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Delete a notification def by id + * + * @param int $rowid id of notification + * @return int 0 if OK, <0 if KO + */ + public function deleteNotificationById($rowid) + { + } + /** + * Delete a notification + * + * @param int|User $user notification user + * @param string $action notification action + * @return int >0 if OK, <0 if KO + */ + public function deleteNotification($user, $action) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Add a notification + * + * @param DoliDB $db database handler + * @param int|User $user notification user + * @param string $action notification action + * @return int 0 if OK, <0 if KO + */ + public function addNotification($db, $user, $action) + { + } + /** + * Generate a direct debit or credit transfer file. + * Generation Formats: + * - Europe: SEPA (France: CFONB no more supported, Spain: AEB19 if external module EsAEB is enabled) + * - Others countries: Warning message + * File is generated with name this->filename + * + * @param string $format FRST, RCUR or ALL + * @param int $executiondate Timestamp date to execute transfer + * @param string $type 'direct-debit' or 'bank-transfer' + * @param int $fk_bank_account Bank account ID the receipt is generated for. Will use the ID into the setup of module Direct Debit or Credit Transfer if 0. + * @param int $forsalary If the SEPA is to pay salaries + * @return int >=0 if OK, <0 if KO + */ + public function generate($format = 'ALL', $executiondate = 0, $type = 'direct-debit', $fk_bank_account = 0, $forsalary = 0) + { + } + /** + * Generate dynamically a RUM number for a customer bank account + * + * @param string $row_code_client Customer code (soc.code_client) + * @param int $row_datec Creation date of bank account (rib.datec) + * @param string $row_drum Id of customer bank account (rib.rowid) + * @return string RUM number + */ + public static function buildRumNumber($row_code_client, $row_datec, $row_drum) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Write recipient of request (customer) + * + * @param int $rowid id of line + * @param string $client_nom name of customer + * @param string $rib_banque code of bank + * @param string $rib_guichet code of bank office + * @param string $rib_number bank account + * @param float $amount amount + * @param string $ref ref of invoice + * @param int $facid id of invoice + * @param string $rib_dom bank address + * @param string $type 'direct-debit' or 'bank-transfer' + * @return void + * @see EnregDestinataireSEPA() + */ + public function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $ref, $facid, $rib_dom = '', $type = 'direct-debit') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Write recipient (thirdparty concerned by request) + * + * @param string $row_code_client soc.code_client as code, + * @param string $row_nom pl.client_nom AS name, + * @param string $row_address soc.address AS adr, + * @param string $row_zip soc.zip + * @param string $row_town soc.town + * @param string $row_country_code c.code AS country, + * @param string $row_cb pl.code_banque AS cb, Not used for SEPA + * @param string $row_cg pl.code_guichet AS cg, Not used for SEPA + * @param string $row_cc pl.number AS cc, Not used for SEPA + * @param float $row_somme pl.amount AS somme, + * @param string $row_ref Invoice ref (f.ref) or Salary ref + * @param int $row_idfac p.fk_facture AS idfac or p.fk_facture_fourn or p.fk_salary, + * @param string $row_iban rib.iban_prefix AS iban, + * @param string $row_bic rib.bic AS bic, + * @param string $row_datec rib.datec, + * @param string $row_drum rib.rowid used to generate rum + * @param string $row_rum rib.rum Rum defined on company bank account + * @param string $type 'direct-debit' or 'bank-transfer' + * @param string $row_comment A free text string for the Unstructured data field + * @return string Return string with SEPA part DrctDbtTxInf + * @see EnregDestinataire() + */ + 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:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Write sender of request (me). + * + * @param string $type 'direct-debit' or 'bank-transfer' + * @return void + * @see EnregEmetteurSEPA() + */ + public function EnregEmetteur($type = 'direct-debit') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Write sender of request (me). + * Note: The tag PmtInf is opened here but closed into caller + * + * @param Conf $configuration conf + * @param int $ladate Date + * @param int $nombre 0 or 1 + * @param float $total Total + * @param string $CrLf End of line character + * @param string $format FRST or RCUR or ALL + * @param string $type 'direct-debit' or 'bank-transfer' + * @param int $fk_bank_account Bank account ID the receipt is generated for. Will use the ID into the setup of module Direct Debit or Credit Transfer if 0. + * @return string String with SEPA Sender + * @see EnregEmetteur() + */ + public function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf = '\\n', $format = 'FRST', $type = 'direct-debit', $fk_bank_account = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Write end + * + * @param int $total total amount + * @return void + */ + public function EnregTotal($total) + { + } + /** + * Return status label of object + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return status label for a status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label + */ + public function LibStatut($status, $mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @param string $mode Mode 'direct_debit' or 'credit_transfer' + * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK + */ + public function load_board($user, $mode) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + /** + * Check if is bon prelevement for salary invoice + * + * @return int 1 if OK, O if K0 + */ + public function checkIfSalaryBonPrelevement() + { + } + } + /* Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2015 Marcos García + * + * 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 . + * + */ + /** + * \file htdocs/compta/prelevement/class/ligneprelevement.class.php + * \ingroup prelevement + * \brief File of class to manage lines of Direct Debit orders + */ + /** + * Class to manage withdrawals + */ + class LignePrelevement + { + /** + * @var int ID + */ + public $id; + /** + * @var float Amount + */ + public $amount; + /** + * @var int Socid + */ + public $socid; + /** + * @var int Status of the line + */ + public $statut; + /** + * @var string Ref of bon + */ + public $bon_ref; + /** + * @var int ID of bon + */ + public $bon_rowid; + /** + * @var DoliDB Database handler. + */ + public $db; + public $labelStatus = array(); + const STATUS_DRAFT = 0; + const STATUS_NOT_USED = 1; + const STATUS_CREDITED = 2; + // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type + const STATUS_DEBITED = 2; + // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type + const STATUS_REJECTED = 3; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Recupere l'objet prelevement + * + * @param int $rowid Id de la facture a recuperer + * @return integer Return integer <0 if KO, >=0 if OK + */ + public function fetch($rowid) + { + } + /** + * Return status label of object + * + * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto + * @return string Label + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return status label for a status + * + * @param int $status Id status + * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto + * @return null|string Return status label (or null if $mode != 0, 1, 2, 3 or 4) + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty(\DoliDB $dbs, $origin_id, $dest_id) + { + } + } + /* Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2021 OpenDsi + * Copyright (C) 2024 Laurent Destailleur + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/compta/prelevement/class/rejetprelevement.class.php + * \ingroup prelevement + * \brief File of class to manage standing orders rejects + */ + /** + * Class to manage standing orders rejects + */ + class RejetPrelevement + { + /** + * @var int ID + */ + public $id; + /** + * @var DoliDB Database handler. + */ + public $db; + public $type; + //prelevement or bank transfer + public $bon_id; + public $user; + public $date_rejet; + /** + * @var string Reason of error + */ + public $motif; + /** + * @var string Label status of invoicing + */ + public $invoicing; + /** + * @var string[] Labels of reason + */ + public $motifs; + /** + * @var string[] Labels of invoicing status + */ + public $labelsofinvoicing; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param User $user Object user + * @param string $type Type ('direct-debit' for direct debit or 'bank-transfer' for credit transfer) + */ + public function __construct($db, $user, $type) + { + } + /** + * Create a reject + * + * @param User $user User object + * @param int $id Id + * @param string $motif Motif + * @param int $date_rejet Date reject + * @param int $bonid Bon id + * @param int $facturation 1=Bill the reject + * @return int Return >=0 if OK, <0 if KO + */ + public function create($user, $id, $motif, $date_rejet, $bonid, $facturation = 0) + { + } + /** + * Retrieve withdrawal object + * + * @param int $rowid id of invoice to retrieve + * @return int + */ + public function fetch($rowid) + { + } + } + /* Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Florian Henry + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2024 Frédéric France + * + * 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 . + */ + /** + * \file htdocs/compta/sociales/class/cchargesociales.class.php + * \ingroup tax + * \brief File to manage type of social/fiscal taxes + */ + // Put here all includes required by your class file + //require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; + //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** + * Class Cchargesociales + */ + class Cchargesociales + { + public $db; + public $id; + /** + * @var string Id to identify managed objects + */ + public $element = 'cchargesociales'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'c_chargesociales'; + /** + * @var string Label + * @deprecated + */ + public $libelle; + /** + * @var string Label + */ + public $label; + public $deductible; + public $active; + public $code; + /** + * @var int ID + */ + public $fk_pays; + /** + * @var string module + */ + public $module; + public $accountancy_code; + /** + * @var array array of errors + */ + public $errors = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = \null) + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $user User making the clone + * @param int $fromid Id of object to clone + * @return int New id of clone + */ + /*public function createFromClone(User $user, $fromid) + { + dol_syslog(__METHOD__, LOG_DEBUG); + + $error = 0; + $object = new Cchargesociales($this->db); + + $this->db->begin(); + + // Load source object + $object->fetch($fromid); + // Reset object + $object->id = 0; + + // Clear fields + // ... + + // Create clone + $this->context['createfromclone'] = 'createfromclone'; + $result = $object->create($user); + + // Other options + if ($result < 0) { + $error++; + $this->errors = $object->errors; + dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); + } + + unset($this->context['createfromclone']); + + // End + if (!$error) { + $this->db->commit(); + + return $object->id; + } else { + $this->db->rollback(); + + return -1; + } + }*/ + /** + * Return a link to the user card (with optionally the picto) + * Use this->id,this->lastname, this->firstname + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to + * @param integer $notooltip 1=Disable tooltip + * @param int $maxlen Max length of visible user name + * @param string $morecss Add more css on link + * @return string String with URL + */ + /*public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $maxlen = 24, $morecss = '') + { + global $langs, $conf, $db; + global $dolibarr_main_authentication, $dolibarr_main_demo; + global $menumanager; + + + $result = ''; + $companylink = ''; + + $label = ''.$langs->trans("MyModule").''; + $label .= '
'; + $label .= ''.$langs->trans('Ref').': '.$this->ref; + + $link = 'ref.$linkend; + return $result; + }*/ + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + /*public function getLibStatut($mode = 0) + { + return $this->LibStatut($this->status, $mode); + }*/ + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimen() + { + } + } + /** + * Class for managing the social charges. + * The collected VAT is computed only on the paid invoices/charges + */ + class ChargeSociales extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'chargesociales'; + public $table = 'chargesociales'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'chargesociales'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'bill'; + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + /** + * @var int|string $date_ech + */ + public $date_ech; + public $label; + public $type; + public $type_label; + public $type_code; + public $type_accountancy_code; + public $amount; + public $paye; + /** + * @deprecated + */ + public $periode; + public $period; + /** + * @deprecated Use label instead + */ + public $lib; + /** + * @var int account ID + */ + public $fk_account; + /** + * @var int account ID (identical to fk_account) + */ + public $accountid; + /** + * @var int payment type (identical to mode_reglement_id in commonobject class) + */ + public $paiementtype; + public $mode_reglement_id; + public $mode_reglement_code; + public $mode_reglement; + /** + * @var int ID + */ + public $fk_project; + /** + * @var int ID + */ + public $fk_user; + /** + * @var double total + */ + public $total; + public $totalpaid; + const STATUS_UNPAID = 0; + const STATUS_PAID = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Retrouve et charge une charge sociale + * + * @param int $id Id + * @param string $ref Ref + * @return int Return integer <0 KO >0 OK + */ + public function fetch($id, $ref = '') + { + } + /** + * Check if a social contribution can be created into database + * + * @return boolean True or false + */ + public function check() + { + } + /** + * Create a social contribution into database + * + * @param User $user User making creation + * @return int Return integer <0 if KO, id if OK + */ + public function create($user) + { + } + /** + * Delete a social contribution + * + * @param User $user Object user making delete + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user) + { + } + /** + * Update social or fiscal contribution + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user, $notrigger = 0) + { + } + /** + * Calculate amount remaining to pay by year + * + * @param int $year Year + * @return int|float Returns -1 when error (Note: could be mistaken with an amount) + */ + public function solde($year = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Tag social contribution as paid completely + * + * @deprecated + * @see setPaid() + * @param User $user Object user making change + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_paid($user) + { + } + /** + * Tag social contribution as paid completely + * + * @param User $user Object user making change + * @return int Return integer <0 if KO, >0 if OK + */ + public function setPaid($user) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Remove tag paid on social contribution + * + * @deprecated + * @see setUnpaid() + * @param User $user Object user making change + * @return int Return integer <0 if KO, >0 if OK + */ + public function set_unpaid($user) + { + } + /** + * Remove tag paid on social contribution + * + * @param User $user Object user making change + * @return int Return integer <0 if KO, >0 if OK + */ + public function setUnpaid($user) + { + } + /** + * Retourne le libelle du statut d'une charge (impaye, payee) + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto + * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, 1 otherwise) + * @return string Label + */ + public function getLibStatut($mode = 0, $alreadypaid = -1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Renvoi le libelle d'un statut donne + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto + * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, 1 otherwise) + * @return string Label + */ + public function LibStatut($status, $mode = 0, $alreadypaid = -1) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param int $short 1=Return just URL + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with link + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $short = 0, $save_lastsearch_value = -1) + { + } + /** + * Return amount of payments already done + * + * @return int Amount of payment already done, <0 if KO + */ + public function getSommePaiement() + { + } + /** + * Charge l'information d'ordre info dans l'objet entrepot + * + * @param int $id Id of social contribution + * @return int Return integer <0 if KO, >0 if OK + */ + public function info($id) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /** + * Class to manage payments of social contributions + */ + class PaymentSocialContribution extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'paiementcharge'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'paiementcharge'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'payment'; + /** + * @var string Label + */ + public $label; + /** + * @var int ID + */ + public $fk_charge; + public $datec = ''; + public $datep = ''; + /** + * @var string + */ + public $type_code; + /** + * @var string + */ + public $type_label; + /** + * @var int + */ + public $bank_account; + /** + * @var int + */ + public $bank_line; + /** + * @deprecated Use $amount instead. + * @see $amount + * @var float|int + */ + public $total; + /** + * @var float|int + */ + public $amount; + // Total amount of payment + /** + * @var array + */ + public $amounts = array(); + // Array of amounts + /** + * @var int ID + */ + public $fk_typepaiement; + /** + * @var string + * @deprecated Use $num_payment instead + * @see $num_payment + */ + public $num_paiement; + /** + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") + */ + public $num_payment; + /** + * @var int ID + */ + public $fk_bank; + /** + * @var int ID + */ + public $fk_user_creat; + /** + * @var int ID + */ + public $fk_user_modif; + /** + * @var int ID + */ + public $chid; + /** + * @var int|string datepaye + */ + public $datepaye; + /** + * @var int|string paiementtype + */ + public $paiementtype; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create payment of social contribution into database. + * Use this->amounts to have list of lines for the payment + * + * @param User $user User making payment + * @param int $closepaidcontrib 1=Also close paid contributions to paid, 0=Do nothing more + * @return int Return integer <0 if KO, id of payment if OK + */ + public function create($user, $closepaidcontrib = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id object + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id) + { + } + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $user User making the clone + * @param int $fromid Id of object to clone + * @return int New id of clone + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Add record into bank for payment with links between this bank record and invoices of payment. + * All payment properties must have been set first like after a call to create(). + * + * @param User $user Object of user making payment + * @param string $mode 'payment_sc' + * @param string $label Label to use in bank record + * @param int $accountid Id of bank account to do link with + * @param string $emetteur_nom Name of transmitter + * @param string $emetteur_banque Name of bank + * @return int Return integer <0 if KO, >0 if OK + */ + public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update the link between the Payment and the line generated in llx_bank + * + * @param int $id_bank Id if bank + * @return int >0 if OK, <=0 if KO + */ + public function update_fk_bank($id_bank) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $maxlen Longueur max libelle + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0, $maxlen = 0) + { + } + /** + * Return if object was dispatched into bookkeeping + * + * @return int Return integer <0 if KO, 0=no, 1=yes + */ + public function getVentilExportCompta() + { + } + } + /** + * Class to manage payments of social contributions + */ + class PaymentVAT extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'payment_vat'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'payment_vat'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'payment'; + /** + * @var int ID + */ + public $fk_tva; + public $datec = ''; + public $datep = ''; + /** + * @deprecated Use $amount instead + * @see $amount + * @var float|int + */ + public $total; + /** + * @var float|int + */ + public $amount; + // Total amount of payment + /** + * @var array + */ + public $amounts = array(); + // Array of amounts + /** + * @var int ID + */ + public $fk_typepaiement; + /** + * @var string + * @deprecated Use $num_payment instead + * @see $num_payment + */ + public $num_paiement; + /** + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") + */ + public $num_payment; + /** + * @var int ID + */ + public $fk_bank; + /** + * @var int ID + */ + public $fk_user_creat; + /** + * @var int ID + */ + public $fk_user_modif; + /** + * @var int ID + */ + public $chid; + /** + * @var string lib + * @deprecated + * @see $label + */ + public $lib; + /** + * @var int|string datepaye + */ + public $datepaye; + /** + * @var string + */ + public $type_code; + /** + * @var string + */ + public $type_label; + /** + * @var int + */ + public $bank_account; + /** + * @var int + */ + public $bank_line; + /** + * @var int|string paiementtype + */ + public $paiementtype; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create payment of vat into database. + * Use this->amounts to have list of lines for the payment + * + * @param User $user User making payment + * @param int $closepaidvat 1=Also close paid contributions to paid, 0=Do nothing more + * @return int Return integer <0 if KO, id of payment if OK + */ + public function create($user, $closepaidvat = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id object + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id) + { + } + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $user User making the clone + * @param int $fromid Id of object to clone + * @return int New id of clone + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Add record into bank for payment with links between this bank record and invoices of payment. + * All payment properties must have been set first like after a call to create(). + * + * @param User $user Object of user making payment + * @param string $mode 'payment_sc' + * @param string $label Label to use in bank record + * @param int $accountid Id of bank account to do link with + * @param string $emetteur_nom Name of transmitter + * @param string $emetteur_banque Name of bank + * @return int Return integer <0 if KO, >0 if OK + */ + public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update link between vat payment and line in llx_bank generated + * + * @param int $id_bank Id if bank + * @return int >0 if OK, <=0 if KO + */ + public function update_fk_bank($id_bank) + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Libelle + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $maxlen Longueur max libelle + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0, $maxlen = 0) + { + } + } + /** + * Class to manage VAT - Value-added tax + * (also known in French as TVA - Taxe sur la valeur ajoutée) + */ + class Tva extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'tva'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'tva'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'payment'; + /** + * @var float + * @deprecated + * @see $amount + */ + public $total; + /** + * @var int Payment date + */ + public $datep; + /** + * @var int Validation date + */ + public $datev; + /** + * @var float|string VAT amount + */ + public $amount; + /** + * @var int Payment type ID + */ + public $type_payment; + /** + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") + */ + public $num_payment; + /** + * @var int Creation date + */ + public $datec; + /** + * @var int ID + */ + public $fk_type; + /** + * @var int + */ + public $paye; + /** + * @var int + */ + public $rappro; + /** + * @var string label + */ + public $label; + /** + * @var int ID + */ + public $fk_bank; + /** + * @var int accountid + */ + public $accountid; + /** + * @var int ID + */ + public $fk_user_creat; + /** + * @var int ID + */ + public $fk_user_modif; + /** + * @var int|string paiementtype + */ + public $paiementtype; + const STATUS_UNPAID = 0; + const STATUS_PAID = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create in database + * + * @param User $user User that create + * @return int Return integer <0 if KO, >0 if OK + */ + public function create($user) + { + } + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=no, 1=yes (no update trigger) + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user, $notrigger = 0) + { + } + /** + * Tag TVA as paid completely + * + * @param User $user Object user making change + * @return int Return integer <0 if KO, >0 if OK + */ + public function setPaid($user) + { + } + /** + * Remove tag paid on TVA + * + * @param User $user Object user making change + * @return int Return integer <0 if KO, >0 if OK + */ + public function setUnpaid($user) + { + } + /** + * Load object in memory from database + * + * @param int $id id object + * @param string $ref Ref of VAT (not used yet) + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $ref = '') + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Balance of VAT + * + * @param int $year Year + * @return double Amount + */ + public function solde($year = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Total of the VAT from invoices emitted by the thirdparty. + * + * @param int $year Year + * @return double Amount + */ + public function tva_sum_collectee($year = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * VAT paid + * + * @param int $year Year + * @return double Amount + */ + public function tva_sum_payee($year = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Total of the VAT paid + * + * @param int $year Year + * @return double Amount + */ + public function tva_sum_reglee($year = 0) + { + } + /** + * Create in database + * + * @param User $user Object user that insert + * @return int Return integer <0 if KO, rowid in tva table if OK + */ + public function addPayment($user) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update link between payment tva and line generate into llx_bank + * + * @param int $id_bank Id bank account + * @return int Return integer <0 if KO, >0 if OK + */ + public function update_fk_bank($id_bank) + { + } + /** + * Send name clickable (with possibly the picto) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param string $option link option + * @param int $notooltip 1=Disable tooltip + * @param string $morecss More CSS + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string Chaine with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + /** + * Return amount of payments already done + * + * @return int Amount of payment already done, <0 if KO + */ + public function getSommePaiement() + { + } + /** + * Information of vat payment object + * + * @param int $id Id of vat payment + * @return void + */ + public function info($id) + { + } + /** + * Return the label of the VAT status f object + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto + * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, 1 otherwise) + * @return string Label + */ + public function getLibStatut($mode = 0, $alreadypaid = -1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given VAT status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto + * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, 1 otherwise) + * @return string Label + */ + public function LibStatut($status, $mode = 0, $alreadypaid = -1) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /* Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/contact/canvas/actions_contactcard_common.class.php + * \ingroup thirdparty + * \brief File for the class Thirdparty contact card controller (common) + */ + /** + * \class ActionsContactCardCommon + * \brief Common Abstract Class for contact managmeent + */ + abstract class ActionsContactCardCommon + { + /** + * @var DoliDB Database handler. + */ + public $db; + public $dirmodule; + public $targetmodule; + public $canvas; + public $card; + //! Template container + public $tpl = array(); + //! Object container + public $object; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + /** + * Get object + * + * @param int $id Object id + * @return object Object loaded + */ + public function getObject($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set content of ->tpl array, to use into template + * + * @param string $action Type of action + * @param int $id Id + * @return void + */ + public function assign_values(&$action, $id) + { + } + } + /** + * \class ActionsContactCardDefault + * \brief Default Class to manage contacts + */ + class ActionsContactCardDefault extends \ActionsContactCardCommon + { + /** + * Constructor + * + * @param DoliDB $db Handler access base de donnees + * @param string $dirmodule Name of directory of module + * @param string $targetmodule Name of directory of module where canvas is stored + * @param string $canvas Name of canvas + * @param string $card Name of tab (sub-canvas) + */ + public function __construct($db, $dirmodule, $targetmodule, $canvas, $card) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Assign custom values for canvas + * + * @param string $action Type of action + * @param int $id Id + * @return void + */ + public function assign_values(&$action, $id) + { + } + } + /* Copyright (C) 2012 Regis Houssin + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/core/class/commonsocialnetworks.class.php + * \ingroup core + * \brief File of the superclass of object classes that support socialnetworks + */ + /** + * Superclass for social networks + */ + trait CommonSocialNetworks + { + /** + * @var array + */ + public $socialnetworks; + /** + * Show social network part if the module is enabled with hiding functionality + * + * @param array,icon:string,label:string}> $socialnetworks Array of social networks + * @param int $colspan Colspan + * @return void + */ + public function showSocialNetwork($socialnetworks, $colspan = 4) + { + } + } + /** + * Class to manage contact/addresses + */ + class Contact extends \CommonObject + { + use \CommonSocialNetworks; + use \CommonPeople; + /** + * @var string ID to identify managed object + */ + public $element = 'contact'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'socpeople'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'contact'; + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array( + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => 3, 'notnull' => 1, 'position' => 30, 'index' => 1), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 3, 'position' => 35), + 'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => 3, 'position' => 40), + 'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => 1, 'position' => 45, 'showoncombobox' => 1, 'searchall' => 1), + 'name_alias' => array('type' => 'varchar(255)', 'label' => 'Name alias', 'enabled' => 1, 'visible' => -1, 'position' => 46, 'searchall' => 1), + 'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => 1, 'position' => 50, 'showoncombobox' => 1, 'searchall' => 1), + 'poste' => array('type' => 'varchar(80)', 'label' => 'PostOrFunction', 'enabled' => 1, 'visible' => -1, 'position' => 52), + 'address' => array('type' => 'varchar(255)', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 55), + 'zip' => array('type' => 'varchar(25)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 60), + 'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 65), + 'fk_departement' => array('type' => 'integer', 'label' => 'Fk departement', 'enabled' => 1, 'visible' => 3, 'position' => 70), + 'fk_pays' => array('type' => 'integer', 'label' => 'Fk pays', 'enabled' => 1, 'visible' => 3, 'position' => 75), + 'fk_soc' => array('type' => 'integer', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => 1, 'position' => 77, 'searchall' => 1), + 'birthday' => array('type' => 'date', 'label' => 'Birthday', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'phone' => array('type' => 'varchar(30)', 'label' => 'Phone', 'enabled' => 1, 'visible' => 1, 'position' => 90, 'searchall' => 1), + 'phone_perso' => array('type' => 'varchar(30)', 'label' => 'PhonePerso', 'enabled' => 1, 'visible' => -1, 'position' => 95, 'searchall' => 1), + 'phone_mobile' => array('type' => 'varchar(30)', 'label' => 'PhoneMobile', 'enabled' => 1, 'visible' => 1, 'position' => 100, 'searchall' => 1), + 'fax' => array('type' => 'varchar(30)', 'label' => 'Fax', 'enabled' => 1, 'visible' => -1, 'position' => 105, 'searchall' => 1), + 'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'visible' => 1, 'position' => 110, 'searchall' => 1), + 'socialnetworks' => array('type' => 'text', 'label' => 'SocialNetworks', 'enabled' => 1, 'visible' => 3, 'position' => 115), + 'photo' => array('type' => 'varchar(255)', 'label' => 'Photo', 'enabled' => 1, 'visible' => 3, 'position' => 170), + 'priv' => array('type' => 'smallint(6)', 'label' => 'ContactVisibility', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 175), + 'fk_stcommcontact' => array('type' => 'integer', 'label' => 'ProspectStatus', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 220), + 'fk_prospectcontactlevel' => array('type' => 'varchar(12)', 'label' => 'ProspectLevel', 'enabled' => 1, 'visible' => -1, 'position' => 255), + //no more used. Replace by a scan of email into mailing_unsubscribe. 'no_email' =>array('type'=>'smallint(6)', 'label'=>'No_Email', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>180), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 3, 'position' => 195, 'searchall' => 1), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 3, 'position' => 200, 'searchall' => 1), + 'default_lang' => array('type' => 'varchar(6)', 'label' => 'Default lang', 'enabled' => 1, 'visible' => 3, 'position' => 205), + 'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => 3, 'position' => 210), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 300), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 305), + 'fk_user_creat' => array('type' => 'integer', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => 3, 'position' => 310), + 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModif', 'enabled' => 1, 'visible' => 3, 'position' => 315), + 'statut' => array('type' => 'tinyint(4)', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 500), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -1, 'position' => 1000), + ); + public $civility_id; + // In fact we store civility_code + public $civility_code; + public $civility; + /** + * @var string gender + */ + public $gender; + /** + * @var int egroupware_id + */ + //private $egroupware_id; + /** + * @var int birthday_alert + */ + public $birthday_alert; + /** + * @var string The civilite code, not an integer + * @deprecated + * @see $civility_code + */ + public $civilite; + /** + * @var string fullname + */ + public $fullname; + /** + * @var string Name alias + */ + public $name_alias; + /** + * @var string Address + */ + public $address; + /** + * @var string zip code + */ + public $zip; + /** + * @var string Town + */ + public $town; + /** + * @var int Id of department + */ + public $state_id; + /** + * @var string Code of department + */ + public $state_code; + /** + * @var string Label of department + */ + public $state; + /** + * @var string Job Position + */ + public $poste; + /** + * @var int Thirdparty ID + */ + public $socid; + // both socid and fk_soc are used + public $fk_soc; + // both socid and fk_soc are used + /** + * @var string Thirdparty name + */ + public $socname; + /** + * @var int Status 0=inactive, 1=active + */ + public $statut; + public $code; + /** + * Email + * @var string + */ + public $email; + /** + * Email + * @var string + * @deprecated + * @see $email + */ + public $mail; + /** + * URL + * @var string + */ + public $url; + /** + * Unsubscribe all : 1 = contact has globally unsubscribed of all mass emailing + * @var int + * @deprecated Has been replaced by a search into llx_mailing_unsubscribe + */ + public $no_email; + /** + * Array of social-networks + * @var array + */ + public $socialnetworks; + /** + * @var string filename for photo + */ + public $photo; + /** + * @var string phone pro (professional/business) + */ + public $phone_pro; + /** + * @var string phone perso (personal/private) + */ + public $phone_perso; + /** + * @var string phone mobile + */ + public $phone_mobile; + /** + * @var string fax + */ + public $fax; + /** + * Private or public + * @var int + */ + public $priv; + /** + * @var int|string Date + */ + public $birthday; + /** + * @var string language for contact communication -- only with multilanguage enabled + */ + public $default_lang; + /** + * @var int Number of invoices for which he is contact + */ + public $ref_facturation; + /** + * @var int Number of contracts for which he is contact + */ + public $ref_contrat; + /** + * @var int Number of orders for which he is contact + */ + public $ref_commande; + /** + * @var int Number of proposals for which he is contact + */ + public $ref_propal; + /** + * @var int user ID + */ + public $user_id; + /** + * @var string user login + */ + public $user_login; + // END MODULEBUILDER PROPERTIES + /** + * Old copy + * @var static + */ + public $oldcopy; + // To contains a clone of this when we need to save old properties of object + /** + * @var array roles + */ + public $roles; + public $cacheprospectstatus = array(); + /** + * @var string Prospect level. ie: 'PL_LOW', 'PL...' + */ + public $fk_prospectlevel; + public $stcomm_id; + public $statut_commercial; + /** + * @var string picto + */ + public $stcomm_picto; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Load indicators into this->nb for board + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function loadStateBoard() + { + } + /** + * Add a contact into database + * + * @param User $user Object user that create + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Update information into database + * + * @param int $id Id of contact/address to update + * @param User $user Object user making change + * @param int $notrigger 0=no, 1=yes + * @param string $action Current action for hookmanager + * @param int $nosyncuser No sync linked user (external users and contacts are linked) + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($id, $user = \null, $notrigger = 0, $action = 'update', $nosyncuser = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Return DN string complete in the LDAP directory for the object + * + * @param array $info Info string loaded by _load_ldap_info + * @param int $mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb) + * 1=Return DN without key inside (ou=xxx,dc=aaa,dc=bbb) + * 2=Return key only (uid=qqq) + * @return string DN + */ + public function _load_ldap_dn($info, $mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Initialize info table (LDAP attributes table) + * + * @return array Attributes info table + */ + public function _load_ldap_info() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update field alert birthday + * + * @param int $id Id of contact + * @param User $user User asking to change alert or birthday + * @param int $notrigger 0=no, 1=yes + * @return int Return integer <0 if KO, >=0 if OK + */ + public function update_perso($id, $user = \null, $notrigger = 0) + { + } + /** + * Load object contact. + * + * @param int $id Id of contact + * @param ?User $user Load also alerts of this user (subscribing to alerts) that want alerts about this contact + * @param string $ref_ext External reference, not given by Dolibarr + * @param string $email Email + * @param int $loadalsoroles Load also roles. Try to always use 0 here and load roles with a separate call of fetchRoles(). + * @param int $socid Filter on thirdparty id + * @return int >0 if OK, <0 if KO or if two records found for same ref or idprof, 0 if not found. + */ + public function fetch($id, $user = \null, $ref_ext = '', $email = '', $loadalsoroles = 0, $socid = 0) + { + } + /** + * Search the contact that match the most the provided parameters. + * Searching rules try to find the existing contact. + * + * @param int $id Id of contact + * @param string $lastname Lastname (TODO Not yet implemented) + * @param string $firstname Firstname (TODO Not yet implemented) + * @param string $ref_ext External reference, not given by Dolibarr + * @param string $email Email + * @param string $ref_alias Name alias (TODO Not yet implemented) + * @param int $socid Filter on thirdparty id + * @return int >0 if OK, <0 if KO or if two records found for same ref or idprof, 0 if not found. + */ + public function findNearest($id = 0, $lastname = '', $firstname = '', $ref_ext = '', $email = '', $ref_alias = '', $socid = 0) + { + } + /** + * Set the property "gender" of this class, based on the property "civility_id" + * or use property "civility_code" as fallback, when "civility_id" is not available. + * + * @return void + */ + public function setGenderFromCivility() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load number of elements the contact is used as a link for + * ref_facturation + * ref_contrat + * ref_commande (for order and/or shipments) + * ref_propale + * + * @return int Return integer <0 if KO, >=0 if OK + */ + public function load_ref_elements() + { + } + /** + * Delete a contact from database + * + * @param User $user User making the delete + * @param int $notrigger Disable all trigger + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Load contact information from the database + * + * @param int $id Id of the contact to load + * @return void + */ + public function info($id) + { + } + /** + * Return number of mass Emailing received by these contacts with its email + * + * @return int Number of EMailings + */ + public function getNbOfEMailings() + { + } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + } + /** + * Return name of contact with link (and eventually picto) + * Use $this->id, $this->lastname, $this->firstname, this->civility_id + * + * @param int $withpicto Include picto with link (0=no picto, 1=picto + name, 2=picto only, -1=photo+name, -2=photo only) + * @param string $option Where the link point to + * @param int $maxlen Max length of + * @param string $moreparam Add more param into URL + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $moreparam = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = '') + { + } + /** + * Return civility label of contact + * + * @return string Translated name of civility + */ + public function getCivilityLabel() + { + } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return translated label of Public or Private + * + * @param int $status Type (0 = public, 1 = private) + * @return string Label translated + */ + public function LibPubPriv($status) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int >0 if ok + */ + public function initAsSpecimen() + { + } + /** + * Change status of a user + * + * @param int $status Status to set + * @return int Return integer <0 if KO, 0 if nothing is done, >0 if OK + */ + public function setstatus($status) + { + } + /** + * Sets object to supplied categories. + * + * Deletes object from existing categories not supplied. + * Adds it to non existing supplied categories. + * Existing categories are left untouch. + * + * @param int[]|int $categories Category or categories IDs + * @return int Return integer <0 if KO, >0 if OK + */ + public function setCategories($categories) + { + } + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty(\DoliDB $dbs, $origin_id, $dest_id) + { + } + /** + * Fetch roles (default contact of some companies) for the current contact. + * This load the array ->roles. + * + * @return int Return integer <0 if KO, Nb of roles found if OK + * @see updateRoles() + */ + public function fetchRoles() + { + } + /** + * Get thirdparty contact roles of a given contact + * + * @param string $element Element type + * @return array|int Array of contact roles or -1 + * @throws Exception + */ + public function getContactRoles($element = '') + { + } + /** + * Updates all roles (default contact for companies) according to values inside the ->roles array. + * This is called by update of contact. + * + * @return int + * @see fetchRoles() + */ + public function updateRoles() + { + } + /** + * Load array of prospect status + * + * @param int $active 1=Active only, 0=Not active only, -1=All + * @return int Return integer <0 if KO, >0 if OK + */ + public function loadCacheOfProspStatus($active = 1) + { + } + /** + * Return prospect level + * + * @return string Label + */ + public function getLibProspLevel() + { + } + /** + * Return label of prospect level + * + * @param string $fk_prospectlevel Prospect level + * @return string label of level + */ + public function libProspLevel($fk_prospectlevel) + { + } + /** + * Set prospect level + * + * @param User $user User who defines the discount + * @return int Return integer <0 if KO, >0 if OK + * @deprecated Use update function instead + */ + public function setProspectLevel(\User $user) + { + } + /** + * Return status of prospect + * + * @param int $mode 0=label long, 1=label short, 2=Picto + Label short, 3=Picto, 4=Picto + Label long + * @param string $label Label to use for status for added status + * @return string Label + */ + public function getLibProspCommStatut($mode = 0, $label = '') + { + } + /** + * Return label of a given status + * + * @param int|string $statut Id or code for prospection status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @param string $label Label to use for status for added status + * @param string $picto Name of image file to show ('filenew', ...) + * If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory. + * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img + * Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img + * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) + * @return string Label of status + */ + public function libProspCommStatut($statut, $mode = 0, $label = '', $picto = '') + { + } + /** + * Set "blacklist" mailing status + * + * @param int $no_email 1=Do not send mailing, 0=Ok to receive mailing + * @return int Return integer <0 if KO, >0 if OK + */ + public function setNoEmail($no_email) + { + } + /** + * get "blacklist" mailing status + * set no_email attribute to 1 or 0 + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function getNoEmail() + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /** + * API class for contracts + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ + class Contracts extends \DolibarrApi + { + /** + * @var array $FIELDS Mandatory fields, checked when create and update object + */ + public static $FIELDS = array('socid', 'date_contrat', 'commercial_signature_id', 'commercial_suivi_id'); + /** + * @var Contrat $contract {@type Contrat} + */ + public $contract; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get properties of a contract object + * + * Return an array with contract information + * + * @param int $id ID of contract + * @return Object Object with cleaned properties + * @throws RestException + */ + public function get($id) + { + } + /** + * List contracts + * + * Get a list of contracts + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $thirdparty_ids Thirdparty ids to filter contracts of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* + * @return array Array of order objects + * + * @throws RestException 404 Not found + * @throws RestException 503 Error + */ + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '', $pagination_data = \false) + { + } + /** + * Create contract object + * + * @param array $request_data Request data + * @return int ID of contrat + */ + public function post($request_data = \null) + { + } + /** + * Get lines of a contract + * + * @param int $id Id of contract + * + * @url GET {id}/lines + * + * @return array + */ + public function getLines($id) + { + } + /** + * Add a line to given contract + * + * @param int $id Id of contrat to update + * @param array $request_data Contractline data + * + * @url POST {id}/lines + * + * @return int|bool + */ + public function postLine($id, $request_data = \null) + { + } + /** + * Update a line to given contract + * + * @param int $id Id of contrat to update + * @param int $lineid Id of line to update + * @param array $request_data Contractline data + * + * @url PUT {id}/lines/{lineid} + * + * @return Object|bool + */ + public function putLine($id, $lineid, $request_data = \null) + { + } + /** + * Activate a service line of a given contract + * + * @param int $id Id of contract to activate + * @param int $lineid Id of line to activate + * @param string $datestart {@from body} Date start {@type timestamp} + * @param string $dateend {@from body} Date end {@type timestamp} + * @param string $comment {@from body} Comment + * + * @url PUT {id}/lines/{lineid}/activate + * + * @return Object|bool + */ + public function activateLine($id, $lineid, $datestart, $dateend = \null, $comment = \null) + { + } + /** + * Unactivate a service line of a given contract + * + * @param int $id Id of contract to activate + * @param int $lineid Id of line to activate + * @param string $datestart {@from body} Date start {@type timestamp} + * @param string $comment {@from body} Comment + * + * @url PUT {id}/lines/{lineid}/unactivate + * + * @return Object|bool + */ + public function unactivateLine($id, $lineid, $datestart, $comment = \null) + { + } + /** + * Delete a line to given contract + * + * + * @param int $id Id of contract to update + * @param int $lineid Id of line to delete + * + * @url DELETE {id}/lines/{lineid} + * + * @return array|mixed + * + * @throws RestException 401 + * @throws RestException 404 + */ + public function deleteLine($id, $lineid) + { + } + /** + * Update contract general fields (won't touch lines of contract) + * + * @param int $id Id of contract to update + * @param array $request_data Datas + * @return Object Updated object + */ + public function put($id, $request_data = \null) + { + } + /** + * Delete contract + * + * @param int $id Contract ID + * + * @return array + */ + public function delete($id) + { + } + /** + * Validate a contract + * + * @param int $id Contract ID + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * + * @url POST {id}/validate + * + * @return array + * FIXME An error 403 is returned if the request has an empty body. + * Error message: "Forbidden: Content type `text/plain` is not supported." + * Workaround: send this in the body + * { + * "notrigger": 0 + * } + */ + public function validate($id, $notrigger = 0) + { + } + /** + * Close all services of a contract + * + * @param int $id Contract ID + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * + * @url POST {id}/close + * + * @return array + * FIXME An error 403 is returned if the request has an empty body. + * Error message: "Forbidden: Content type `text/plain` is not supported." + * Workaround: send this in the body + * { + * "notrigger": 0 + * } + */ + public function close($id, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensible object datas + * + * @param Object $object Object to clean + * @return Object Object with cleaned properties + */ + protected function _cleanObjectDatas($object) + { + } + } + /* Copyright (C) 2024 William Mead + * + * 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 . + */ + /** + * \file htdocs/core/class/commonsignedobject.class.php + * \ingroup core + * \brief File of trait for common signed business objects (contracts, interventions, ...) + */ + /** + * Trait for common signed business objects + * @property DoliDB $db + * @property static $oldcopy + * @property int $id + * @property string $error + * @property string $table_element + * @property array $context + * @method int call_trigger(string $triggerName, User $user) + */ + trait CommonSignedObject + { + /** + * Status of the contract (0=NoSignature, 1=SignedBySender, 2=SignedByReceiver, 9=SignedByAll) + * @var int + */ + public $signed_status = 0; + /** + * Signed statuses dictionary. Label used as key for string localizations. + * When min. required PHP is 8.2 this can be updated to a constant + * @var array + */ + public static $SIGNED_STATUSES = ['STATUS_NO_SIGNATURE' => 0, 'STATUS_SIGNED_SENDER' => 1, 'STATUS_SIGNED_RECEIVER' => 2, 'STATUS_SIGNED_RECEIVER_ONLINE' => 3, 'STATUS_SIGNED_ALL' => 9]; + /** + * Returns an array of signed statuses with associated localized labels + * + * @return array + */ + public function getSignedStatusLocalisedArray() : array + { + } + /** + * Set signed status & object context. Call sign action trigger. + * + * @param User $user Object user that modify + * @param int $status New signed status to set (often a constant like self::STATUS_XXX) + * @param int $notrigger 1 = Does not execute triggers, 0 = Execute triggers + * @param string $triggercode Trigger code to use + * @return int 0 < if KO, > 0 if OK + */ + public function setSignedStatus(\User $user, int $status = 0, int $notrigger = 0, string $triggercode = '') : int + { + } + /** + * Set signed status & call trigger with context message + * + * @param User $user Object user that modify + * @param int $status New signed status to set (often a constant like self::STATUS_XXX) + * @param int $notrigger 1 = Does not execute triggers, 0 = Execute triggers + * @param string $triggercode Trigger code to use + * @return int 0 < if KO, > 0 if OK + */ + public function setSignedStatusCommon(\User $user, int $status, int $notrigger = 0, string $triggercode = '') : int + { + } + /** + * Returns the label for signed status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label + */ + public function getLibSignedStatus(int $mode = 0) : string + { + } + } + /** + * Class to manage contracts + * @property int $signed_status + * @static array $SIGNED_STATUSES + */ + class Contrat extends \CommonObject + { + use \CommonSignedObject; + /** + * @var string ID to identify managed object + */ + public $element = 'contrat'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'contrat'; + /** + * @var string Name of subtable line + */ + public $table_element_line = 'contratdet'; + /** + * @var string Fieldname with ID of parent key if this field has a parent + */ + public $fk_element = 'fk_contrat'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'contract'; + /** + * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user + * @var integer + */ + public $restrictiononfksoc = 1; + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + /** + * Customer reference of the contract + * @var string + */ + public $ref_customer; + /** + * @var string Partial SQL query: 'FROM ' expression + */ + public $from; + /** + * Supplier reference of the contract + * @var string + */ + public $ref_supplier; + /** + * Entity of the contract + * @var int + */ + public $entity; + /** + * Client id linked to the contract + * @var int + */ + public $socid; + /** + * Client id linked to the contract + * @var int + * @deprecated Use $socid + */ + public $fk_soc; + /** + * @var Societe thirdparty Object + */ + public $societe; + /** + * Status of the contract + * @var int + * @deprecated + */ + public $statut = 0; + /** + * Status of the contract (0=Draft, 1=Validated) + * @var int + */ + public $status = 0; + /** + * @var Product + */ + public $product; + /** + * @var int Id of user author of the contract + */ + public $fk_user_author; + /** + * TODO: Which is the correct one? + * Author of the contract + * @var int + */ + public $user_author_id; + /** + * @var User Object user that create the contract. Set by the info method. + * @deprecated + */ + public $user_creation; + /** + * @var User Object user that close the contract. Set by the info method. + */ + public $user_cloture; + /** + * @var int|string Date when contract was signed + */ + public $date_contrat; + /** + * @var int + */ + public $commercial_signature_id; + /** + * @var int|string + */ + public $fk_commercial_signature; + /** + * @var int + */ + public $commercial_suivi_id; + /** + * @var int|string + */ + public $fk_commercial_suivi; + /** + * @var int + * @deprecated Use fk_project instead + * @see $fk_project + */ + public $fk_projet; + /** + * @var array (Encoded as JSON in database) + */ + public $extraparams = array(); + /** + * @var ContratLigne[] Contract lines + */ + public $lines = array(); + /** + * @var int + */ + public $nbofservices; + /** + * @var int + */ + public $nbofserviceswait; + /** + * @var int + */ + public $nbofservicesopened; + /** + * @var int + */ + public $nbofservicesexpired; + /** + * @var int + */ + public $nbofservicesclosed; + //public $lower_planned_end_date; + //public $higher_planner_end_date; + /** + * Maps ContratLigne IDs to $this->lines indexes + * @var int[] + */ + protected $lines_id_index_mapper = array(); + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), 'ref' => array('type' => 'varchar(50)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'showoncombobox' => 1, 'position' => 15, 'searchall' => 1), 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 20), 'ref_customer' => array('type' => 'varchar(50)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => -1, 'position' => 25, 'searchall' => 1), 'ref_supplier' => array('type' => 'varchar(50)', 'label' => 'RefSupplier', 'enabled' => 1, 'visible' => -1, 'position' => 26, 'searchall' => 1), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 30, 'index' => 1), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 35), 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 40), 'date_contrat' => array('type' => 'datetime', 'label' => 'Date contrat', 'enabled' => 1, 'visible' => -1, 'position' => 45), 'signed_status' => array('type' => 'smallint(6)', 'label' => 'SignedStatus', 'enabled' => 1, 'visible' => -1, 'position' => 50, 'arrayofkeyval' => array(0 => 'NoSignature', 1 => 'SignedSender', 2 => 'SignedReceiver', 3 => 'SignedReceiverOnline', 9 => 'SignedAll')), 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'notnull' => 1, 'position' => 70), 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Project', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 75), 'fk_commercial_signature' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'SaleRepresentative Signature', 'enabled' => 1, 'visible' => -1, 'position' => 80), 'fk_commercial_suivi' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'SaleRepresentative follower', 'enabled' => 1, 'visible' => -1, 'position' => 85), 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 90), 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 105, 'searchall' => 1), 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 110, 'searchall' => 1), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 115), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 120), 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 125), 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 135), 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'Last main doc', 'enabled' => 1, 'visible' => -1, 'position' => 140), 'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => -1, 'position' => 500, 'notnull' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 2 => 'Closed'))); + // END MODULEBUILDER PROPERTIES + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_CLOSED = 2; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Return next contract ref + * + * @param Societe $soc Thirdparty object + * @return string free reference for contract + */ + public function getNextNumRef($soc) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Activate a contract line + * + * @param User $user Object User who activate contract + * @param int $line_id Id of line to activate + * @param int $date_start Opening date + * @param int|string $date_end Expected end date + * @param string $comment A comment typed by user + * @return int Return integer <0 if KO, >0 if OK + */ + public function active_line($user, $line_id, $date_start, $date_end = '', $comment = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Close a contract line + * + * @param User $user Object User who close contract + * @param int $line_id Id of line to close + * @param int $date_end End date + * @param string $comment A comment typed by user + * @return int Return integer <0 if KO, >0 if OK + */ + public function close_line($user, $line_id, $date_end, $comment = '') + { + } + /** + * Open all lines of a contract + * + * @param User $user Object User making action + * @param int|string $date_start Date start (now if empty) + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @param string $comment Comment + * @param int|string $date_end Date end + * @return int Return integer <0 if KO, >0 if OK + * @see () + */ + public function activateAll($user, $date_start = '', $notrigger = 0, $comment = '', $date_end = '') + { + } + /** + * Close all lines of a contract + * + * @param User $user Object User making action + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @param string $comment Comment + * @return int Return integer <0 if KO, >0 if OK + * @see activateAll() + */ + public function closeAll(\User $user, $notrigger = 0, $comment = '') + { + } + /** + * Validate a contract + * + * @param User $user Object User + * @param string $force_number Reference to force on contract (not implemented yet) + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function validate(\User $user, $force_number = '', $notrigger = 0) + { + } + /** + * Unvalidate a contract + * + * @param User $user Object User + * @param int $notrigger 1=Does not execute triggers, 0=execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function reopen($user, $notrigger = 0) + { + } + /** + * Load a contract from database + * + * @param int $id Id of contract to load + * @param string $ref Ref + * @param string $ref_customer Customer ref + * @param string $ref_supplier Supplier ref + * @param int<0,1> $noextrafields 0=Default to load extrafields, 1=No extrafields + * @param int<0,1> $nolines 0=Default to load lines, 1=No lines + * @return int Return integer <0 if KO, 0 if not found or if two records found for same ref, Id of contract if OK + */ + public function fetch($id, $ref = '', $ref_customer = '', $ref_supplier = '', $noextrafields = 0, $nolines = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load lines array into this->lines. + * This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed + * + * @param int<0,1> $only_services 0=Default for all, 1=Force only services (depending on setup, we may also have physical products in a contract) + * @param int<0,1> $loadalsotranslation 0=Default to not load translations, 1=Load also translations of product descriptions + * @param int<0,1> $noextrafields 0=Default to load extrafields, 1=Do not load the extrafields of lines + * @return array|int Return array of contract lines + */ + public function fetch_lines($only_services = 0, $loadalsotranslation = 0, $noextrafields = 0) + { + } + /** + * Create a contract into database + * + * @param User $user User that create + * @return int Return integer <0 if KO, id of contract if OK + */ + public function create($user) + { + } + /** + * Delete object + * + * @param User $user User that deletes + * @return int Return integer < 0 if KO, > 0 if OK + */ + public function delete($user) + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user, $notrigger = 0) + { + } + /** + * Ajoute une ligne de contrat en base + * + * @param string $desc Description of line + * @param float $pu_ht Unit price net + * @param float $qty Quantity + * @param float $txtva Vat rate + * @param float $txlocaltax1 Local tax 1 rate + * @param float $txlocaltax2 Local tax 2 rate + * @param int $fk_product Id produit + * @param float $remise_percent Percentage discount of the line + * @param int $date_start Date de debut prevue + * @param int $date_end Date de fin prevue + * @param string $price_base_type HT or TTC + * @param float $pu_ttc Prix unitaire TTC + * @param int $info_bits Bits of type of lines + * @param int $fk_fournprice Fourn price id + * @param int $pa_ht Buying price HT + * @param array $array_options extrafields array + * @param string $fk_unit Code of the unit to use. Null to use the default one + * @param int $rang Position + * @return int Return integer <0 if KO, >0 if OK + */ + public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type = 'HT', $pu_ttc = 0.0, $info_bits = 0, $fk_fournprice = \null, $pa_ht = 0, $array_options = array(), $fk_unit = \null, $rang = 0) + { + } + /** + * Mets a jour une ligne de contrat + * + * @param int $rowid Id de la ligne de facture + * @param string $desc Description de la ligne + * @param float $pu Prix unitaire + * @param float $qty Quantite + * @param float $remise_percent Percentage discount of the line + * @param int $date_start Date de debut prevue + * @param int $date_end Date de fin prevue + * @param float $tvatx Taux TVA + * @param float $localtax1tx Local tax 1 rate + * @param float $localtax2tx Local tax 2 rate + * @param int|string $date_start_real Date de debut reelle + * @param int|string $date_end_real Date de fin reelle + * @param string $price_base_type HT or TTC + * @param int $info_bits Bits of type of lines + * @param int $fk_fournprice Fourn price id + * @param int $pa_ht Buying price HT + * @param array $array_options extrafields array + * @param string $fk_unit Code of the unit to use. Null to use the default one + * @param int $rang Position + * @return int Return integer <0 if KO, >0 if OK + */ + public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx = 0.0, $localtax2tx = 0.0, $date_start_real = '', $date_end_real = '', $price_base_type = 'HT', $info_bits = 0, $fk_fournprice = \null, $pa_ht = 0, $array_options = array(), $fk_unit = \null, $rang = 0) + { + } + /** + * Delete a contract line + * + * @param int $idline Id of line to delete + * @param User $user User that delete + * @return int >0 if OK, <0 if KO + */ + public function deleteLine($idline, \User $user) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update statut of contract according to services + * + * @param User $user Object user + * @return int Return integer <0 if KO, >0 if OK + * @deprecated This function will never be used. Status of a contract is status of its lines. + */ + public function update_statut($user) + { + } + /** + * Return label of a contract status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto, 7=Same than 6 with fixed length + * @return string Label + */ + public function getLibStatut($mode) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given contrat status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label (status of services), 5=Short label + Picto, 6=Long label + Picto (status of services), 7=Same than 6 with fixed length (status of services) + * @return string Label + */ + public function LibStatut($status, $mode) + { + } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array{picto:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} + */ + public function getTooltipContentArray($params) + { + } + /** + * Return clickable name (with picto eventually) + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $maxlength Max length of ref + * @param int $notooltip 1=Disable tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0, $maxlength = 0, $notooltip = 0, $save_lastsearch_value = -1) + { + } + /** + * Charge les information d'ordre info dans l'objet contrat + * + * @param int $id id du contrat a charger + * @return void + */ + public function info($id) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of line rowid + * + * @param int $status Status of lines to get + * @return int[]|int Array of line's rowid or <0 if error + */ + public function array_detail($status = -1) + { + } + /** + * Return list of other contracts for the same company than current contract + * + * @param 'all'|'others' $option 'all' or 'others' + * @param int[] $status sort contracts having these status + * @param string[] $product_categories sort contracts containing these product categories + * @param int[] $line_status sort contracts where lines have these status + * @return array|int Array of contracts id or <0 if error + */ + public function getListOfContracts($option = 'all', $status = [], $product_categories = [], $line_status = []) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @param string $mode "inactive" pour services a activer, "expired" pour services expires + * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK + */ + public function load_board($user, $mode) + { + } + /** + * Load the indicators this->nb for state board + * + * @return int Return integer <0 si ko, >0 si ok + */ + public function loadStateBoard() + { + } + /* gestion des contacts d'un contrat */ + /** + * Return id des contacts clients de facturation + * + * @return int[] Liste des id contacts facturation + */ + public function getIdBillingContact() + { + } + /** + * Return id des contacts clients de prestation + * + * @return int[] Liste des id contacts prestation + */ + public function getIdServiceContact() + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + /** + * Create an array of order lines + * + * @return int >0 if OK, <0 if KO + */ + public function getLinesArray() + { + } + /** + * Create an array of associated tickets + * + * @return Ticket[]|int Array o tickets or <0 if KO + */ + public function getTicketsArray() + { + } + /** + * Create a document onto disk according to template module. + * + * @param string $modele Force model to use ('' to not force) + * @param Translate $outputlangs Object langs to use for output + * @param int $hidedetails Hide details of lines + * @param int $hidedesc Hide description + * @param int $hideref Hide ref + * @param ?array $moreparams Array to provide more information + * @return int Return integer < 0 if KO, 0 = no doc generated, > 0 if OK + */ + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = \null) + { + } + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty(\DoliDB $dbs, $origin_id, $dest_id) + { + } + /** + * Function used to replace a product id with another one. + * + * @param DoliDB $db Database handler + * @param int $origin_id Old product id + * @param int $dest_id New product id + * @return bool + */ + public static function replaceProduct(\DoliDB $db, $origin_id, $dest_id) + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $user User making the clone + * @param int $socid Id of thirdparty + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int New id of clone + */ + public function createFromClone(\User $user, $socid = 0, $notrigger = 0) + { + } + /** + * Action executed by scheduler + * CAN BE A CRON TASK + * Loop on each contract lines and update the end of date. Do not execute the update if there is one pending invoice linked to contract. + * + * @param int $thirdparty_id Thirdparty id + * @param int $delayindaysshort To renew the resources x day before (positive value) or after (negative value) the end of date (default is 0) + * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) + */ + public function doAutoRenewContracts($thirdparty_id = 0, $delayindaysshort = 0) + { + } + /** + * Used to sort lines by date + * + * @param Object $a 1st element to test + * @param Object $b 2nd element to test + * @return int + */ + public static function contractCmpDate($a, $b) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array{string,mixed} $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = \null) + { + } + } + /** + * Class to manage lines of contracts + */ + class ContratLigne extends \CommonObjectLine + { + /** + * @var string ID to identify managed object + */ + public $element = 'contratdet'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'contratdet'; + /** + * @see CommonObjectLine + */ + public $parent_element = 'contrat'; + /** + * @see CommonObjectLine + */ + public $fk_parent_attribute = 'fk_contrat'; + /** + * @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea(). + * Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element. + */ + public $element_for_permission = 'contrat'; + /** + * @var int ID + */ + public $id; + /** + * @var string Ref + */ + public $ref; + /** + * @var int ID + */ + public $fk_contrat; + /** + * @var int ID + */ + public $fk_product; + /** + * @var int 0 inactive, 4 active, 5 closed + */ + public $statut; + /** + * @var int 0 for product, 1 for service + */ + public $type; + /** + * @var string + * @deprecated + */ + public $label; + /** + * @var string + * @deprecated + */ + public $libelle; + /** + * @var string description + */ + public $description; + /** + * @var int 0 for product, 1 for service + */ + public $product_type; + /** + * @var string + */ + public $product_ref; + /** + * @var string + */ + public $product_label; + /** + * @var int|string + */ + public $date_commande; + /** + * @var int|string date start planned + */ + public $date_start; + /** + * @var int|string date start real + */ + public $date_start_real; + /** + * @var int|string date end planned + */ + public $date_end; + /** + * @var null|int|string date end real + */ + public $date_end_real; + /** + * @var float|string + */ + public $tva_tx; + /** + * @var string + */ + public $vat_src_code; + /** + * @var string|float + */ + public $localtax1_tx; + /** + * @var string|float + */ + public $localtax2_tx; + /** + * @var string Local tax 1 type + */ + public $localtax1_type; + /** + * @var string Local tax 2 type + */ + public $localtax2_type; + /** + * @var float + */ + public $qty; + /** + * @var int|string + */ + public $remise_percent; + /** + * @var float|string + * @deprecated + */ + public $remise; + /** + * @var int ID + */ + public $fk_remise_except; + /** + * Unit price before taxes + * @var float + */ + public $subprice; + /** + * @var float + * @deprecated Use $price_ht instead + * @see $price_ht + */ + public $price; + /** + * @var float price without tax + */ + public $price_ht; + /** + * @var float + */ + public $total_ht; + /** + * @var float + */ + public $total_tva; + /** + * @var float + */ + public $total_localtax1; + /** + * @var float + */ + public $total_localtax2; + /** + * @var float + */ + public $total_ttc; + /** + * @var int ID + */ + public $fk_fournprice; + /** + * @var float + */ + public $pa_ht; + /** + * @var int Info bits + */ + public $info_bits; + /** + * @var int ID of user that insert the service + */ + public $fk_user_author; + /** + * @var int ID of user opening the service + */ + public $fk_user_ouverture; + /** + * @var int ID of user closing the service + */ + public $fk_user_cloture; + /** + * @var string Comment + */ + public $commentaire; + /** + * @var int line rank + */ + public $rang = 0; + const STATUS_INITIAL = 0; + const STATUS_OPEN = 4; + const STATUS_CLOSED = 5; + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array( + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 30, 'index' => 1), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 35), + 'qty' => array('type' => 'integer', 'label' => 'Quantity', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 35, 'isameasure' => 1), + 'total_ht' => array('type' => 'integer', 'label' => 'AmountHT', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 36, 'isameasure' => 1), + 'total_tva' => array('type' => 'integer', 'label' => 'AmountVAT', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 37, 'isameasure' => 1), + 'total_ttc' => array('type' => 'integer', 'label' => 'AmountTTC', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 38, 'isameasure' => 1), + //'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>40), + //'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>70), + 'fk_contrat' => array('type' => 'integer:Contrat:contrat/class/contrat.class.php', 'label' => 'Contract', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 70), + 'fk_product' => array('type' => 'integer:Product:product/class/product.class.php:1', 'label' => 'Product', 'enabled' => 1, 'visible' => -1, 'position' => 75), + //'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>90), + 'note_private' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 105), + 'note_public' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 110), + //'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>115), + //'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>120), + //'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>125), + 'fk_user_ouverture' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserStartingService', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 135), + 'fk_user_cloture' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserClosingService', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 135), + 'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => -1, 'position' => 500, 'arrayofkeyval' => array(0 => 'Draft', 4 => 'Open', 5 => 'Closed')), + 'rang' => array('type' => 'integer', 'label' => 'Rank', 'enabled' => 1, 'visible' => 0, 'position' => 500, 'default' => '0'), + ); + // END MODULEBUILDER PROPERTIES + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Return label of this contract line status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return label of a contract line status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @param int $expired 0=Not expired, 1=Expired, -1=Both or unknown + * @param string $moreatt More attribute + * @param string $morelabel More label + * @return string Label of status + */ + public static function LibStatut($status, $mode, $expired = -1, $moreatt = '', $morelabel = '') + { + } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + } + /** + * Return clickable name (with picto eventually) for ContratLigne + * + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $maxlength Max length + * @return string Chaine avec URL + */ + public function getNomUrl($withpicto = 0, $maxlength = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id object + * @param string $ref Ref of contract line + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $ref = '') + { + } + /** + * Update database for contract line + * + * @param User $user User that modify + * @param int $notrigger 0=no, 1=yes (no update trigger) + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Update in database the fields total_xxx of lines + * Used by migration process + * + * @return int Return integer <0 if KO, >0 if OK + */ + public function update_total() + { + } + /** + * Inserts a contrat line into database + * + * @param int $notrigger Set to 1 if you don't want triggers to be fired + * @return int Return integer <0 if KO, >0 if OK + */ + public function insert($notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Activate a contract line + * + * @param User $user Object User who activate contract + * @param int $date Date real activation + * @param int|string $date_end Date planned end. Use '-1' to keep it unchanged. + * @param string $comment A comment typed by user + * @return int Return integer <0 if KO, >0 if OK + */ + public function active_line($user, $date, $date_end = '', $comment = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Close a contract line + * + * @param User $user Object User who close contract + * @param int $date_end_real Date end + * @param string $comment A comment typed by user + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function close_line($user, $date_end_real, $comment = '', $notrigger = 0) + { + } + } + /* Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2014 Raphaël Doursenaud + * Copyright (C) 2015 Frederic France + * Copyright (C) 2024 MDW + * + * 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 . + * or see https://www.gnu.org/ + */ + /** + * \file htdocs/core/boxes/modules_boxes.php + * \ingroup core + * \brief File containing the parent class of boxes + */ + /** + * Class ModeleBoxes + * + * Boxes parent class + */ + class ModeleBoxes + { + /** + * @var DoliDB Database handler + */ + public $db; + /** + * Must be defined in the box class + * + * @var ''|'development'|'experimental'|'dolibarr' + */ + public $version; + /** + * @var string param + */ + public $param; + /** + * @var array box info heads. Example: array('text' => $langs->trans("BoxScheduledJobs", $max), 'nbcol' => 4); + */ + public $info_box_head = array(); + /** + * @var array box info content + */ + public $info_box_contents = array(); + /** + * @var string Error message + */ + public $error = ''; + /** + * @var int<0,max> Maximum lines + */ + public $max = 5; + /** + * @var bool|int Condition to have widget enabled + */ + public $enabled = 1; + /** + * @var boolean Condition to have widget visible (in most cases, permissions) + */ + public $hidden = \false; + /** + * @var int Box definition database ID + */ + public $rowid; + /** + * @var int ID + * @deprecated Same as box_id? + */ + public $id; + /** + * @var int Position? + */ + public $position; + /** + * @var string Display order + */ + public $box_order; + /** + * @var int User ID + */ + public $fk_user; + /** + * @var string Source file + */ + public $sourcefile; + /** + * @var string Class name + */ + public $class; + /** + * @var string ID + */ + public $box_id; + /** + * @var string Alphanumeric ID + */ + public $boxcode; + /** + * @var string Note + */ + public $note; + /** + * @var string Widget type ('graph' means the widget is a graph widget) + */ + public $widgettype = ''; + //! Must be provided in child classes + /** + * Note $picto is deprecated + * + * @var string Example "accountancy" + */ + public $boximg; + /** + * @var string Example "BoxLastManualEntries" + */ + public $boxlabel; + /** + * @var string[] Example array("accounting") + */ + public $depends; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Return last error message + * + * @return string Error message + */ + public function error() + { + } + /** + * Load a box line from its rowid + * + * @param int $rowid Row id to load + * + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function fetch($rowid) + { + } + /** + * Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function) + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + /** + * Return list of widget. Function used by admin page htdoc/admin/widget. + * List is sorted by widget filename so by priority to run. + * + * @param ?string[] $forcedirwidget null=All default directories. This parameter is used by modulebuilder module only. + * @return array Array list of widgets + * + */ + public static function getWidgetsList($forcedirwidget = \null) + { + } + } + /** + * Class to manage the box to show last manual entries + */ + class box_accountancy_last_manual_entries extends \ModeleBoxes + { + public $boxcode = "accountancy_last_manual_entries"; + public $boximg = "accountancy"; + public $boxlabel = "BoxLastManualEntries"; + public $depends = array("accounting"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show suspense account + */ + class box_accountancy_suspense_account extends \ModeleBoxes + { + public $boxcode = "accountancy_suspense_account"; + public $boximg = "accountancy"; + public $boxlabel = "BoxSuspenseAccount"; + public $depends = array("accounting"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data for box to show them later + * + * @return void + */ + public function loadBox() + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last events + */ + class box_actions extends \ModeleBoxes + { + public $boxcode = "lastactions"; + public $boximg = "object_action"; + public $boxlabel = "BoxOldestActions"; + public $depends = array("agenda"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show events in future + */ + class box_actions_future extends \ModeleBoxes + { + public $boxcode = "futureactions"; + public $boximg = "object_action"; + public $boxlabel = "BoxTitleFutureActions"; + public $depends = array("agenda"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box of customer activity (invoice, order, proposal) + */ + class box_activity extends \ModeleBoxes + { + public $boxcode = "activity"; + public $boximg = "object_bill"; + public $boxlabel = 'BoxGlobalActivity'; + public $depends = array("facture"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Charge les donnees en memoire pour affichage ulterieur + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show user birthdays + */ + class box_birthdays extends \ModeleBoxes + { + public $boxcode = "birthdays"; + public $boximg = "object_user"; + public $boxlabel = "BoxTitleUserBirthdaysOfMonth"; + public $depends = array("user"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 20) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show members birthdays + */ + class box_birthdays_members extends \ModeleBoxes + { + public $boxcode = "birthdays_members"; + public $boximg = "object_user"; + public $boxlabel = "BoxTitleMemberNextBirthdays"; + public $depends = array("adherent"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 20) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last modified BOMs + */ + class box_boms extends \ModeleBoxes + { + public $boxcode = "lastboms"; + public $boximg = "object_bom"; + public $boxlabel = "BoxTitleLatestModifiedBoms"; + public $depends = array("bom"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show bookmarks + */ + class box_bookmarks extends \ModeleBoxes + { + public $boxcode = "bookmarks"; + public $boximg = "bookmark"; + public $boxlabel = "BoxMyLastBookmarks"; + public $depends = array("bookmark"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last customers + */ + class box_clients extends \ModeleBoxes + { + public $boxcode = "lastcustomers"; + public $boximg = "object_company"; + public $boxlabel = "BoxLastCustomers"; + public $depends = array("societe"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last customer orders + */ + class box_commandes extends \ModeleBoxes + { + public $boxcode = "lastcustomerorders"; + public $boximg = "object_order"; + public $boxlabel = "BoxLastCustomerOrders"; + public $depends = array("commande"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show bank accounts + */ + class box_comptes extends \ModeleBoxes + { + public $boxcode = "currentaccounts"; + public $boximg = "bank_account"; + public $boxlabel = "BoxCurrentAccounts"; + public $depends = array("banque"); + // Box active if module banque active + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last contacts + */ + class box_contacts extends \ModeleBoxes + { + public $boxcode = "lastcontacts"; + public $boximg = "object_contact"; + public $boxlabel = "BoxLastContacts"; + public $depends = array("societe"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last contracts + */ + class box_contracts extends \ModeleBoxes + { + public $boxcode = "lastcontracts"; + public $boximg = "object_contract"; + public $boxlabel = "BoxLastContracts"; + public $depends = array("contrat"); + // conf->contrat->enabled + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last thirdparties + */ + class box_customers_outstanding_bill_reached extends \ModeleBoxes + { + public $boxcode = "customersoutstandingbillreached"; + public $boximg = "object_company"; + public $boxlabel = "BoxCustomersOutstandingBillReached"; + public $depends = array("facture", "societe"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last thirdparties + */ + class box_dolibarr_state_board extends \ModeleBoxes + { + public $boxcode = "dolibarrstatebox"; + public $boximg = "generic"; + public $boxlabel = "BoxDolibarrStateBoard"; + public $depends = array("user"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show RSS feeds + */ + class box_external_rss extends \ModeleBoxes + { + public $boxcode = "lastrssinfos"; + public $boximg = "object_rss"; + public $boxlabel = "BoxLastRssInfos"; + public $depends = array("externalrss"); + public $paramdef; + // Params of box definition (not user params) + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @param int $cachedelay Delay we accept for cache file + * @return void + */ + public function loadBox($max = 5, $cachedelay = 3600) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last invoices + */ + class box_factures extends \ModeleBoxes + { + public $boxcode = "lastcustomerbills"; + public $boximg = "object_bill"; + public $boxlabel = "BoxLastCustomerBills"; + public $depends = array("facture"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last supplier invoices + */ + class box_factures_fourn extends \ModeleBoxes + { + public $boxcode = "lastsupplierbills"; + public $boximg = "object_bill"; + public $boxlabel = "BoxLastSupplierBills"; + public $depends = array("facture", "fournisseur"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show not paid suppliers invoices + */ + class box_factures_fourn_imp extends \ModeleBoxes + { + public $boxcode = "oldestunpaidsupplierbills"; + public $boximg = "object_bill"; + public $boxlabel = "BoxOldestUnpaidSupplierBills"; + public $depends = array("facture", "fournisseur"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show not paid sales invoices + */ + class box_factures_imp extends \ModeleBoxes + { + public $boxcode = "oldestunpaidcustomerbills"; + public $boximg = "object_bill"; + public $boxlabel = "BoxOldestUnpaidCustomerBills"; + public $depends = array("facture"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show Fediverse posts + */ + class box_fediverse extends \ModeleBoxes + { + public $boxcode = "lastfediverseinfos"; + public $boximg = "object_share-alt"; + public $boxlabel = "BoxLastFediverseInfos"; + public $depends = array("socialnetworks"); + /** + * @var string + */ + public $paramdef; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @param int $cachedelay Delay we accept for cache file + * @return void + */ + public function loadBox($max = 5, $cachedelay = 3600) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last interventions + */ + class box_ficheinter extends \ModeleBoxes + { + public $boxcode = "ficheinter"; + public $boximg = "object_intervention"; + public $boxlabel = "BoxFicheInter"; + public $depends = array("ficheinter"); + // conf->contrat->enabled + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 10) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last suppliers + */ + class box_fournisseurs extends \ModeleBoxes + { + public $boxcode = "lastsuppliers"; + public $boximg = "object_company"; + public $boxlabel = "BoxLastSuppliers"; + public $depends = array("fournisseur"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show funnel of prospections + */ + class box_funnel_of_prospection extends \ModeleBoxes + { + public $boxcode = "FunnelOfProspection"; + public $boximg = "object_projectpub"; + public $boxlabel = "BoxTitleFunnelOfProspection"; + public $depends = array("projet"); + public $version = 'development'; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No $stringtoprint .=, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show top-selling customers + */ + class box_goodcustomers extends \ModeleBoxes + { + public $boxcode = "goodcustomers"; + public $boximg = "object_company"; + public $boxlabel = "BoxGoodCustomers"; + public $depends = array("societe"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show invoices per month graph + */ + class box_graph_invoices_permonth extends \ModeleBoxes + { + public $boxcode = "invoicespermonth"; + public $boximg = "object_bill"; + public $boxlabel = "BoxCustomersInvoicesPerMonth"; + public $depends = array("facture"); + public $widgettype = 'graph'; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show invoices per year graph + */ + class box_graph_invoices_peryear extends \ModeleBoxes + { + public $boxcode = "invoicesperyear"; + public $boximg = "object_bill"; + public $boxlabel = "BoxCustomersInvoicesPerYear"; + public $depends = array("facture"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last invoices + */ + class box_graph_invoices_supplier_permonth extends \ModeleBoxes + { + public $boxcode = "invoicessupplierpermonth"; + public $boximg = "object_bill"; + public $boxlabel = "BoxSuppliersInvoicesPerMonth"; + public $depends = array("fournisseur"); + public $widgettype = 'graph'; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show number of ticket types + */ + class box_graph_nb_tickets_type extends \ModeleBoxes + { + public $boxcode = "box_graph_nb_tickets_type"; + public $boximg = "ticket"; + public $boxlabel; + public $depends = array("ticket"); + public $widgettype = 'graph'; + /** + * Constructor + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show new daily tickets + */ + class box_graph_nb_ticket_last_x_days extends \ModeleBoxes + { + public $boxcode = "box_graph_nb_ticket_last_x_days"; + public $boximg = "ticket"; + public $boxlabel; + public $depends = array("ticket"); + public $widgettype = 'graph'; + /** + * Constructor + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box + */ + class box_graph_new_vs_close_ticket extends \ModeleBoxes + { + public $boxcode = "box_nb_tickets_type"; + public $boximg = "ticket"; + public $boxlabel; + public $depends = array("ticket"); + public $widgettype = 'graph'; + /** + * Constructor + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show orders per month graph + */ + class box_graph_orders_permonth extends \ModeleBoxes + { + public $boxcode = "orderspermonth"; + public $boximg = "object_order"; + public $boxlabel = "BoxCustomersOrdersPerMonth"; + public $depends = array("commande"); + public $widgettype = 'graph'; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last orders + */ + class box_graph_orders_supplier_permonth extends \ModeleBoxes + { + public $boxcode = "orderssupplierpermonth"; + public $boximg = "object_order"; + public $boxlabel = "BoxSuppliersOrdersPerMonth"; + public $depends = array("fournisseur"); + public $widgettype = 'graph'; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last invoices + */ + class box_graph_product_distribution extends \ModeleBoxes + { + public $boxcode = "productdistribution"; + public $boximg = "object_product"; + public $boxlabel = "BoxProductDistribution"; + public $depends = array("product|service", "facture|propal|commande"); + public $widgettype = 'graph'; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show proposals per month graph + */ + class box_graph_propales_permonth extends \ModeleBoxes + { + public $boxcode = "propalpermonth"; + public $boximg = "object_propal"; + public $boxlabel = "BoxProposalsPerMonth"; + public $depends = array("propal"); + public $widgettype = 'graph'; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box + */ + class box_graph_ticket_by_severity extends \ModeleBoxes + { + public $boxcode = "box_ticket_by_severity"; + public $boximg = "ticket"; + public $boxlabel; + public $depends = array("ticket"); + public $widgettype = 'graph'; + /** + * Constructor + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box of last login + */ + class box_lastlogin extends \ModeleBoxes + { + public $boxcode = "lastlogin"; + public $boximg = "object_user"; + public $boxlabel = 'BoxLoginInformation'; + public $depends = array("user"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into memory for later display + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box + */ + class box_last_knowledgerecord extends \ModeleBoxes + { + /** + * @var string boxcode + */ + public $boxcode = "box_last_knowledgerecord"; + /** + * @var string box img + */ + public $boximg = "knowledgemanagement"; + /** + * @var string box label + */ + public $boxlabel; + /** + * @var string[] box dependencies + */ + public $depends = array("knowledgemanagement"); + /** + * Constructor + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box + */ + class box_last_modified_knowledgerecord extends \ModeleBoxes + { + /** + * @var string boxcode + */ + public $boxcode = "box_last_modified_knowledgerecord"; + /** + * @var string box img + */ + public $boximg = "knowledgemanagement"; + /** + * @var string box label + */ + public $boxlabel; + /** + * @var string[] box dependencies + */ + public $depends = array("knowledgemanagement"); + /** + * Constructor + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last modified tickets + */ + class box_last_modified_ticket extends \ModeleBoxes + { + public $boxcode = "box_last_modified_ticket"; + public $boximg = "ticket"; + public $boxlabel; + public $depends = array("ticket"); + /** + * Constructor + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last created tickets + */ + class box_last_ticket extends \ModeleBoxes + { + public $boxcode = "box_last_ticket"; + public $boximg = "ticket"; + public $boxlabel; + public $depends = array("ticket"); + /** + * Constructor + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show (last modified) members by tags + */ + class box_members_by_tags extends \ModeleBoxes + { + public $boxcode = "box_members_by_tags"; + public $boximg = "object_user"; + public $boxlabel = "BoxTitleMembersByTags"; + public $depends = array("adherent", "categorie"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last modofied members + */ + class box_members_by_type extends \ModeleBoxes + { + public $boxcode = "box_members_by_type"; + public $boximg = "object_user"; + public $boxlabel = "BoxTitleMembersByType"; + public $depends = array("adherent"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last modified members + */ + class box_members_last_modified extends \ModeleBoxes + { + public $boxcode = "box_members_last_modified"; + public $boximg = "object_user"; + public $boxlabel = "BoxLastModifiedMembers"; + public $depends = array("adherent"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last members subscriptions + */ + class box_members_last_subscriptions extends \ModeleBoxes + { + public $boxcode = "box_members_last_subscriptions"; + public $boximg = "object_user"; + public $boxlabel = "BoxLastMembersSubscriptions"; + public $depends = array("adherent"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last modofied members + */ + class box_members_subscriptions_by_year extends \ModeleBoxes + { + public $boxcode = "box_members_subscriptions_by_year"; + public $boximg = "object_user"; + public $boxlabel = "BoxTitleMembersSubscriptionsByYear"; + public $depends = array("adherent"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last manufacturing orders (MO) + */ + class box_mos extends \ModeleBoxes + { + public $boxcode = "lastmos"; + public $boximg = "object_mrp"; + public $boxlabel = "BoxTitleLatestModifiedMos"; + public $depends = array("mrp"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last products + */ + class box_produits extends \ModeleBoxes + { + public $boxcode = "lastproducts"; + public $boximg = "object_product"; + public $boxlabel = "BoxLastProducts"; + public $depends = array("produit"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show too low stocks products + */ + class box_produits_alerte_stock extends \ModeleBoxes + { + public $boxcode = "productsalertstock"; + public $boximg = "object_product"; + public $boxlabel = "BoxProductsAlertStock"; + public $depends = array("produit"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last project + */ + class box_project extends \ModeleBoxes + { + public $boxcode = "project"; + public $boximg = "object_projectpub"; + public $boxlabel; + // var $depends = array("projet"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show project opportunities + */ + class box_project_opportunities extends \ModeleBoxes + { + public $boxcode = "project_opportunities"; + public $boximg = "object_projectpub"; + public $boxlabel; + // var $depends = array("projet"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last proposals + */ + class box_propales extends \ModeleBoxes + { + public $boxcode = "lastpropals"; + public $boximg = "object_propal"; + public $boxlabel = "BoxLastProposals"; + public $depends = array("propal"); + // conf->propal->enabled + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last prospects + */ + class box_prospect extends \ModeleBoxes + { + public $boxcode = "lastprospects"; + public $boximg = "object_company"; + public $boxlabel = "BoxLastProspects"; + public $depends = array("societe"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last contracted products/services lines + */ + class box_scheduled_jobs extends \ModeleBoxes + { + public $boxcode = "scheduledjobs"; + public $boximg = "object_cron"; + public $boxlabel = "BoxScheduledJobs"; + public $depends = array("cron"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last contracted products/services lines + */ + class box_services_contracts extends \ModeleBoxes + { + public $boxcode = "lastproductsincontract"; + public $boximg = "object_product"; + public $boxlabel = "BoxLastProductsInContract"; + public $depends = array("service", "contrat"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show expired services + */ + class box_services_expired extends \ModeleBoxes + { + public $boxcode = "expiredservices"; + // id of box + public $boximg = "object_contract"; + public $boxlabel = "BoxOldestExpiredServices"; + public $depends = array("contrat"); + // conf->propal->enabled + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last shipments + */ + class box_shipments extends \ModeleBoxes + { + public $boxcode = "lastcustomershipments"; + public $boximg = "dolly"; + public $boxlabel = "BoxLastCustomerShipments"; + public $depends = array("expedition"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class that manages the box showing latest supplier orders + */ + class box_supplier_orders extends \ModeleBoxes + { + public $boxcode = "latestsupplierorders"; + public $boximg = "object_order"; + public $boxlabel = "BoxLatestSupplierOrders"; + public $depends = array("fournisseur"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last supplier orders awaiting reception + */ + class box_supplier_orders_awaiting_reception extends \ModeleBoxes + { + public $boxcode = "supplierordersawaitingreception"; + public $boximg = "object_order"; + public $boxlabel = "BoxLatestSupplierOrdersAwaitingReception"; + public $depends = array("fournisseur"); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + } + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last task + */ + class box_task extends \ModeleBoxes + { + public $boxcode = "projettask"; + public $boximg = "object_projecttask"; + public $boxlabel; + public $depends = array("projet"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /** + * Class to manage the box to show last projet + */ + class box_validated_projects extends \ModeleBoxes + { + public $boxcode = "validated_project"; + public $boximg = "object_projectpub"; + public $boxlabel; + //var $depends = array("projet"); + public $enabled = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + } + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + } + /** + * Method to show box + * + * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param ?array> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string + */ + public function showBox($head = \null, $contents = \null, $nooutput = 0) + { + } + } + /* Copyright (C) 2000-2005 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024 MDW + * + * 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 . + * or see https://www.gnu.org/ + */ + /** + * \file htdocs/core/class/antivir.class.php + * \brief File of class to scan viruses + */ + /** + * Class to scan for virus + */ + class AntiVir + { + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + /** + * @var string Used to return message + */ + public $output; + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Scan a file with antivirus. + * This function runs the command defined in setup. This antivirus command must return 0 if OK. + * Return also true (virus found) if file end with '.virus' (so we can make test safely). + * + * @param string $file File to scan + * @return int Return integer <0 if KO (-98 if error, -99 if virus), 0 if OK + */ + public function dol_avscan_file($file) + { + } + /** + * Get full Command Line to run + * + * @param string $file File to scan + * @return string Full command line to run + */ + public function getCliCommand($file) + { + } + } + /* Copyright (C) 2010-2018 Regis Houssin + * Copyright (C) 2011 Laurent Destailleur + * + * 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 . + */ + /** + * \file htdocs/core/class/canvas.class.php + * \ingroup core + * \brief File of class to manage canvas + */ + /** + * Class to manage canvas + */ + class Canvas + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + public $actiontype; + public $dirmodule; + // Module directory + public $targetmodule; + // Module concerned by canvas (ex: thirdparty, contact, ...) + public $canvas; + // Name of canvas (ex: company, individual, product, service, ...) + public $card; + // Tab (sub-canvas) + public $template_dir; + // Initialized by getCanvas with templates directory + public $control; + // Initialized by getCanvas with controller instance + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $actiontype Action type ('create', 'view', 'edit', 'list') + */ + public function __construct($db, $actiontype = 'view') + { + } + /** + * Initialize properties: ->targetmodule, ->canvas, ->card, ->dirmodule, ->template_dir + * + * @param string $module Name of target module (thirdparty, contact, ...) + * @param string $card Tab name of card (ex: 'card', 'info', 'contactcard', ...) or '' for a list page + * @param string $canvas Name of canvas (ex: mycanvas, default, or mycanvas@myexternalmodule) + * @return void + */ + public function getCanvas($module, $card, $canvas) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Shared method for canvas to assign values for templates + * + * @param string $action Action string + * @param int $id Object id (if ref not provided) + * @param string $ref Object ref (if id not provided) + * @return void + */ + public function assign_values(&$action = 'view', $id = 0, $ref = '') + { + } + /** + * Return if a template exists to display as canvas (if it exists) + * + * @param string $action Action code + * @return int 0=Canvas template file does not exist, 1=Canvas template file exists + */ + public function displayCanvasExists($action) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Display a canvas page. This will include the template for output. + * Variables used by templates may have been defined or loaded before into the assign_values function. + * + * @param string $action Action code + * @return void + */ + public function display_canvas($action) + { + } + // This functions should not be used anymore because canvas should contains only templates. + // https://wiki.dolibarr.org/index.php/Canvas_development + /** + * Return if a canvas contains an action controller + * + * @return boolean Return if canvas contains actions (old feature. now actions should be inside hooks) + */ + public function hasActions() + { + } + /** + * Shared method for canvas to execute actions. + * @deprecated Use the doActions of hooks instead of this. + * This function is called if you add a doActions class inside your canvas. Try to not + * do that and add action code into a hook instead. + * + * @param string $action Action string + * @param int $id Object id + * @return mixed Return return code of doActions of canvas + * @see https://wiki.dolibarr.org/index.php/Canvas_development + */ + public function doActions(&$action = 'view', $id = 0) + { + } + } + /** + * Class to manage dictionary Countries (used by imports) + */ + class Ccountry extends \CommonDict + { + public $element = 'ccountry'; + //!< Id that identify managed objects + public $table_element = 'c_country'; + //!< Name of table without prefix where object is stored + public $code_iso; + public $fields = array('label' => array('type' => 'varchar(250)', 'label' => 'Label', 'enabled' => 1, 'visible' => 1, 'position' => 15, 'notnull' => -1, 'showoncombobox' => '1')); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create object into database + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id object + * @param string $code Code + * @param string $code_iso Code ISO + * @return int >0 if OK, 0 if not found, <0 if KO + */ + public function fetch($id, $code = '', $code_iso = '') + { + } + /** + * Update object into database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + } + /** + * Class CGenericDic + */ + class CGenericDic extends \CommonDict + { + /** + * @var string Id to identify managed objects + */ + public $element = 'undefined'; + // Will be defined into constructor + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'undefined'; + // Will be defined into constructor + /** + * @var CtyperesourceLine[] Lines + */ + public $lines = array(); + public $code; + /** + * @var string Label + */ + public $label; + public $active; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $code code + * @param string $label Label + * + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $code = '', $label = '') + { + } + /** + * Load object in memory from the database + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit Limit + * @param int $offset offset limit + * @param string|array $filter filter USF + * @param string $filtermode filter mode (AND or OR) + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $user User making the clone + * @param int $fromid Id of object to clone + * @return int New id of clone + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimen() + { + } + } + /** + * Class of dictionary of opportunity status + */ + class CLeadStatus extends \CommonDict + { + /** + * @var array Array of record + */ + public $records = array(); + /** + * @var string Element + */ + public $element = 'cleadstatus'; + /** + * @var string Table element + */ + public $table_element = 'c_lead_status'; + /** + * @var int Position + */ + public $position; + /** + * @var float Percent + */ + public $percent; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create object into database + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id of CUnit object to fetch (rowid) + * @param string $code Code + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $code = '') + { + } + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit Limit + * @param int $offset Offset + * @param string $filter Filter USF + * @param string $filtermode Filter mode (AND or OR) + * @return array|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') + { + } + /** + * Update object into database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + } + /** + * Class to send emails (with attachments or not) + * Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid,$moreinheader,$sendcontext,$replyto); + * $mailfile->sendfile(); + */ + class CMailFile + { + /** @var string Context of mail ('standard', 'emailing', 'ticket', 'password') */ + public $sendcontext; + /** @var string Send mode of mail ('mail', 'smtps', 'swiftmailer', ...) */ + public $sendmode; + /** + * @var mixed + * @deprecated Seems unused, update if used + */ + public $sendsetup; + /** + * @var string Subject of email + */ + public $subject; + /** @var string From: Label and EMail of sender (must include '<>'). For example '' or 'John Doe ' or ''). Note that with gmail smtps, value here is forced by google to account (but not the reply-to). */ + /** + * @var string Sender email + * Sender: Who sends the email ("Sender" has sent emails on behalf of "From"). + * Use it when the "From" is an email of a domain that is a SPF protected domain, and the sending smtp server is not this domain. In such case, add Sender field with an email of the protected domain. + */ + public $addr_from; + // Return-Path: Email where to send bounds. + /** @var string Reply-To: Email where to send replies from mailer software (mailer use From if reply-to not defined, Gmail use gmail account if reply-to not defined) */ + public $reply_to; + /** @var string Errors-To: Email where to send errors. */ + public $errors_to; + /** @var string Comma separates list of destination emails */ + public $addr_to; + /** @var string Comma separates list of cc emails */ + public $addr_cc; + /** @var string Comma separates list of bcc emails */ + public $addr_bcc; + /** @var string Tracking code */ + public $trackid; + /** @var string Mixed Boundary */ + public $mixed_boundary; + /** @var string Related Boundary */ + public $related_boundary; + /** @var string Alternative Boundary */ + public $alternative_boundary; + /** @var int<0,1> When 1, request delivery receipt */ + public $deliveryreceipt; + /** @var ?int<1,1> When 1, there is at least one file */ + public $atleastonefile; + /** @var string $msg Message to send */ + public $msg; + /** @var string $msg End of line sequence */ + public $eol; + /** @var string $msg End of line sequence (header ?) */ + public $eol2; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Array of Error code (or message) + */ + public $errors = array(); + /** + * @var SMTPS (if this method is used) + */ + public $smtps; + /** + * @var Swift_Mailer (if the method is used) + */ + public $mailer; + /** + * @var Swift_SmtpTransport + */ + public $transport; + /** + * @var Swift_Plugins_Loggers_ArrayLogger + */ + public $logger; + /** + * @var string|array CSS + */ + public $css; + /** @var ?string Defined css style for body background */ + public $styleCSS; + /** @var ?string Defined background directly in body tag */ + public $bodyCSS; + /** + * @var string Message-ID of the email to send (generated) + */ + public $msgid; + /** + * @var string Value to use in In-reply-to when email is set as an answer of another email (The Msg-Id of received email) + */ + public $in_reply_to; + /** + * @var string References to add to the email to send (generated from the email we answer) + */ + public $references; + /** + * @var string Headers + */ + public $headers; + /** + * @var string Message + */ + public $message; + /** + * @var ?string[] fullfilenames list (full path of filename on file system) + */ + public $filename_list = array(); + /** + * @var ?string[] mimetypes of files list (List of MIME type of attached files) + */ + public $mimetype_list = array(); + /** + * @var ?string[] filenames list (List of attached file name in message) + */ + public $mimefilename_list = array(); + /** + * @var ?string[] filenames cid + */ + public $cid_list = array(); + /** @var string HTML content */ + public $html; + /** @var int<0,1> */ + public $msgishtml; + /** @var string */ + public $image_boundary; + /** @var int<0,1> */ + public $atleastoneimage = 0; + // at least one image file with file=xxx.ext into content (TODO Debug this. How can this case be tested. Remove if not used). + /** @var array */ + public $html_images = array(); + /** @var array */ + public $images_encoded = array(); + public $image_types = array('gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'bmp' => 'image/bmp', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff'); + /** + * CMailFile + * + * @param string $subject Topic/Subject of mail + * @param string $to Recipients emails (RFC 2822: "Name firstname [, ...]" or "email[, ...]" or "[, ...]"). Note: the keyword '__SUPERVISOREMAIL__' is not allowed here and must be replaced by caller. + * @param string $from Sender email (RFC 2822: "Name firstname [, ...]" or "email[, ...]" or "[, ...]") + * @param string $msg Message + * @param ?string[] $filename_list List of files to attach (full path of filename on file system) + * @param ?string[] $mimetype_list List of MIME type of attached files + * @param ?string[] $mimefilename_list List of attached file name in message + * @param string $addr_cc Email cc (Example: 'abc@def.com, ghk@lmn.com') + * @param string $addr_bcc Email bcc (Note: This is autocompleted with MAIN_MAIL_AUTOCOPY_TO if defined) + * @param int<0,1> $deliveryreceipt Ask a delivery receipt + * @param int<-1,1> $msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown make autodetection (with fast mode, not reliable) + * @param string $errors_to Email for errors-to + * @param string|array $css Css option (should be array, legacy: empty string if none) + * @param string $trackid Tracking string (contains type and id of related element) + * @param string $moreinheader More in header. $moreinheader must contains the "\r\n" at end of each line + * @param string $sendcontext 'standard', 'emailing', 'ticket', 'password', ... (used to define which sending mode and parameters to use) + * @param string $replyto Reply-to email (will be set to the same value than From by default if not provided) + * @param string $upload_dir_tmp Temporary directory (used to convert images embedded as img src=data:image) + * @param string $in_reply_to Message-ID of the message we reply to + * @param string $references String with list of Message-ID of the thread ('<123> <456> ...') + */ + public function __construct($subject, $to, $from, $msg, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = 0, $errors_to = '', $css = '', $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '', $upload_dir_tmp = '', $in_reply_to = '', $references = '') + { + } + /** + * Send mail that was prepared by constructor. + * + * @return bool True if mail sent, false otherwise. Negative int if error in hook. String if incorrect send mode. + * + * @phan-suppress PhanTypeMismatchReturnNullable False positif by phan for unclear reason. + */ + public function sendfile() + { + } + /** + * Encode subject according to RFC 2822 - http://en.wikipedia.org/wiki/MIME#Encoded-Word + * + * @param string $stringtoencode String to encode + * @return string string encoded + */ + public static function encodetorfc2822($stringtoencode) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Write content of a SMTP request into a dump file (mode = all) + * Used for debugging. + * Note that to see full SMTP protocol, you can use tcpdump -w /tmp/smtp -s 2000 port 25" + * + * @return void + */ + public function dump_mail() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Save content if mail is in error + * Used for debugging. + * + * @param string $message Add also a message + * @return void + */ + public function save_dump_mail_in_err($message = '') + { + } + /** + * Correct an incomplete html string + * + * @param string $msg String + * @return string Completed string + */ + public function checkIfHTML($msg) + { + } + /** + * Build a css style (mode = all) into this->styleCSS and this->bodyCSS + * + * @return void + */ + public function buildCSS() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Create SMTP headers (mode = 'mail') + * + * @return string headers + */ + public function write_smtpheaders() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Create header MIME (mode = 'mail') + * + * @param string[] $filename_list Array of filenames + * @param string[] $mimefilename_list Array of mime types + * @return string mime headers + */ + public function write_mimeheaders($filename_list, $mimefilename_list) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return email content (mode = 'mail') + * + * @param string $msgtext Message string + * @return string String content + */ + public function write_body($msgtext) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Attach an image to email (mode = 'mail') + * + * @param array $images_list Array of array image + * @return string Chaine images encodees + */ + public function write_images($images_list) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Try to create a socket connection + * + * @param string $host Add ssl:// for SSL/TLS. + * @param int $port Example: 25, 465 + * @return int Socket id if ok, 0 if KO + */ + public function check_server_port($host, $port) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * This function has been modified as provided by SirSir to allow multiline responses when + * using SMTP Extensions. + * + * @param resource $socket Socket + * @param string $response Response string + * @return boolean true if success + */ + public function server_parse($socket, $response) + { + } + /** + * Return a formatted address string for SMTP protocol + * + * @param string $address Example: 'John Doe , Alan Smith ' or 'john@doe.com, alan@smith.com' + * @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between ", 4 label or email, 5 mailto link + * @param int $encode 0=No encode name, 1=Encode name to RFC2822 + * @param int $maxnumberofemail 0=No limit. Otherwise, maximum number of emails returned ($address may contains several email separated with ','). Add '...' if there is more. + * @return string If format 0: '' or 'John Doe ' or '=?UTF-8?B?Sm9obiBEb2U=?= ' + * If format 1: '' + * If format 2: 'john@doe.com' + * If format 3: '' or '"John Doe" ' or '"=?UTF-8?B?Sm9obiBEb2U=?=" ' + * If format 4: 'John Doe' or 'john@doe.com' if no label exists + * If format 5: John Doe or john@doe.com if no label exists + * @see getArrayAddress() + */ + public static function getValidAddress($address, $format, $encode = 0, $maxnumberofemail = 0) + { + } + /** + * Return a formatted array of address string for SMTP protocol + * + * @param string $address Example: 'John Doe , Alan Smith ' or 'john@doe.com, alan@smith.com' + * @return array array(email => name) + * @see getValidAddress() + */ + public static function getArrayAddress($address) + { + } + } + /* Copyright (C) 2019 Laurent Destailleur + * Copyright (C) 2024 MDW + * + * 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 . + * or see https://www.gnu.org/ + */ + /** + * Class to manage comment + */ + class Comment extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'comment'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'comment'; + /** + * @var int ID of parent key (it's not the name of a field) + */ + public $fk_element; + /** + * @var string element type + */ + public $element_type; + /** + * @var string description + */ + public $description; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + /** + * @var int ID + */ + public $fk_user_author; + /** + * @var int ID + */ + public $fk_user_modif; + /** + * @var int Entity + */ + public $entity; + /** + * @var string Import key + */ + public $import_key; + public $comments = array(); + /** + * @var static Object oldcopy + */ + public $oldcopy; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create into database + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id object + * @param string $ref ref object + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = '') + { + } + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <=0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete task from database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Load comments linked with current task into ->comments + * + * @param string $element_type Element type + * @param int $fk_element Id of element + * @return int Result + */ + public function fetchAllFor($element_type, $fk_element) + { + } + } + /* Copyright (C) 2003-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Marcos García + * Copyright (C) 2016-2023 Charlene Benke + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2020 Josep Lluís Amador + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Mélina Joum + * + * 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 . + * or see https://www.gnu.org/ + */ + /** + * \file htdocs/core/class/commondocgenerator.class.php + * \ingroup core + * \brief File of parent class for documents generators + */ + /** + * Parent class for documents (PDF, ODT, ...) generators + */ + abstract class CommonDocGenerator + { + /** + * @var string Model name + */ + public $name = ''; + /** + * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' Version + */ + public $version = ''; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Array of error strings + */ + public $errors = array(); + /** + * @var DoliDB Database handler. + */ + protected $db; + /** + * @var ?Extrafields object + */ + public $extrafieldsCache; + /** + * @var int If set to 1, save the fullname of generated file with path as the main doc when generating a doc with this template. + */ + public $update_main_doc_field; + /** + * @var string The name of constant to use to scan ODT files (Example: 'COMMANDE_ADDON_PDF_ODT_PATH') + */ + public $scandir; + /** + * @var string model description (short text) + */ + public $description; + /** + * @var array + */ + public $format; + /** + * @var string pdf, odt, etc + */ + public $type; + public $page_hauteur; + public $page_largeur; + public $marge_gauche; + public $marge_droite; + public $marge_haute; + public $marge_basse; + public $option_logo; + public $option_tva; + public $option_multilang; + public $option_freetext; + public $option_draft_watermark; + public $watermark; + public $option_modereg; + public $option_condreg; + public $option_escompte; + public $option_credit_note; + public $tva; + public $tva_array; + /** + * Local tax rates Array[tax_type][tax_rate] + * + * @var array> + */ + public $localtax1; + /** + * Local tax rates Array[tax_type][tax_rate] + * + * @var array> + */ + public $localtax2; + /** + * @var int Tab Title Height + */ + public $tabTitleHeight; + /** + * @var array default title fields style + */ + public $defaultTitlesFieldsStyle; + /** + * @var array default content fields style + */ + public $defaultContentsFieldsStyle; + /** + * @var Societe Issuer of document + */ + public $emetteur; + /** + * @var array{0:int,1:int} Minimum version of PHP required by module. + * e.g.: PHP ≥ 7.1 = array(7, 1) + */ + public $phpmin = array(7, 1); + /** + * @var array Array of columns + */ + public $cols; + /** + * @var array{fullpath:string} Array with result of doc generation. content is array('fullpath'=>$file) + */ + public $result; + public $posxlabel; + public $posxup; + public $posxref; + public $posxpicture; + // For picture + public $posxdesc; + // For description + public $posxqty; + public $posxpuht; + public $posxtva; + public $posxtotalht; + public $postotalht; + public $posxunit; + public $posxdiscount; + public $posxworkload; + public $posxtimespent; + public $posxprogress; + public $atleastonephoto; + public $atleastoneratenotnull; + public $atleastonediscount; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Define array with couple substitution key => substitution value + * + * @param User $user User + * @param Translate $outputlangs Language object for output + * @return array Array of substitution key->code + */ + public function get_substitutionarray_user($user, $outputlangs) + { + } + /** + * Define array with couple substitution key => substitution value + * + * @param Adherent $member Member + * @param Translate $outputlangs Language object for output + * @return array Array of substitution key->code + */ + public function getSubstitutionarrayMember($member, $outputlangs) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Define array with couple substitution key => substitution value + * + * @param Societe $mysoc Object thirdparty + * @param Translate $outputlangs Language object for output + * @return array Array of substitution key->code + */ + public function get_substitutionarray_mysoc($mysoc, $outputlangs) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Define array with couple substitution key => substitution value + * For example {company_name}, {company_name_alias} + * + * @param Societe $object Object + * @param Translate $outputlangs Language object for output + * @param string $array_key Name of the key for return array + * @return array Array of substitution key->code + */ + public function get_substitutionarray_thirdparty($object, $outputlangs, $array_key = 'company') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Define array with couple substitution key => substitution value + * + * @param Contact $object contact + * @param Translate $outputlangs object for output + * @param string $array_key Name of the key for return array + * @return array Array of substitution key->code + */ + public function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Define array with couple substitution key => substitution value + * + * @param Translate $outputlangs Language object for output + * @return array Array of substitution key->code + */ + public function get_substitutionarray_other($outputlangs) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Define array with couple substitution key => substitution value + * Note that vars into substitutions array are formatted. + * + * @param CommonObject $object Main object to use as data source + * @param Translate $outputlangs Lang object to use for output + * @param string $array_key Name of the key for return array + * @return array Array of substitution + */ + public function get_substitutionarray_object($object, $outputlangs, $array_key = 'object') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Define array with couple substitution key => substitution value + * Note that vars into substitutions array are formatted. + * + * @param CommonObjectLine $line Object line + * @param Translate $outputlangs Translate object to use for output + * @param int $linenumber The number of the line for the substitution of "object_line_pos" + * @return array Return a substitution array + */ + public function get_substitutionarray_lines($line, $outputlangs, $linenumber = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Define array with couple substitution key => substitution value + * Note that vars into substitutions array are formatted. + * + * @param Expedition $object Main object to use as data source + * @param Translate $outputlangs Lang object to use for output + * @param string $array_key Name of the key for return array + * @return array Array of substitution + */ + public function get_substitutionarray_shipment($object, $outputlangs, $array_key = 'object') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Define array with couple substitution key => substitution value + * + * @param Object $object Dolibarr Object + * @param Translate $outputlangs Language object for output + * @param boolean|int $recursive Want to fetch child array or child object. + * @return array Array of substitution key->code + */ + public function get_substitutionarray_each_var_object(&$object, $outputlangs, $recursive = 1) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Fill array with couple extrafield key => extrafield value + * Note that vars into substitutions array are formatted. + * + * @param Object $object Object with extrafields (must have $object->array_options filled) + * @param array $array_to_fill Substitution array + * @param Extrafields $extrafields Extrafields object + * @param string $array_key Prefix for name of the keys into returned array + * @param Translate $outputlangs Lang object to use for output + * @return array Substitution array + */ + public function fill_substitutionarray_with_extrafields($object, $array_to_fill, $extrafields, $array_key, $outputlangs) + { + } + /** + * Rect pdf + * + * @param TCPDI|TCPDF $pdf Pdf object + * @param float $x Abscissa of first point + * @param float $y Ordinate of first point + * @param float $l ?? + * @param float $h ?? + * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title + * @param int $hidebottom Hide bottom + * @return void + */ + public function printRect($pdf, $x, $y, $l, $h, $hidetop = 0, $hidebottom = 0) + { + } + /** + * uasort callback function to Sort columns fields + * + * @param array $a PDF lines array fields configs + * @param array $b PDF lines array fields configs + * @return int Return compare result + */ + public function columnSort($a, $b) + { + } + /** + * Prepare Array Column Field + * + * @param object $object common object + * @param Translate $outputlangs langs + * @param int $hidedetails Do not show line details + * @param int $hidedesc Do not show desc + * @param int $hideref Do not show ref + * @return void + */ + public function prepareArrayColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) + { + } + /** + * get column content width from column key + * + * @param string $colKey the column key + * @return float width in mm + */ + public function getColumnContentWidth($colKey) + { + } + /** + * get column content X (abscissa) left position from column key + * + * @param string $colKey the column key + * @return float X position in mm + */ + public function getColumnContentXStart($colKey) + { + } + /** + * get column position rank from column key + * + * @param string $colKey the column key + * @return int rank on success and -1 on error + */ + public function getColumnRank($colKey) + { + } + /** + * get column position rank from column key + * + * @param string $newColKey the new column key + * @param array $defArray a single column definition array + * @param string $targetCol target column used to place the new column beside + * @param bool $insertAfterTarget insert before or after target column ? + * @return int new rank on success and -1 on error + */ + public function insertNewColumnDef($newColKey, $defArray, $targetCol = '', $insertAfterTarget = \false) + { + } + /** + * print standard column content + * + * @param TCPDI|TCPDF $pdf Pdf object + * @param float $curY current Y position + * @param string $colKey the column key + * @param string $columnText column text + * @return int Return integer <0 if KO, >= if OK + */ + public function printStdColumnContent($pdf, &$curY, $colKey, $columnText = '') + { + } + /** + * print description column content + * + * @param TCPDI|TCPDF $pdf Pdf object + * @param float $curY current Y position + * @param string $colKey the column key + * @param object $object CommonObject + * @param int $i the $object->lines array key + * @param Translate $outputlangs Output language + * @param int $hideref hide ref + * @param int $hidedesc hide desc + * @param int $issupplierline if object need supplier product + * @return void + */ + public function printColDescContent($pdf, &$curY, $colKey, $object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $issupplierline = 0) + { + } + /** + * get extrafield content for pdf writeHtmlCell compatibility + * usage for PDF line columns and object note block + * + * @param CommonObject $object Common object + * @param string $extrafieldKey The extrafield key + * @param Translate $outputlangs The output langs (if value is __(XXX)__ we use it to translate it). + * @return string + */ + public function getExtrafieldContent($object, $extrafieldKey, $outputlangs = \null) + { + } + /** + * display extrafields columns content + * + * @param CommonObjectLine $object line of common object + * @param Translate $outputlangs Output language + * @param array $params array of additional parameters + * @return string Html string + */ + public function getExtrafieldsInHtml($object, $outputlangs, $params = array()) + { + } + /** + * get column status from column key + * + * @param string $colKey the column key + * @return boolean true if column on + */ + public function getColumnStatus($colKey) + { + } + /** + * Print standard column content + * + * @param TCPDI|TCPDF $pdf Pdf object + * @param float $tab_top Tab top position + * @param float $tab_height Default tab height + * @param Translate $outputlangs Output language + * @param int $hidetop Hide top + * @return float Height of col tab titles + */ + public function pdfTabTitles(&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop = 0) + { + } + /** + * Define Array Column Field for extrafields + * + * @param object $object common object det + * @param Translate $outputlangs langs + * @param int $hidedetails Do not show line details + * @return int Return integer <0 if KO, >=0 if OK + */ + public function defineColumnExtrafield($object, $outputlangs, $hidedetails = 0) + { + } + /** + * Define Array Column Field into $this->cols + * This method must be implemented by the module that generate the document with its own columns. + * + * @param Object $object Common object + * @param Translate $outputlangs Langs + * @param int $hidedetails Do not show line details + * @param int $hidedesc Do not show desc + * @param int $hideref Do not show ref + * @return void + */ + public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) + { + } + } + /* Copyright (C) 2023 Laurent Destailleur + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/core/class/commonhookactions.class.php + * \ingroup core + * \brief File of parent class of all other hook actions classes + */ + /** + * Parent class of all other hook actions classes + */ + abstract class CommonHookActions + { + /** + * @var ?string String of results. + */ + public $resprints; + /** + * @var array Array of results. + */ + public $results = array(); + /** + * Check context of hook + * @param array $parameters Hook parameters. + * @param array|string $allContexts Context to check + * @return bool + */ + protected function isContext($parameters, $allContexts) + { + } + } + /* Copyright (C) 2023 Laurent Destailleur + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW + * + * 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 . + * or see https://www.gnu.org/ + */ + /** + * \file htdocs/core/class/commonnumrefgenerator.class.php + * \ingroup core + * \brief File of parent class for num ref generators + */ + /** + * Parent class for number ref generators + */ + abstract class CommonNumRefGenerator + { + /** + * @var string Model name + */ + public $name = ''; + /** + * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'experimental'|'dolibarr' Version + */ + public $version = ''; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Array of error strings + */ + public $errors = array(); + /** + * @var DoliDB Database handler. + */ + protected $db; + /** + * @var int<0,1> Is Code optional 0 or 1 + */ + public $code_null; + /** + * @var int<0,1> Is Code editable 0 or 1 + */ + public $code_modifiable; + /** + * @var int<0,1> Is Code editable if invalid 0 or 1 + */ + public $code_modifiable_invalide; + /** + * @var int<0,1> Is Code editable if null + */ + public $code_modifiable_null; + /** + * @var int<0,1> Automatic numbering 0 or 1 + */ + public $code_auto; + /** + * @var int<0,1> The third party prefix field must be filled in when using {pre} + */ + public $prefixIsRequired; + /** Return model name + * + * @param Translate $langs Object langs + * @return string Model name + * @deprecated Use getName() instead + * @see getName() + */ + public function getNom($langs) + { + } + /** Return model name + * + * @param Translate $langs Object langs + * @return string Model name + */ + public function getName($langs) + { + } + /** + * Return if a module can be used or not + * + * @return boolean true if module can be used + */ + public function isEnabled() + { + } + /** + * Returns the default description of the numbering template + * + * @param Translate $langs Language + * @return string Descriptive text + */ + public function info($langs) + { + } + /** + * Checks if the numbers already in the database do not + * cause conflicts that would prevent this numbering working. + * + * @param CommonObject $object Object we need next value for + * @return boolean false if conflict, true if ok + */ + public function canBeActivated($object) + { + } + /** + * Returns version of numbering module + * + * @return string Valeur + */ + public function getVersion() + { + } + } + /** + * Class to generate stick sheet with format Avery or other personalised + */ + abstract class CommonStickerGenerator extends \CommonDocGenerator + { + /** + * @var DoliDB Database handler. + */ + public $db; + public $code; + // Code of format + // phpcs:disable PEAR.NamingConventions.ValidVariableName.PublicUnderscore + // protected + // Name of stick + protected $_Avery_Name = ''; + // Code of stick + protected $_Avery_Code = ''; + // Marge de gauche de l'etiquette + protected $_Margin_Left = 0; + // marge en haut de la page avant la premiere etiquette + protected $_Margin_Top = 0; + // Espace horizontal entre 2 bandes d'etiquettes + protected $_X_Space = 0; + // Espace vertical entre 2 bandes d'etiquettes + protected $_Y_Space = 0; + // NX Nombre d'etiquettes sur la largeur de la page + protected $_X_Number = 0; + // NY Number of labels on the height of a page + protected $_Y_Number = 0; + // width of label + protected $_Width = 0; + // Height of label + protected $_Height = 0; + // Height of characters + protected $_Char_Size = 10; + // Height by default of a line + protected $_Line_Height = 10; + // Type of metric.. Will help to calculate good values + protected $_Metric = 'mm'; + // Type of metric for the doc.. + protected $_Metric_Doc = 'mm'; + protected $_COUNTX = 1; + protected $_COUNTY = 1; + protected $_First = 1; + public $Tformat; + /** + * @var array + */ + public $_Avery_Labels; + // phpcs:enable + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Function to build PDF on disk, then output on HTTP stream. + * + * @param array $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>) + * @param Translate $outputlangs Lang object for output language + * @param string $srctemplatepath Full path of source filename for generator using a template file + * @param string $outputdir Output directory for pdf file + * @return int 1=OK, 0=KO + */ + public abstract function write_file($arrayofrecords, $outputlangs, $srctemplatepath, $outputdir = ''); + // phpcs:enable + /** + * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) + * + * @param TCPDF $pdf PDF reference + * @param Translate $outputlangs Output langs + * @param array $param Associative array containing label content and optional parameters + * @return void + */ + public abstract function addSticker(&$pdf, $outputlangs, $param); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Method to modify the size of characters + * This will also modify the space between lines + * + * @param TCPDF $pdf PDF reference + * @param int $pt Point + * @return void + */ + public function Set_Char_Size(&$pdf, $pt) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * protected Print dot line + * + * @param TCPDF $pdf PDF reference + * @param int $x1 X1 + * @param int $y1 Y1 + * @param int $x2 X2 + * @param int $y2 Y2 + * @param int $epaisseur Epaisseur + * @param int $nbPointilles Nb pointilles + * @return void + */ + protected function _Pointille(&$pdf, $x1 = 0, $y1 = 0, $x2 = 210, $y2 = 297, $epaisseur = 1, $nbPointilles = 15) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * protected Function realisant une croix aux 4 coins des cartes + * + * @param TCPDF $pdf PDF reference + * @param int $x1 X1 + * @param int $y1 Y1 + * @param int $x2 X2 + * @param int $y2 Y2 + * @param int $epaisseur Epaisseur + * @param int $taille Size + * @return void + * + * @phan-suppress PhanPluginSuspiciousParamPosition + */ + protected function _Croix(&$pdf, $x1 = 0, $y1 = 0, $x2 = 210, $y2 = 297, $epaisseur = 1, $taille = 4) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * protected Give the height for a char size given. + * + * @param int $pt Point + * @return int Height chars + */ + protected function _Get_Height_Chars($pt) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * protected Set format + * + * @param TCPDF $pdf PDF reference + * @param array{metric:string,name:string,code:string,marginLeft:float,marginTip:float,SpaceX:float,SpaceY:float,NX:int,NY:int,width:float,height:float,font-size:float} $format Format + * @return void + */ + protected function _Set_Format(&$pdf, $format) + { + } + } + /* Copyright (C) 2003-2007 Rodolphe Quiedeville + * Copyright (C) 2003 Xavier Dutoit + * Copyright (C) 2004-2020 Laurent Destailleur + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2006 Jean Heimburger + * + * 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 . + */ + /** + * \file htdocs/core/class/conf.class.php + * \ingroup core + * \brief File of class to manage storage of current setup + * Config is stored into file conf.php + */ + /** + * Class to stock current configuration + */ + class Conf extends \stdClass + { + /** + * @var Object Associative array with properties found in conf file + */ + public $file; + /** + * @var Object Associative array with some properties ->type, ->db, ... + */ + public $db; + /** + * @var Object To store global setup found into database + */ + public $global; + /** + * @var Object To store browser info (->name, ->os, ->version, ->ua, ->layout, ...) + */ + public $browser; + //! To store some setup of generic modules + public $mycompany; + public $admin; + public $medias; + //! To store properties of multi-company + public $multicompany; + //! To store module status of special module names + public $expedition_bon; + public $delivery_note; + //! To store if javascript/ajax is enabked + public $use_javascript_ajax; + //! To store if javascript/ajax is enabked + public $disable_compute; + //! Used to store current currency (ISO code like 'USD', 'EUR', ...). To get the currency symbol: $langs->getCurrencySymbol($this->currency) + public $currency; + /** + * @var string + */ + public $theme; + // Contains current theme ("eldy", "auguria", ...) + //! Used to store current css (from theme) + /** + * @var string + */ + public $css; + // Contains full path of css page ("/theme/eldy/style.css.php", ...) + public $email_from; + //! Used to store current menu handler + public $standard_menu; + /** + * @var array List of activated modules + */ + public $modules; + /** + * @var array> List of activated modules + */ + public $modules_parts; + /** + * @var array An array to store cache results ->cache['nameofcache']=... + */ + public $cache; + /** + * @var int To tell header was output + */ + public $headerdone; + /** + * @var string[] + */ + public $logbuffer = array(); + /** + * @var LogHandler[] + */ + public $loghandlers = array(); + /** + * @var int Used to store running instance for multi-company (default 1) + */ + public $entity = 1; + /** + * @var int[] Used to store list of entities to use for each element + */ + public $entities = array(); + public $dol_hide_topmenu; + // Set if we force param dol_hide_topmenu into login url + public $dol_hide_leftmenu; + // Set if we force param dol_hide_leftmenu into login url + public $dol_optimize_smallscreen; + // Set if we force param dol_optimize_smallscreen into login url or if browser is smartphone + public $dol_no_mouse_hover; + // Set if we force param dol_no_mouse_hover into login url or if browser is smartphone + public $dol_use_jmobile; + // Set if we force param dol_use_jmobile into login url. 0=default, 1=to say we use app from a webview app, 2=to say we use app from a webview app and keep ajax + public $format_date_short; + // Format of day with PHP/C tags (strftime functions) + public $format_date_short_java; + // Format of day with Java tags + public $format_hour_short; + public $format_hour_short_duration; + public $format_date_text_short; + public $format_date_text; + public $format_date_hour_short; + public $format_date_hour_sec_short; + public $format_date_hour_text_short; + public $format_date_hour_text; + public $liste_limit; + public $main_checkbox_left_column; + public $tzuserinputkey = 'tzserver'; + // Use 'tzuserrel' to always store date in GMT and show date in time zone of user. + // TODO Remove this part. + /** + * @var stdClass Supplier + */ + public $fournisseur; + /** + * @var stdClass Product + */ + public $product; + /** + * @deprecated Use product + */ + public $produit; + public $service; + /** + * @deprecated Use contract + */ + public $contrat; + public $contract; + public $actions; + public $agenda; + public $propal; + /** + * @deprecated Use order + */ + public $commande; + public $order; + /** + * @deprecated Use invoice + */ + public $facture; + public $invoice; + public $user; + /** + * @deprecated Use member + */ + public $adherent; + public $member; + public $bank; + public $notification; + public $expensereport; + public $productbatch; + /** + * @deprecated Use project + */ + public $projet; + public $project; + public $supplier_proposal; + public $supplier_order; + public $supplier_invoice; + public $category; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Load setup values into conf object (read llx_const) for a specified entity + * Note that this->db->xxx, this->file->xxx and this->multicompany have been already loaded when setEntityValues is called. + * + * @param DoliDB $db Database handler + * @param int $entity Entity to get + * @return int Return integer < 0 if KO, >= 0 if OK + */ + public function setEntityValues($db, $entity) + { + } + /** + * Load setup values into conf object (read llx_const) + * Note that this->db->xxx, this->file->xxx have been already set when setValues is called. + * + * @param DoliDB $db Database handler + * @return int Return integer < 0 if KO, >= 0 if OK + */ + public function setValues($db) + { + } + } + /** + * Class of dictionary of nature of product (used by imports) + */ + class CProductNature extends \CommonDict + { + /** + * @var array record + */ + public $records = array(); + /** + * @var string element + */ + public $element = 'cproductnbature'; + /** + * @var string table element + */ + public $table_element = 'c_product_nature'; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create object into database + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id of CUnit object to fetch (rowid) + * @param string $code Code + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $code = '') + { + } + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit Limit + * @param int $offset Offset + * @param string $filter Filter USF + * @param string $filtermode Filter mode (AND or OR) + * @return array|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') + { + } + /** + * Update object into database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Get unit from code + * @param int $code code of unit + * @param string $mode 0= id , short_label=Use short label as value, code=use code + * @return int Return integer <0 if KO, Id of code if OK + */ + public function getProductNatureFromCode($code, $mode = 'code') + { + } + } + /** + * Class to manage dictionary Regions + */ + class Cregion extends \CommonDict + { + //public $element = 'cregion'; //!< Id that identify managed objects + //public $table_element = 'c_regions'; //!< Name of table without prefix where object is stored + /** + * @var int The code of the region + */ + public $code_region; + /** + * @var int The ID of the country of the region + */ + public $fk_pays; + /** + * @var string The name of the region + */ + public $name; + /** + * @var string The reference of the "chef-lieu" of the region + * A.k.a. the administrative headquarter of the region + * (examples: HU33, PT9, 97601) + */ + public $cheflieu; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create object into database + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id object + * @param int $code_region Code + * @param int $fk_pays Country Id + * @return int >0 if OK, 0 if not found, <0 if KO + */ + public function fetch($id, $code_region = 0, $fk_pays = 0) + { + } + /** + * Update object into database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + } + /* Copyright (C) 2000-2005 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024 MDW + * + * 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 . + * or see https://www.gnu.org/ + * + * Lots of code inspired from Dan Potter's CSMSFile class + */ + /** + * \file htdocs/core/class/CSMSFile.class.php + * \brief File of class to send sms + * \author Laurent Destailleur. + */ + /** + * Class to send SMS + * Usage: $smsfile = new CSMSFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to); + * $smsfile->socid=...; $smsfile->contact_id=...; $smsfile->member_id=...; $smsfile->fk_project=...; + * $smsfile->sendfile(); + */ + class CSMSFile + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Array of Error code (or message) + */ + public $errors = array(); + /** + * @var string end of line character + */ + public $eol; + /** + * @var string address from + */ + public $addr_from; + /** + * @var string address to + */ + public $addr_to; + public $deferred; + public $priority; + public $class; + public $message; + /** + * @var bool + */ + public $nostop; + public $socid; + public $contact_id; + public $member_id; + public $fk_project; + public $deliveryreceipt; + /** + * CSMSFile + * + * @param string $to Recipients SMS + * @param string $from Sender SMS + * @param string $msg Message + * @param int $deliveryreceipt Not used + * @param int $deferred Deferred or not + * @param int $priority Priority + * @param int $class Class + */ + public function __construct($to, $from, $msg, $deliveryreceipt = 0, $deferred = 0, $priority = 3, $class = 1) + { + } + /** + * Send SMS that was prepared by constructor + * + * @return boolean True if SMS sent, false otherwise + */ + public function sendfile() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Write content of a SendSms request into a dump file (mode = all) + * Used for debugging. + * + * @return void + */ + public function dump_sms() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Write content of a SendSms result into a dump file (mode = all) + * Used for debugging. + * + * @param int $result Result of sms sending + * @return void + */ + public function dump_sms_result($result) + { + } + } + /** + * Class to manage dictionary States (used by imports) + */ + class Cstate extends \CommonDict + { + /** + * @var int The ID of the state + */ + public $rowid; + /** + * @var string The code of the state + * (ex: LU0011, MA12, 07, 0801, etc.) + */ + public $code_departement; + /** + * @var string The name of the state + */ + public $name = ''; + /** + * @var string + * @deprecated + * @see $name + */ + public $nom = ''; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create object into database + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id State ID + * @param string $code State code + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $code = '') + { + } + /** + * Update object into database + * + * @param User $user User who updates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + } + } + /** + * Class of dictionary type of thirdparty (used by imports) + */ + class Ctypent extends \CommonDict + { + /** + * @var int ID of country + */ + public $country_id; + public $libelle; + public $module; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create object into database + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id object + * @param string $code Code + * @param string $label Label + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $code = '', $label = '') + { + } + /** + * Update object into database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + } + /** + * Class Ctyperesource + */ + class Ctyperesource extends \CommonDict + { + /** + * @var string Id to identify managed objects + */ + public $element = 'ctyperesource'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'c_type_resource'; + /** + * @var CtyperesourceLine[] Lines + */ + public $lines = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $code code + * @param string $label Label + * + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $code = '', $label = '') + { + } + /** + * Load object in memory from the database + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit Limit + * @param int $offset Offset limit + * @param string|array $filter filter array + * @param string $filtermode filter mode (AND or OR) + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Load an object from its id and create a new one in database + * + * @param User $user User making the clone + * @param int $fromid Id of object to clone + * @return int New id of clone + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimen() + { + } + } + /** + * Class CtyperesourceLine + */ + class CtyperesourceLine + { + /** + * @var int ID + */ + public $id; + /** + * @var mixed Sample line property 1 + */ + public $code; + /** + * @var string Type resource line label + */ + public $label; + public $active; + } + /** + * Class of dictionary type of thirdparty (used by imports) + */ + class CUnits extends \CommonDict + { + public $records = array(); + //var $element='ctypent'; //!< Id that identify managed objects + //var $table_element='ctypent'; //!< Name of table without prefix where object is stored + /** + * @var string label + * @deprecated + * @see $label + */ + public $libelle; + public $sortorder; + public $short_label; + public $unit_type; + public $scale; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create object into database + * + * @param User $user User that create + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create($user, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id of CUnit object to fetch (rowid) + * @param string $code Code + * @param string $short_label Short Label ('g', 'kg', ...) + * @param string $unit_type Unit type ('size', 'surface', 'volume', 'weight', ...) + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $code = '', $short_label = '', $unit_type = '') + { + } + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit Limit + * @param int $offset Offset + * @param string|array $filter Filter USF + * @param string $filtermode Filter mode (AND or OR) + * @return array|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') + { + } + /** + * Update object into database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user, $notrigger = 0) + { + } + /** + * Get unit from code + * @param string $code code of unit + * @param string $mode 0= id , short_label=Use short label as value, code=use code + * @param string $unit_type weight,size,surface,volume,qty,time... + * @return int|string Return integer <0 if KO, Id of code if OK (or $code if $mode is different from '', 'short_label' or 'code') + */ + public function getUnitFromCode($code, $mode = 'code', $unit_type = '') + { + } + /** + * Unit converter + * @param double $value value to convert + * @param int $fk_unit current unit id of value + * @param int $fk_new_unit the id of unit to convert in + * @return double + */ + public function unitConverter($value, $fk_unit, $fk_new_unit = 0) + { + } + /** + * Get scale of unit factor + * + * @param int $id Id of unit in dictionary + * @return float|int Scale of unit + */ + public function scaleOfUnitPow($id) + { + } + } + //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** + * Class for MyObject + */ + class DefaultValues extends \CommonObject + { + /** + * @var string ID to identify managed object. + */ + public $element = 'defaultvalues'; + /** + * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. + */ + public $table_element = 'default_values'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = ''; + /** + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")' + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), 'type' => array('type' => 'varchar(10)', 'label' => 'Type', 'enabled' => 1, 'visible' => -1, 'position' => 20), 'user_id' => array('type' => 'integer', 'label' => 'Userid', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 25), 'page' => array('type' => 'varchar(255)', 'label' => 'RelativeURL', 'enabled' => 1, 'visible' => -1, 'position' => 30), 'param' => array('type' => 'varchar(255)', 'label' => 'Field', 'enabled' => 1, 'visible' => -1, 'position' => 35), 'value' => array('type' => 'varchar(128)', 'label' => 'Value', 'enabled' => 1, 'visible' => -1, 'position' => 40)); + /** + * @var int ID + */ + public $rowid; + /** + * @var int Entity + */ + public $entity; + /** + * @var string Type + */ + public $type; + /** + * @var int User Id + */ + public $user_id; + /** + * @var string Page + */ + public $page; + /** + * @var string Param + */ + public $param; + /** + * @var string Value + */ + public $value; + // END MODULEBUILDER PROPERTIES + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Clone an object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @return mixed New object created, <0 if KO + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id) + { + } + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset Offset + * @param string|array $filter Filter as an Universal Search string or Array (array use is deprecated) + * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')' + * @param string $filtermode No more used + * @return array|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimen() + { + } + } + /** + * Class for handling Diaspora API interactions + */ + class DiasporaHandler + { + /** + * @var string Error message + */ + public $error = ''; + /** + * Fetch Social Network API to retrieve posts. + * + * @param string $urlAPI URL of the Diaspora API. + * @param int $maxNb Maximum number of posts to retrieve (default is 5). + * @param int $cacheDelay Number of seconds to use cached data (0 to disable caching). + * @param string $cacheDir Directory to store cached data. + * @param array $authParams Authentication parameters including login URL, username, and password. + * @return bool Status code: False if error, true if success. + */ + public function fetch($urlAPI, $maxNb = 5, $cacheDelay = 60, $cacheDir = '', $authParams = []) + { + } + /** + * Normalize data of retrieved posts. + * + * @param array $postData Data of a single post. + * @return array Normalized post data. + */ + public function normalizeData($postData) + { + } + /** + * Get the list of retrieved posts. + * + * @return array List of posts. + */ + public function getPosts() + { + } + } + /** + * Class to manage absolute discounts + */ + class DiscountAbsolute extends \CommonObject + { + /** + * @var int Thirdparty ID + * @deprecated Use socid instead. + */ + public $fk_soc; + /** + * @var int Thirdparty ID + */ + public $socid; + /** + * @var int<0,1> + */ + public $discount_type; + // 0 => customer discount, 1 => supplier discount + public $total_ht; + public $total_tva; + public $total_ttc; + public $amount_ht; + // deprecated + public $amount_tva; + // deprecated + public $amount_ttc; + // deprecated + public $multicurrency_total_ht; + public $multicurrency_total_tva; + public $multicurrency_total_ttc; + public $multicurrency_amount_ht; + // deprecated + public $multicurrency_amount_tva; + // deprecated + public $multicurrency_amount_ttc; + // deprecated + /** + * @var double + */ + public $multicurrency_subprice; + /** + * @var int + */ + public $fk_invoice_supplier; + /** + * @var int + */ + public $fk_invoice_supplier_line; + // Vat rate + public $tva_tx; + public $vat_src_code; + /** + * @var int User ID Id utilisateur qui accorde la remise + */ + public $fk_user; + /** + * @var string description + */ + public $description; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + /** + * @var int ID invoice line when a discount is used into an invoice line (for absolute discounts) + */ + public $fk_facture_line; + /** + * @var int ID invoice when a discount line is used into an invoice (for credit note) + */ + public $fk_facture; + /** + * @var int ID credit note or deposit used to create the discount + */ + public $fk_facture_source; + public $ref_facture_source; + // Ref credit note or deposit used to create the discount + public $type_facture_source; + public $fk_invoice_supplier_source; + public $ref_invoice_supplier_source; + // Ref credit note or deposit used to create the discount + public $type_invoice_supplier_source; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Load object from database into memory + * + * @param int $rowid id discount to load + * @param int $fk_facture_source fk_facture_source + * @param int $fk_invoice_supplier_source fk_invoice_supplier_source + * @return int<-1,1> Return integer <0 if KO, =0 if not found, >0 if OK + */ + public function fetch($rowid, $fk_facture_source = 0, $fk_invoice_supplier_source = 0) + { + } + /** + * Create a discount into database + * + * @param User $user User that create + * @return int<-1,1> Return integer <0 if KO, >0 if OK + */ + public function create($user) + { + } + /** + * Delete object in database. If fk_facture_source is defined, we delete all family with same fk_facture_source. If not, only with id is removed + * + * @param User $user Object of user asking to delete + * @return int<-2,1> Return integer <0 if KO, >0 if OK + */ + public function delete($user) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Link the discount to a particular invoice line or a particular invoice. + * When discount is a global discount used as an invoice line, we link using rowidline. + * When discount is from a credit note used to reduce payment of an invoice, we link using rowidinvoice + * + * @param int $rowidline Invoice line id (To use discount into invoice lines) + * @param int $rowidinvoice Invoice id (To use discount as a credit note to reduce payment of invoice) + * @param int $notrigger 0 = launch triggers after, 1 = disable triggers + * @return int<-3,1> Return integer <0 if KO, >0 if OK + */ + public function link_to_invoice($rowidline, $rowidinvoice, $notrigger = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Link the discount to a particular invoice line or a particular invoice. + * Do not call this if discount is linked to a reconcialiated invoice + * + * @param int $notrigger 0 = launch triggers after, 1 = disable triggers + * @return int<-3,1> Return integer <0 if KO, >0 if OK + */ + public function unlink_invoice($notrigger = 0) + { + } + /** + * Return amount (with tax) of discounts currently available for a company, user or other criteria + * + * @param ?Societe $company Object third party for filter + * @param ?User $user Filtre sur un user auteur des remises + * @param string $filter Filter other. Warning: Do not use a user input value here. + * @param int|float $maxvalue Filter on max value for discount + * @param int<0,1> $discount_type 0 => customer discount, 1 => supplier discount + * @param int<0,1> $multicurrency Return multicurrency_amount instead of amount + * @return int<-1,-1>|float Return integer <0 if KO, amount otherwise + */ + public function getAvailableDiscounts($company = \null, $user = \null, $filter = '', $maxvalue = 0, $discount_type = 0, $multicurrency = 0) + { + } + /** + * Return amount (with tax) of all deposits invoices used by invoice as a payment. + * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS or FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended). + * + * @param CommonInvoice $invoice Object invoice (customer of supplier) + * @param int<-1,1> $multicurrency 1=Return multicurrency_amount instead of amount. TODO Add a mode multicurrency = -1 to return array with amount + multicurrency amount + * @return int<-1,-1>|float Return integer <0 if KO, Sum of credit notes and deposits amount otherwise + */ + public function getSumDepositsUsed($invoice, $multicurrency = 0) + { + } + /** + * Return amount (with tax) of all credit notes invoices + excess received used by invoice as a payment + * + * @param CommonInvoice $invoice Object invoice + * @param int<-1,1> $multicurrency 1=Return multicurrency_amount instead of amount. TODO Add a mode multicurrency = -1 to return array with amount + multicurrency amount + * @return int Return integer <0 if KO, Sum of credit notes and excess received amount otherwise + */ + public function getSumCreditNotesUsed($invoice, $multicurrency = 0) + { + } + /** + * Return amount (with tax) of all converted amount for this credit note + * + * @param CommonInvoice $invoice Object invoice + * @param int<-1,1> $multicurrency Return multicurrency_amount instead of amount. TODO Add a mode multicurrency = -1 to return array with amount + multicurrency amount + * @return int Return integer <0 if KO, Sum of credit notes and deposits amount otherwise + */ + public function getSumFromThisCreditNotesNotUsed($invoice, $multicurrency = 0) + { + } + /** + * Return clickable ref of object (with picto or not) + * + * @param int<0,1> $withpicto 0=No picto, 1=Include picto into link, 2=Picto only + * @param string $option Where to link to ('invoice' or 'discount') + * @return string String with URL + */ + public function getNomUrl($withpicto, $option = 'invoice') + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int<0,1> + */ + public function initAsSpecimen() + { + } + } + /* Copyright (C) 2006-2008 Laurent Destailleur + * Copyright (C) 2021 Gaëtan MAISON + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * + * 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 . + * or see https://www.gnu.org/ + */ + /** + * \file htdocs/core/class/doleditor.class.php + * \brief Class to manage a WYSIWYG editor + */ + /** + * Class to manage a WYSIWYG editor. + * Usage: $doleditor=new DolEditor('body',$message,320,'toolbar_mailing'); + * $doleditor->Create(); + */ + class DolEditor + { + public $tool; + // Store the selected tool + // If using fckeditor + public $editor; + // If not using fckeditor + public $content; + public $htmlname; + public $toolbarname; + public $toolbarstartexpanded; + public $rows; + public $cols; + public $height; + public $width; + public $uselocalbrowser; + public $readonly; + public $posx; + public $posy; + /** + * Create an object to build an HTML area to edit a large string content + * + * @param string $htmlname HTML name of WYSIWYG field + * @param string $content Content of WYSIWYG field + * @param int|string $width Width in pixel of edit area (auto by default) + * @param int $height Height in pixel of edit area (200px by default) + * @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]'=the less featured, 'dolibarr_mailings[_encoded]', 'dolibarr_readonly'). + * @param string $toolbarlocation Deprecated. Not used + * @param boolean $toolbarstartexpanded Bar is visible or not at start + * @param boolean|int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. + * @param boolean|int|string $okforextendededitor 1 or True=Allow usage of extended editor tool if qualified (like ckeditor). If 'textarea', force use of simple textarea. If 'ace', force use of Ace. + * Warning: If you use 'ace', don't forget to also include ace.js in page header. Also, the button "save" must have class="buttonforacesave". + * @param int $rows Size of rows for textarea tool + * @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%') + * @param int $readonly 0=Read/Edit, 1=Read only + * @param array $poscursor Array for initial cursor position array('x'=>x, 'y'=>y). + * array('find'=> 'word') can be used to go to line were the word has been found + */ + public function __construct($htmlname, $content, $width = '', $height = 200, $toolbarname = 'Basic', $toolbarlocation = 'In', $toolbarstartexpanded = \false, $uselocalbrowser = 1, $okforextendededitor = \true, $rows = 0, $cols = '', $readonly = 0, $poscursor = array()) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Output edit area inside the HTML stream. + * Output depends on this->tool (fckeditor, ckeditor, textarea, ...) + * + * @param int $noprint 1=Return HTML string instead of printing it to output + * @param string $morejs Add more js. For example: ".on( \'saveSnapshot\', function(e) { alert(\'ee\'); });". Used by CKEditor only. + * @param boolean $disallowAnyContent Disallow to use any content. true=restrict to a predefined list of allowed elements. Used by CKEditor only. + * @param string $titlecontent Show title content before editor area. Used by ACE editor only. + * @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', 'json', ...) + * @param string $moreparam Add extra tags to the textarea + * @param string $morecss Add extra css to the textarea + * @return void|string + */ + public function Create($noprint = 0, $morejs = '', $disallowAnyContent = \true, $titlecontent = '', $option = '', $moreparam = '', $morecss = '') + { + } + } + /* Copyright (C) 2010 Regis Houssin + * + * 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 . + */ + /** + * \file htdocs/core/class/dolexception.class.php + * \ingroup core + * \brief File of class for exceptions + */ + /** + * Class to manage exceptions + */ + class DolException extends \Exception + { + /** + * Constructor + */ + public function __construct() + { + } + } + /* Copyright (C) 2009-2012 Laurent Destailleur + * Copyright (C) 2024 Frédéric France + * + * 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 . + * or see https://www.gnu.org/ + */ + /** + * \file htdocs/core/class/dolgeoip.class.php + * \ingroup geoip + * \brief File of class to manage module geoip + */ + /** + * \class DolGeoIP + * \brief Class to manage GeoIP conversion + * Usage: + * $geoip=new GeoIP('country',$datfile); + * $geoip->getCountryCodeFromIP($ip); + * $geoip->close(); + */ + class DolGeoIP + { + /** + * @var GeoIp2\Database\Reader|string + */ + public $gi; + /** + * @var string + */ + public $error; + /** + * @var string + */ + public $errorlabel; + /** + * Constructor + * + * @param string $type 'country' or 'city' + * @param string $datfile Data file + */ + public function __construct($type, $datfile) + { + } + /** + * Return in lower case the country code from an ip + * + * @param string $ip IP to scan + * @return string Country code (two letters) + */ + public function getCountryCodeFromIP($ip) + { + } + /** + * Return in lower case the country code from a host name + * + * @param string $name FQN of host (example: myserver.xyz.com) + * @return string Country code (two letters) + */ + public function getCountryCodeFromName($name) + { + } + /** + * Return version of data file + * + * @return string Version of datafile + */ + public function getVersion() + { + } + /** + * Close geoip object + * + * @return void + */ + public function close() + { + } + } + /** + * Class to manage Geo processing + * Usage: $dolgeophp=new DolGeoPHP($db); + */ + class DolGeoPHP + { + /** + * @var DoliDB $db Database handler + */ + public $db; + /** + * Create an object to build an HTML area to edit a large string content + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Return data from a value + * + * @param string $value Value + * @return array Centroid + */ + public function parseGeoString($value) + { + } + /** + * Return a string with x and y + * + * @param mixed $value Value + * @return string X space Y + */ + public function getXYString($value) + { + } + /** + * Return a string with x and y + * + * @param mixed $value Value + * @return string Class : num points + */ + public function getPointString($value) + { + } + /** + * Return wkt + * + * @param string $geojson A json string + * @return mixed Value key + */ + public function getWkt($geojson) + { + } + } + /* Copyright (c) 2003-2006 Rodolphe Quiedeville + * Copyright (c) 2004-2015 Laurent Destailleur + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/core/class/dolgraph.class.php + * \ingroup core + * \brief File for class to generate graph + */ + /** + * Class to build graphs. + * Usage is: + * $dolgraph=new DolGraph(); + * $dolgraph->SetTitle($langs->transnoentities('MyTitle').'
'.$langs->transnoentities('MyTitlePercent').'%'); + * $dolgraph->SetMaxValue(50); + * $dolgraph->SetData($data); + * $dolgraph->setShowLegend(2); + * $dolgraph->setShowPercent(1); + * $dolgraph->SetType(array('pie')); + * $dolgraph->setHeight('200'); + * $dolgraph->draw('idofgraph'); + * print $dolgraph->show($total?0:1); + */ + class DolGraph + { + public $type = array(); + // Array with type of each series. Example: array('bars', 'horizontalbars', 'lines', 'pies', 'piesemicircle', 'polar'...) + public $mode = 'side'; + // Graphic library to use (jflot, chart, artichow) + //! Array of data + public $data; + // Data of graph: array(array('abs1',valA1,valB1), array('abs2',valA2,valB2), ...) + public $title; + // Title of graph + public $cssprefix = ''; + // To add into css styles + /** + * @var int|string Width of graph. It can be a numeric for pixels or a string like '100%' or "100px' + */ + public $width = 380; + /** + * @var int|string Height of graph. It can be a numeric for pixels or a string like '100%' or "100px' + */ + public $height = 200; + public $MaxValue = 0; + public $MinValue = 0; + public $SetShading = 0; + public $horizTickIncrement = -1; + public $SetNumXTicks = -1; + public $labelInterval = -1; + public $YLabel; + public $hideXGrid = \false; + public $hideXValues = \false; + public $hideYGrid = \false; + public $Legend = array(); + public $LegendWidthMin = 0; + public $showlegend = 1; + public $showpointvalue = 1; + public $showpercent = 0; + public $combine = 0; + // 0.05 if you want to combine records < 5% into "other" + public $graph; + // Object Graph (Artichow, Phplot...) + /** + * @var boolean Mirrors graph values + */ + public $mirrorGraphValues = \false; + public $tooltipsTitles = \null; + public $tooltipsLabels = \null; + /** + * @var string Error code (or message) + */ + public $error = ''; + public $bordercolor; + // array(R,G,B) + public $bgcolor; + // array(R,G,B) + public $bgcolorgrid = array(255, 255, 255); + // array(R,G,B) + public $datacolor; + // array(array(R,G,B),...) + public $borderwidth = 1; + public $borderskip = 'start'; + // To store string to output graph into HTML page + /** + * Constructor + * + * @param string $library 'auto' (default) + */ + public function __construct($library = 'auto') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 + * + * @param float $xi Xi + * @return boolean True + */ + public function SetHorizTickIncrement($xi) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 + * + * @param float $xt Xt + * @return boolean True + */ + public function SetNumXTicks($xt) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set label interval to reduce number of labels + * + * @param float $x Label interval + * @return boolean True + */ + public function SetLabelInterval($x) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Hide X grid + * + * @param boolean $bool XGrid or not + * @return boolean true + */ + public function SetHideXGrid($bool) + { + } + /** + * Hide X Values + * + * @param boolean $bool XValues or not + * @return boolean true + */ + public function setHideXValues($bool) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Hide Y grid + * + * @param boolean $bool YGrid or not + * @return boolean true + */ + public function SetHideYGrid($bool) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set y label + * + * @param string $label Y label + * @return void + */ + public function SetYLabel($label) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set width + * + * @param int|string $w Width (Example: 320 or '100%' or '10px') + * @return void + */ + public function SetWidth($w) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set title + * + * @param string $title Title + * @return void + */ + public function SetTitle($title) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set data + * + * @param array $data Data + * @return void + * @see draw_jflot() for syntax of data array + */ + public function SetData($data) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set data color + * + * @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...) or array('#......','#......'...) + * @return void + */ + public function SetDataColor($datacolor) + { + } + /** + * Set border color + * + * @param array $bordercolor Border Color array(array(R,G,B),array(R,G,B)...) or array('#FFFFFF','#......'...) + * @return void + */ + public function setBorderColor($bordercolor) + { + } + /** + * Set border width + * + * @param int $borderwidth Border Width + * @return void + */ + public function setBorderWidth($borderwidth) + { + } + /** + * Set border skip + * + * @param int $borderskip Can be 'start' to skip start border, 'end' to skip end border, 'middle' to skip middle border, + * 'false' to not skip any border, 'true' to skip all border + * @return void + */ + public function setBorderSkip($borderskip) + { + } + /** + * Set tooltips labels of the graph + * + * @param array $tooltipsLabels Tooltips Labels array('...','...'...) + * @return void + */ + public function setTooltipsLabels($tooltipsLabels) + { + } + /** + * Set tooltips titles of the graph + * + * @param array $tooltipsTitles Tooltips Titles array('...','...'...) + * @return void + */ + public function setTooltipsTitles($tooltipsTitles) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set type + * + * @param array $type Array with type for each series. Example: array('type1', 'type2', ...) where type can be: + * 'pie', 'piesemicircle', 'polar', 'lines', 'linesnopoint', 'bars', 'horizontalbars'... + * @return void + */ + public function SetType($type) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set legend + * + * @param array $legend Legend. Example: array('seriename1','seriname2',...) + * @return void + */ + public function SetLegend($legend) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set min width + * + * @param int $legendwidthmin Min width + * @return void + */ + public function SetLegendWidthMin($legendwidthmin) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set max value + * + * @param int $max Max value + * @return void + */ + public function SetMaxValue($max) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Get max value + * + * @return int Max value + */ + public function GetMaxValue() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set min value + * + * @param int $min Min value + * @return void + */ + public function SetMinValue($min) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Get min value + * + * @return int Max value + */ + public function GetMinValue() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set height + * + * @param int|string $h Height int or '90%' or '10px' + * @return void + */ + public function SetHeight($h) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set shading + * + * @param string $s Shading + * @return void + */ + public function SetShading($s) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set shading + * + * @param string $s Shading + * @return void + */ + public function SetCssPrefix($s) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Reset bg color + * + * @return void + */ + public function ResetBgColor() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Reset bgcolorgrid + * + * @return void + */ + public function ResetBgColorGrid() + { + } + /** + * Mirror Values of the graph + * + * @param boolean $mirrorGraphValues Mirror Values if true and doesn't if false + * @return void + */ + public function setMirrorGraphValues($mirrorGraphValues) + { + } + /** + * Is graph ko + * + * @return string Error + */ + public function isGraphKo() + { + } + /** + * Show legend or not + * + * @param int $showlegend 1=Show legend (default), 0=Hide legend, 2=Show legend on right + * @return void + */ + public function setShowLegend($showlegend) + { + } + /** + * Show pointvalue or not + * + * @param int $showpointvalue 1=Show value for each point, as tooltip or inline (default), 0=Hide value, 2=Show values for each series on same point + * @return void + */ + public function setShowPointValue($showpointvalue) + { + } + /** + * Show percent or not + * + * @param int $showpercent 1=Show percent for each point, as tooltip or inline, 0=Hide percent (default) + * @return void + */ + public function setShowPercent($showpercent) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Define background color of complete image + * + * @param array $bg_color array(R,G,B) ou 'onglet' ou 'default' + * @return void + */ + public function SetBgColor($bg_color = array(255, 255, 255)) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Define background color of grid + * + * @param array $bg_colorgrid array(R,G,B) ou 'onglet' ou 'default' + * @return void + */ + public function SetBgColorGrid($bg_colorgrid = array(255, 255, 255)) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Reset data color + * + * @return void + */ + public function ResetDataColor() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Get max value among all values of all series + * + * @return int Max value + */ + public function GetMaxValueInData() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return min value of all values of all series + * + * @return int Min value of all data + */ + public function GetMinValueInData() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return max value of all data + * + * @return int Max value of all data + */ + public function GetCeilMaxValue() + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return min value of all data + * + * @return double Max value of all data + */ + public function GetFloorMinValue() + { + } + /** + * Build a graph into memory using correct library (may also be wrote on disk, depending on library used) + * + * @param string $file Image file name to use to save onto disk (also used as javascript unique id) + * @param string $fileurl Url path to show image if saved onto disk + * @return mixed|boolean + */ + public function draw($file, $fileurl = '') + { + } + /** + * Output HTML string to total value + * + * @return float|int HTML string to total value + */ + public function total() + { + } + /** + * Output HTML string ->stringtoshow to show the graph + * + * @param int|string $shownographyet Show graph to say there is not enough data or the message in $shownographyet if it is a string. + * @return string HTML string to show graph + */ + public function show($shownographyet = 0) + { + } + /** + * getDefaultGraphSizeForStats + * + * @param string $direction 'width' or 'height' + * @param string $defaultsize Value we want as default size + * @return int Value of width or height to use by default + */ + public static function getDefaultGraphSizeForStats($direction, $defaultsize = '') + { + } + } +} +namespace Mike42\Escpos { + /** + * Main class for ESC/POS code generation + */ + class Printer + { + /** + * ASCII null control character + */ + const NUL = "\x00"; + /** + * ASCII linefeed control character + */ + const LF = "\n"; + /** + * ASCII escape control character + */ + const ESC = "\x1b"; + /** + * ASCII form separator control character + */ + const FS = "\x1c"; + /** + * ASCII form feed control character + */ + const FF = "\f"; + /** + * ASCII group separator control character + */ + const GS = "\x1d"; + /** + * ASCII data link escape control character + */ + const DLE = "\x10"; + /** + * ASCII end of transmission control character + */ + const EOT = "\x04"; + /** + * Indicates UPC-A barcode when used with Printer::barcode + */ + const BARCODE_UPCA = 65; + /** + * Indicates UPC-E barcode when used with Printer::barcode + */ + const BARCODE_UPCE = 66; + /** + * Indicates JAN13 barcode when used with Printer::barcode + */ + const BARCODE_JAN13 = 67; + /** + * Indicates JAN8 barcode when used with Printer::barcode + */ + const BARCODE_JAN8 = 68; + /** + * Indicates CODE39 barcode when used with Printer::barcode + */ + const BARCODE_CODE39 = 69; + /** + * Indicates ITF barcode when used with Printer::barcode + */ + const BARCODE_ITF = 70; + /** + * Indicates CODABAR barcode when used with Printer::barcode + */ + const BARCODE_CODABAR = 71; + /** + * Indicates CODE93 barcode when used with Printer::barcode + */ + const BARCODE_CODE93 = 72; + /** + * Indicates CODE128 barcode when used with Printer::barcode + */ + const BARCODE_CODE128 = 73; + /** + * Indicates that HRI (human-readable interpretation) text should not be + * printed, when used with Printer::setBarcodeTextPosition + */ + const BARCODE_TEXT_NONE = 0; + /** + * Indicates that HRI (human-readable interpretation) text should be printed + * above a barcode, when used with Printer::setBarcodeTextPosition + */ + const BARCODE_TEXT_ABOVE = 1; + /** + * Indicates that HRI (human-readable interpretation) text should be printed + * below a barcode, when used with Printer::setBarcodeTextPosition + */ + const BARCODE_TEXT_BELOW = 2; + /** + * Use the first color (usually black), when used with Printer::setColor + */ + const COLOR_1 = 0; + /** + * Use the second color (usually red or blue), when used with Printer::setColor + */ + const COLOR_2 = 1; + /** + * Make a full cut, when used with Printer::cut + */ + const CUT_FULL = 65; + /** + * Make a partial cut, when used with Printer::cut + */ + const CUT_PARTIAL = 66; + /** + * Use Font A, when used with Printer::setFont + */ + const FONT_A = 0; + /** + * Use Font B, when used with Printer::setFont + */ + const FONT_B = 1; + /** + * Use Font C, when used with Printer::setFont + */ + const FONT_C = 2; + /** + * Use default (high density) image size, when used with Printer::graphics, + * Printer::bitImage or Printer::bitImageColumnFormat + */ + const IMG_DEFAULT = 0; + /** + * Use lower horizontal density for image printing, when used with Printer::graphics, + * Printer::bitImage or Printer::bitImageColumnFormat + */ + const IMG_DOUBLE_WIDTH = 1; + /** + * Use lower vertical density for image printing, when used with Printer::graphics, + * Printer::bitImage or Printer::bitImageColumnFormat + */ + const IMG_DOUBLE_HEIGHT = 2; + /** + * Align text to the left, when used with Printer::setJustification + */ + const JUSTIFY_LEFT = 0; + /** + * Center text, when used with Printer::setJustification + */ + const JUSTIFY_CENTER = 1; + /** + * Align text to the right, when used with Printer::setJustification + */ + const JUSTIFY_RIGHT = 2; + /** + * Use Font A, when used with Printer::selectPrintMode + */ + const MODE_FONT_A = 0; + /** + * Use Font B, when used with Printer::selectPrintMode + */ + const MODE_FONT_B = 1; + /** + * Use text emphasis, when used with Printer::selectPrintMode + */ + const MODE_EMPHASIZED = 8; + /** + * Use double height text, when used with Printer::selectPrintMode + */ + const MODE_DOUBLE_HEIGHT = 16; + /** + * Use double width text, when used with Printer::selectPrintMode + */ + const MODE_DOUBLE_WIDTH = 32; + /** + * Underline text, when used with Printer::selectPrintMode + */ + const MODE_UNDERLINE = 128; + /** + * Indicates standard PDF417 code + */ + const PDF417_STANDARD = 0; + /** + * Indicates truncated PDF417 code + */ + const PDF417_TRUNCATED = 1; + /** + * Indicates error correction level L when used with Printer::qrCode + */ + const QR_ECLEVEL_L = 0; + /** + * Indicates error correction level M when used with Printer::qrCode + */ + const QR_ECLEVEL_M = 1; + /** + * Indicates error correction level Q when used with Printer::qrCode + */ + const QR_ECLEVEL_Q = 2; + /** + * Indicates error correction level H when used with Printer::qrCode + */ + const QR_ECLEVEL_H = 3; + /** + * Indicates QR model 1 when used with Printer::qrCode + */ + const QR_MODEL_1 = 1; + /** + * Indicates QR model 2 when used with Printer::qrCode + */ + const QR_MODEL_2 = 2; + /** + * Indicates micro QR code when used with Printer::qrCode + */ + const QR_MICRO = 3; + /** + * Indicates a request for printer status when used with + * Printer::getPrinterStatus (experimental) + */ + const STATUS_PRINTER = 1; + /** + * Indicates a request for printer offline cause when used with + * Printer::getPrinterStatus (experimental) + */ + const STATUS_OFFLINE_CAUSE = 2; + /** + * Indicates a request for error cause when used with Printer::getPrinterStatus + * (experimental) + */ + const STATUS_ERROR_CAUSE = 3; + /** + * Indicates a request for error cause when used with Printer::getPrinterStatus + * (experimental) + */ + const STATUS_PAPER_ROLL = 4; + /** + * Indicates a request for ink A status when used with Printer::getPrinterStatus + * (experimental) + */ + const STATUS_INK_A = 7; + /** + * Indicates a request for ink B status when used with Printer::getPrinterStatus + * (experimental) + */ + const STATUS_INK_B = 6; + /** + * Indicates a request for peeler status when used with Printer::getPrinterStatus + * (experimental) + */ + const STATUS_PEELER = 8; + /** + * Indicates no underline when used with Printer::setUnderline + */ + const UNDERLINE_NONE = 0; + /** + * Indicates single underline when used with Printer::setUnderline + */ + const UNDERLINE_SINGLE = 1; + /** + * Indicates double underline when used with Printer::setUnderline + */ + const UNDERLINE_DOUBLE = 2; + /** + * @var PrintBuffer|null $buffer + * The printer's output buffer. + */ + protected $buffer; + /** + * @var PrintConnector $connector + * Connector showing how to print to this printer + */ + protected $connector; + /** + * @var CapabilityProfile $profile + * Profile showing supported features for this printer + */ + protected $profile; + /** + * @var int $characterTable + * Current character code table + */ + protected $characterTable; + /** + * Construct a new print object + * + * @param PrintConnector $connector The PrintConnector to send data to. If not set, output is sent to standard output. + * @param CapabilityProfile|null $profile Supported features of this printer. If not set, the "default" CapabilityProfile will be used, which is suitable for Epson printers. + * @throws InvalidArgumentException + */ + public function __construct(\Mike42\Escpos\PrintConnectors\PrintConnector $connector, \Mike42\Escpos\CapabilityProfile $profile = null) + { + } + /** + * Print a barcode. + * + * @param string $content The information to encode. + * @param int $type The barcode standard to output. Supported values are + * `Printer::BARCODE_UPCA`, `Printer::BARCODE_UPCE`, `Printer::BARCODE_JAN13`, + * `Printer::BARCODE_JAN8`, `Printer::BARCODE_CODE39`, `Printer::BARCODE_ITF`, + * `Printer::BARCODE_CODABAR`, `Printer::BARCODE_CODE93`, and `Printer::BARCODE_CODE128`. + * If not specified, `Printer::BARCODE_CODE39` will be used. Note that some + * barcode formats only support specific lengths or sets of characters, and that + * available barcode types vary between printers. + * @throws InvalidArgumentException Where the length or characters used in $content is invalid for the requested barcode format. + */ + public function barcode(string $content, int $type = \Mike42\Escpos\Printer::BARCODE_CODE39) + { + } + /** + * Print an image, using the older "bit image" command. This creates padding on the right of the image, + * if its width is not divisible by 8. + * + * Should only be used if your printer does not support the graphics() command. + * See also bitImageColumnFormat(). + * + * @param EscposImage $img The image to print + * @param int $size Size modifier for the image. Must be either `Printer::IMG_DEFAULT` + * (default), or any combination of the `Printer::IMG_DOUBLE_HEIGHT` and + * `Printer::IMG_DOUBLE_WIDTH` flags. + */ + public function bitImage(\Mike42\Escpos\EscposImage $img, int $size = \Mike42\Escpos\Printer::IMG_DEFAULT) + { + } + /** + * Print an image, using the older "bit image" command in column format. + * + * Should only be used if your printer does not support the graphics() or + * bitImage() commands. + * + * @param EscposImage $img The image to print + * @param int $size Size modifier for the image. Must be either `Printer::IMG_DEFAULT` + * (default), or any combination of the `Printer::IMG_DOUBLE_HEIGHT` and + * `Printer::IMG_DOUBLE_WIDTH` flags. + */ + public function bitImageColumnFormat(\Mike42\Escpos\EscposImage $img, int $size = \Mike42\Escpos\Printer::IMG_DEFAULT) + { + } + /** + * Close the underlying buffer. With some connectors, the + * job will not actually be sent to the printer until this is called. + */ + public function close() + { + } + /** + * Cut the paper. + * + * @param int $mode Cut mode, either Printer::CUT_FULL or Printer::CUT_PARTIAL. If not specified, `Printer::CUT_FULL` will be used. + * @param int $lines Number of lines to feed + */ + public function cut(int $mode = \Mike42\Escpos\Printer::CUT_FULL, int $lines = 3) + { + } + /** + * Print and feed line / Print and feed n lines. + * + * @param int $lines Number of lines to feed + */ + public function feed(int $lines = 1) + { + } + /** + * Some printers require a form feed to release the paper. On most printers, this + * command is only useful in page mode, which is not implemented in this driver. + */ + public function feedForm() + { + } + /** + * Some slip printers require `ESC q` sequence to release the paper. + */ + public function release() + { + } + /** + * Print and reverse feed n lines. + * + * @param int $lines number of lines to feed. If not specified, 1 line will be fed. + */ + public function feedReverse(int $lines = 1) + { + } + /** + * @return int + */ + public function getCharacterTable() + { + } + /** + * @return PrintBuffer + */ + public function getPrintBuffer() + { + } + /** + * @return PrintConnector + */ + public function getPrintConnector() + { + } + /** + * @return CapabilityProfile + */ + public function getPrinterCapabilityProfile() + { + } + /** + * Print an image to the printer. + * + * Size modifiers are: + * - Printer::IMG_DEFAULT (leave image at original size) + * - Printer::IMG_DOUBLE_WIDTH + * - Printer::IMG_DOUBLE_HEIGHT + * + * See the example/ folder for detailed examples. + * + * The functions bitImage() and bitImageColumnFormat() take the same + * parameters, and can be used if your printer doesn't support the newer + * graphics commands. + * + * @param EscposImage $img The image to print. + * @param int $size Size modifier for the image. Must be either `Printer::IMG_DEFAULT` + * (default), or any combination of the `Printer::IMG_DOUBLE_HEIGHT` and + * `Printer::IMG_DOUBLE_WIDTH` flags. + */ + public function graphics(\Mike42\Escpos\EscposImage $img, int $size = \Mike42\Escpos\Printer::IMG_DEFAULT) + { + } + /** + * Initialize printer. This resets formatting back to the defaults. + */ + public function initialize() + { + } + /** + * Print a two-dimensional data code using the PDF417 standard. + * + * @param string $content Text or numbers to store in the code + * @param int $width Width of a module (pixel) in the printed code. + * Default is 3 dots. + * @param int $heightMultiplier Multiplier for height of a module. + * Default is 3 times the width. + * @param int $dataColumnCount Number of data columns to use. 0 (default) + * is to auto-calculate. Smaller numbers will result in a narrower code, + * making larger pixel sizes possible. Larger numbers require smaller pixel sizes. + * @param float $ec Error correction ratio, from 0.01 to 4.00. Default is 0.10 (10%). + * @param int $options Standard code Printer::PDF417_STANDARD with + * start/end bars, or truncated code Printer::PDF417_TRUNCATED with start bars only. + * @throws Exception If this profile indicates that PDF417 code is not supported + */ + public function pdf417Code(string $content, int $width = 3, int $heightMultiplier = 3, int $dataColumnCount = 0, float $ec = 0.1, int $options = \Mike42\Escpos\Printer::PDF417_STANDARD) + { + } + /** + * Generate a pulse, for opening a cash drawer if one is connected. + * The default settings should open an Epson drawer. + * + * @param int $pin 0 or 1, for pin 2 or pin 5 kick-out connector respectively. + * @param int $on_ms pulse ON time, in milliseconds. + * @param int $off_ms pulse OFF time, in milliseconds. + */ + public function pulse(int $pin = 0, int $on_ms = 120, int $off_ms = 240) + { + } + /** + * Print the given data as a QR code on the printer. + * + * @param string $content The content of the code. Numeric data will be more efficiently compacted. + * @param int $ec Error-correction level to use. One of Printer::QR_ECLEVEL_L (default), Printer::QR_ECLEVEL_M, Printer::QR_ECLEVEL_Q or Printer::QR_ECLEVEL_H. Higher error correction results in a less compact code. + * @param int $size Pixel size to use. Must be 1-16 (default 3) + * @param int $model QR code model to use. Must be one of Printer::QR_MODEL_1, Printer::QR_MODEL_2 (default) or Printer::QR_MICRO (not supported by all printers). + */ + public function qrCode(string $content, int $ec = \Mike42\Escpos\Printer::QR_ECLEVEL_L, int $size = 3, int $model = \Mike42\Escpos\Printer::QR_MODEL_2) + { + } + /** + * Switch character table (code page) manually. Used in conjunction with textRaw() to + * print special characters which can't be encoded automatically. + * + * @param int $table The table to select. Available code tables are model-specific. + */ + public function selectCharacterTable(int $table = 0) + { + } + /** + * Select print mode(s). + * + * Several MODE_* constants can be OR'd together passed to this function's `$mode` argument. The valid modes are: + * - Printer::MODE_FONT_A + * - Printer::MODE_FONT_B + * - Printer::MODE_EMPHASIZED + * - Printer::MODE_DOUBLE_HEIGHT + * - Printer::MODE_DOUBLE_WIDTH + * - Printer::MODE_UNDERLINE + * + * @param int $mode The mode to use. Default is Printer::MODE_FONT_A, with no special formatting. This has a similar effect to running initialize(). + */ + public function selectPrintMode(int $mode = \Mike42\Escpos\Printer::MODE_FONT_A) + { + } + /** + * Select user-defined character set. + * + * @param bool $on True to enable user-defined character set, false to use built-in characters sets. + */ + public function selectUserDefinedCharacterSet($on = true) + { + } + /** + * Set barcode height. + * + * @param int $height Height in dots. If not specified, 8 will be used. + */ + public function setBarcodeHeight(int $height = 8) + { + } + /** + * Set barcode bar width. + * + * @param int $width Bar width in dots. If not specified, 3 will be used. + * Values above 6 appear to have no effect. + */ + public function setBarcodeWidth(int $width = 3) + { + } + /** + * Set the position for the Human Readable Interpretation (HRI) of barcode characters. + * + * @param int $position. Use Printer::BARCODE_TEXT_NONE to hide the text (default), + * or any combination of Printer::BARCODE_TEXT_ABOVE and Printer::BARCODE_TEXT_BELOW + * flags to display the text. + */ + public function setBarcodeTextPosition(int $position = \Mike42\Escpos\Printer::BARCODE_TEXT_NONE) + { + } + /** + * Turn double-strike mode on/off. + * + * @param boolean $on true for double strike, false for no double strike + */ + public function setDoubleStrike(bool $on = true) + { + } + /** + * Select print color on printers that support multiple colors. + * + * @param int $color Color to use. Must be either Printer::COLOR_1 (default), or Printer::COLOR_2. + */ + public function setColor(int $color = \Mike42\Escpos\Printer::COLOR_1) + { + } + /** + * Turn emphasized mode on/off. + * + * @param boolean $on true for emphasis, false for no emphasis + */ + public function setEmphasis(bool $on = true) + { + } + /** + * Select font. Most printers have two fonts (Fonts A and B), and some have a third (Font C). + * + * @param int $font The font to use. Must be either Printer::FONT_A, Printer::FONT_B, or Printer::FONT_C. + */ + public function setFont(int $font = \Mike42\Escpos\Printer::FONT_A) + { + } + /** + * Select justification. + * + * @param int $justification One of Printer::JUSTIFY_LEFT, Printer::JUSTIFY_CENTER, or Printer::JUSTIFY_RIGHT. + */ + public function setJustification(int $justification = \Mike42\Escpos\Printer::JUSTIFY_LEFT) + { + } + /** + * Set the height of the line. + * + * Some printers will allow you to overlap lines with a smaller line feed. + * + * @param int|null $height The height of each line, in dots. If not set, the printer + * will reset to its default line spacing. + */ + public function setLineSpacing(int $height = null) + { + } + /** + * Set print area left margin. Reset to default with Printer::initialize() + * + * @param int $margin The left margin to set on to the print area, in dots. + */ + public function setPrintLeftMargin(int $margin = 0) + { + } + /** + * Set print area width. This can be used to add a right margin to the print area. + * Reset to default with Printer::initialize() + * + * @param int $width The width of the page print area, in dots. + */ + public function setPrintWidth(int $width = 512) + { + } + /** + * Attach a different print buffer to the printer. Buffers are responsible for handling text output to the printer. + * + * @param PrintBuffer $buffer The buffer to use. + * @throws InvalidArgumentException Where the buffer is already attached to a different printer. + */ + public function setPrintBuffer(\Mike42\Escpos\PrintBuffers\PrintBuffer $buffer) + { + } + /** + * Set black/white reverse mode on or off. In this mode, text is printed white on a black background. + * + * @param boolean $on True to enable, false to disable. + */ + public function setReverseColors(bool $on = true) + { + } + /** + * Set the size of text, as a multiple of the normal size. + * + * @param int $widthMultiplier Multiple of the regular height to use (range 1 - 8) + * @param int $heightMultiplier Multiple of the regular height to use (range 1 - 8) + */ + public function setTextSize(int $widthMultiplier, int $heightMultiplier) + { + } + /** + * Set underline for printed text. + * + * @param int $underline Either true/false, or one of Printer::UNDERLINE_NONE, Printer::UNDERLINE_SINGLE or Printer::UNDERLINE_DOUBLE. Defaults to Printer::UNDERLINE_SINGLE. + */ + public function setUnderline(int $underline = \Mike42\Escpos\Printer::UNDERLINE_SINGLE) + { + } + /** + * Print each line upside-down (180 degrees rotated). + * + * @param boolean $on True to enable, false to disable. + */ + public function setUpsideDown(bool $on = true) + { + } + /** + * Add text to the buffer. + * + * Text should either be followed by a line-break, or feed() should be called + * after this to clear the print buffer. + * + * @param string $str Text to print, as UTF-8 + */ + public function text(string $str) + { + } + /** + * Add Chinese text to the buffer. This is a specific workaround for Zijang printers- + * The printer will be switched to a two-byte mode and sent GBK-encoded text. + * + * Support for this will be merged into a print buffer. + * + * @param string $str Text to print, as UTF-8 + */ + public function textChinese(string $str = "") + { + } + /** + * Add text to the buffer without attempting to interpret chararacter codes. + * + * Text should either be followed by a line-break, or feed() should be called + * after this to clear the print buffer. + * + * @param string $str Text to print + */ + public function textRaw(string $str = "") + { + } + /** + * Wrapper for GS ( k, to calculate and send correct data length. + * + * @param string $fn Function to use + * @param string $cn Output code type. Affects available data + * @param string $data Data to send. + * @param string $m Modifier/variant for function. Often '0' where used. + * @throws InvalidArgumentException Where the input lengths are bad. + */ + protected function wrapperSend2dCodeData(string $fn, string $cn, string $data = '', string $m = '') + { + } + /** + * Wrapper for GS ( L, to calculate and send correct data length. + * + * @param string $m Modifier/variant for function. Usually '0'. + * @param string $fn Function number to use, as character. + * @param string $data Data to send. + * @throws InvalidArgumentException Where the input lengths are bad. + */ + protected function wrapperSendGraphicsData(string $m, string $fn, string $data = '') + { + } + /** + * Convert widths and heights to characters. Used before sending graphics to set the size. + * + * @param array $inputs + * @param boolean $long True to use 4 bytes, false to use 2 + * @return string + */ + protected static function dataHeader(array $inputs, bool $long = true) + { + } + /** + * Generate two characters for a number: In lower and higher parts, or more parts as needed. + * + * @param int $input Input number + * @param int $length The number of bytes to output (1 - 4). + */ + protected static function intLowHigh(int $input, int $length) + { + } + /** + * Throw an exception if the argument given is not a boolean + * + * @param boolean $test the input to test + * @param string $source the name of the function calling this + */ + protected static function validateBoolean(bool $test, string $source) + { + } + /** + * Throw an exception if the argument given is not a float within the specified range + * + * @param float $test the input to test + * @param float $min the minimum allowable value (inclusive) + * @param float $max the maximum allowable value (inclusive) + * @param string $source the name of the function calling this + * @param string $argument the name of the invalid parameter + */ + protected static function validateFloat(float $test, float $min, float $max, string $source, string $argument = "Argument") + { + } + /** + * Throw an exception if the argument given is not an integer within the specified range + * + * @param int $test the input to test + * @param int $min the minimum allowable value (inclusive) + * @param int $max the maximum allowable value (inclusive) + * @param string $source the name of the function calling this + * @param string $argument the name of the invalid parameter + */ + protected static function validateInteger(int $test, int $min, int $max, string $source, string $argument = "Argument") + { + } + /** + * Throw an exception if the argument given is not an integer within one of the specified ranges + * + * @param int $test the input to test + * @param array $ranges array of two-item min/max ranges. + * @param string $source the name of the function calling this + * @param string $source the name of the function calling this + * @param string $argument the name of the invalid parameter + */ + protected static function validateIntegerMulti(int $test, array $ranges, string $source, string $argument = "Argument") + { + } + /** + * Throw an exception if the argument doesn't match the given regex. + * + * @param string $test the input to test + * @param string $source the name of the function calling this + * @param string $regex valid values for this attribute, as a regex + * @param string $argument the name of the parameter being validated + * @throws InvalidArgumentException Where the argument is not valid + */ + protected static function validateStringRegex(string $test, string $source, string $regex, string $argument = "Argument") + { + } + } +} +namespace { + /** + * Class to manage Receipt Printers + */ + class dolReceiptPrinter extends \Mike42\Escpos\Printer + { + const CONNECTOR_DUMMY = 1; + const CONNECTOR_FILE_PRINT = 2; + const CONNECTOR_NETWORK_PRINT = 3; + const CONNECTOR_WINDOWS_PRINT = 4; + const CONNECTOR_CUPS_PRINT = 5; + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string[] array of tags + */ + public $tags; + /** + * @var \Mike42\Escpos\Printer + */ + public $printer; + public $template; + /** + * Number of order printer + * @var int + */ + public $orderprinter; + /** + * Array with list of printers + * @var array List of printers + */ + public $listprinters; + /** + * Array with list of printer templates + * @var array List of printer templates + */ + public $listprinterstemplates; + /** + * @var string + */ + public $profileresprint; + /** + * @var string + */ + public $resprint; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + /** + * Constructor + * + * @param DoliDB $db database + */ + public function __construct($db) + { + } + /** + * List printers into the array ->listprinters + * + * @return int 0 if OK; >0 if KO + */ + public function listPrinters() + { + } + /** + * List printers templates + * + * @return int 0 if OK; >0 if KO + */ + public function listPrintersTemplates() + { + } + /** + * Form to Select type printer + * + * @param string $selected Id printer type pre-selected + * @param string $htmlname select html name + * @return int 0 if OK; >0 if KO + */ + public function selectTypePrinter($selected = '', $htmlname = 'printertypeid') + { + } + /** + * Form to Select Profile printer + * + * @param string $selected Id printer profile pre-selected + * @param string $htmlname select html name + * @return int 0 if OK; >0 if KO + */ + public function selectProfilePrinter($selected = '', $htmlname = 'printerprofileid') + { + } + /** + * Function to Add a printer in db + * + * @param string $name Printer name + * @param int $type Printer type + * @param int $profile Printer profile + * @param string $parameter Printer parameter + * @return int 0 if OK; >0 if KO + */ + public function addPrinter($name, $type, $profile, $parameter) + { + } + /** + * Function to Update a printer in db + * + * @param string $name Printer name + * @param int $type Printer type + * @param int $profile Printer profile + * @param string $parameter Printer parameter + * @param int $printerid Printer id + * @return int 0 if OK; >0 if KO + */ + public function updatePrinter($name, $type, $profile, $parameter, $printerid) + { + } + /** + * Function to Delete a printer from db + * + * @param int $printerid Printer id + * @return int 0 if OK; >0 if KO + */ + public function deletePrinter($printerid) + { + } + /** + * Function to add a printer template in db + * + * @param string $name Template name + * @param int $template Template + * @return int 0 if OK; >0 if KO + */ + public function addTemplate($name, $template) + { + } + /** + * Function to delete a printer template in db + * + * @param int $templateid Template ID + * @return int 0 if OK; >0 if KO + */ + public function deleteTemplate($templateid) + { + } + /** + * Function to Update a printer template in db + * + * @param string $name Template name + * @param int $template Template + * @param int $templateid Template id + * @return int 0 if OK; >0 if KO + */ + public function updateTemplate($name, $template, $templateid) + { + } + /** + * Function to Send Test page to Printer + * + * @param int $printerid Printer id + * @param int $addimgandbarcode Add image and barcode into the test + * @return int 0 if OK; >0 if KO + */ + public function sendTestToPrinter($printerid, $addimgandbarcode = 0) + { + } + /** + * Function to Print Receipt Ticket + * + * @param Facture|Commande $object Order or invoice object + * @param int $templateid Template id + * @param int $printerid Printer id + * @return int 0 if OK; >0 if KO + */ + public function sendToPrinter($object, $templateid, $printerid) + { + } + /** + * Function to load Template into $this->template + * + * @param int $templateid Template id + * @return int 0 if OK; >0 if KO + */ + public function loadTemplate($templateid) + { + } + /** + * Function Init Printer into $this->printer + * + * @param int $printerid Printer id + * @return void|int 0 if OK; >0 if KO + */ + public function initPrinter($printerid) + { + } + } + /** + * Class for EmailSenderProfile + */ + class EmailSenderProfile extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'emailsenderprofile'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'c_email_senderprofile'; + /** + * @var string String with name of icon for emailsenderprofile + */ + public $picto = 'emailsenderprofile'; + public $fk_user_creat; + const STATUS_DISABLED = 0; + const STATUS_ENABLED = 1; + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id'), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'visible' => -1, 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'index' => 1), 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'visible' => 1, 'enabled' => 1, 'position' => 30, 'notnull' => 1), 'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'visible' => 1, 'enabled' => 1, 'position' => 40, 'notnull' => -1), 'private' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'User', 'visible' => 1, 'enabled' => 1, 'position' => 50, 'default' => '0', 'notnull' => 1), 'signature' => array('type' => 'html', 'label' => 'Signature', 'visible' => 3, 'enabled' => 1, 'position' => 400, 'notnull' => -1, 'index' => 1), 'position' => array('type' => 'integer', 'label' => 'Position', 'visible' => 1, 'enabled' => 1, 'position' => 405, 'notnull' => -1, 'index' => 1), 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'visible' => -1, 'enabled' => 1, 'position' => 500, 'notnull' => 1), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'visible' => -1, 'enabled' => 1, 'position' => 500, 'notnull' => 1), 'active' => array('type' => 'integer', 'label' => 'Status', 'visible' => 1, 'enabled' => 1, 'default' => 1, 'position' => 1000, 'notnull' => 1, 'index' => 1, 'arrayofkeyval' => array(0 => 'Disabled', 1 => 'Enabled'))); + /** + * @var int ID + */ + public $rowid; + /** + * @var int Entity + */ + public $entity; + /** + * @var string Email Sender Profile label + */ + public $label; + public $email; + public $private; + public $signature; + public $position; + public $active; + // END MODULEBUILDER PROPERTIES + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK + */ + public function create(\User $user, $notrigger = 0) + { + } + /** + * Clone and object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @return mixed New object created, <0 if KO + */ + public function createFromClone(\User $user, $fromid) + { + } + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = \null) + { + } + /** + * Load object lines in memory from the database + * + * @return int Return integer <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + } + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function update(\User $user, $notrigger = 0) + { + } + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete(\User $user, $notrigger = 0) + { + } + /** + * Return a link to the object card (with optionally the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @return string String with URL + */ + public function getNomUrl($withpicto = 0) + { + } + /** + * Return the label of a given status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public static function LibStatut($status, $mode = 0) + { + } + /** + * Charge les information d'ordre info dans l'objet commande + * + * @param int $id Id of order + * @return void + */ + public function info($id) + { + } + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return int + */ + public function initAsSpecimen() + { + } + } + /* ================================================================================ + * + * EvalMath - PHP Class to safely evaluate math expressions + * Copyright (C) 2005 Miles Kaufmann + * + * ================================================================================ + * + * NAME + * EvalMath - safely evaluate math expressions + * + * SYNOPSIS + * include('evalmath.class.php'); + * $m = new EvalMath; + * // basic evaluation: + * $result = $m->evaluate('2+2'); + * // supports: order of operation; parentheses; negation; built-in functions + * $result = $m->evaluate('-8(5/2)^2*(1-sqrt(4))-8'); + * // create your own variables + * $m->evaluate('a = e^(ln(pi))'); + * // or functions + * $m->evaluate('f(x,y) = x^2 + y^2 - 2x*y + 1'); + * // and then use them + * $result = $m->evaluate('3*f(42,a)'); + * + * DESCRIPTION + * Use the EvalMath class when you want to evaluate mathematical expressions + * from untrusted sources. You can define your own variables and functions, + * which are stored in the object. Try it, it's fun! + * + * METHODS + * $m->evaluate($expr) + * Evaluates the expression and returns the result. If an error occurs, + * prints a warning and returns false. If $expr is a function assignment, + * returns true on success. + * + * $m->e($expr) + * A synonym for $m->evaluate(). + * + * $m->vars() + * Returns an associative array of all user-defined variables and values. + * + * $m->funcs() + * Returns an array of all user-defined functions. + * + * PARAMETERS + * $m->suppress_errors + * Set to true to turn off warnings when evaluating expressions + * + * $m->last_error + * If the last evaluation failed, contains a string describing the error. + * (Useful when suppress_errors is on). + * + * $m->last_error_code + * If the last evaluation failed, 2 element array with numeric code and extra info + * + * AUTHOR INFORMATION + * Copyright 2005, Miles Kaufmann. + * + * LICENSE + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1 Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + /** + * \file core/class/evalmath.class.php + * \ingroup core + * \brief This file for Math evaluation + */ + /** + * Class EvalMath + */ + class EvalMath + { + public $suppress_errors = \false; + public $last_error = \null; + public $last_error_code = \null; + public $v = array('e' => 2.71, 'pi' => 3.14159); + // variables (and constants) + public $f = array(); + // user-defined functions + public $vb = array('e', 'pi'); + // constants + public $fb = array( + // built-in functions + 'sin', + 'sinh', + 'arcsin', + 'asin', + 'arcsinh', + 'asinh', + 'cos', + 'cosh', + 'arccos', + 'acos', + 'arccosh', + 'acosh', + 'tan', + 'tanh', + 'arctan', + 'atan', + 'arctanh', + 'atanh', + 'sqrt', + 'abs', + 'ln', + 'log', + 'intval', + 'ceil', + ); + /** + * Constructor + */ + public function __construct() + { + } + /** + * Evaluate + * + * @param string $expr String + * @return boolean|int|float|NULL|mixed Result + */ + public function e($expr) + { + } + /** + * Evaluate + * + * @param string $expr String + * @return boolean|int|float|NULL|mixed Result + */ + public function evaluate($expr) + { + } + /** + * Function vars + * + * @return array Output + */ + public function vars() + { + } + /** + * trigger an error, but nicely, if need be + * + * @param string $code Code + * @param string $msg Msg + * @param string|null $info String + * @return false + */ + public function trigger($code, $msg, $info = \null) + { + } + } + /** + * Class for internal use + */ + class EvalMathStack + { + /** @var mixed[] */ + public $stack = array(); + /** @var int */ + public $count = 0; + /** + * push + * + * @param string $val Val + * @return void + */ + public function push($val) + { + } + /** + * pop + * + * @return ?mixed Stack element + */ + public function pop() + { + } + /** + * last + * + * @param int $n N + * @return mixed Stack + */ + public function last($n = 1) + { + } + } + /* Copyright (C) 2007-2019 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2023 William Mead + * Copyright (C) 2024 Frédéric France + * + * 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 . + */ + /** + * \file htdocs/core/class/events.class.php + * \ingroup core + * \brief File of class to manage security events. + */ + /** + * Events class + */ + class Events + { + /** + * @var string ID to identify managed object + */ + public $element = 'events'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'events'; + /** + * @var int ID + */ + public $id; + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var int timestamp + */ + public $tms; + /** + * @var string Type + */ + public $type; + /** + * @var int Entity + */ + public $entity; + public $dateevent; + /** + * @var string IP + */ + public $ip; + /** + * @var string User agent + */ + public $user_agent; + /** + * @var string label + */ + public $label; + /** + * @var string description + */ + public $description; + /** + * @var string Prefix session obtained with method dol_getprefix() + */ + public $prefix_session; + /** + * @var string Authentication method used for USER_LOGIN with success + */ + public $authentication_method; + // List of all Audit/Security events supported by triggers + public $eventstolog = array(array('id' => 'USER_LOGIN', 'test' => 1), array('id' => 'USER_LOGIN_FAILED', 'test' => 1), array('id' => 'USER_LOGOUT', 'test' => 1), array('id' => 'USER_CREATE', 'test' => 1), array('id' => 'USER_MODIFY', 'test' => 1), array('id' => 'USER_NEW_PASSWORD', 'test' => 1), array('id' => 'USER_ENABLEDISABLE', 'test' => 1), array('id' => 'USER_DELETE', 'test' => 1), array('id' => 'USERGROUP_CREATE', 'test' => 1), array('id' => 'USERGROUP_MODIFY', 'test' => 1), array('id' => 'USERGROUP_DELETE', 'test' => 1)); + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array('rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'default' => 1, 'index' => 1, 'position' => 20), 'prefix_session' => array('type' => 'varchar(255)', 'label' => 'PrefixSession', 'enabled' => 1, 'visible' => -1, 'notnull' => -1, 'index' => 0, 'position' => 1000), 'user_agent' => array('type' => 'varchar(255)', 'label' => 'UserAgent', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => 0, 'index' => 1, 'position' => 1000)); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Create in database + * + * @param User $user User that create + * @return int Return integer <0 if KO, >0 if OK + */ + public function create($user) + { + } + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=no, 1=yes (no update trigger) + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user = \null, $notrigger = 0) + { + } + /** + * Load object in memory from database + * + * @param int $id Id object + * @param User $user User that load + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id, $user = \null) + { + } + /** + * Delete object in database + * + * @param User $user User that delete + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user) + { + } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return int + */ + public function initAsSpecimen() + { + } + } + /* Copyright (C) 2002-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2009-2012 Laurent Destailleur + * Copyright (C) 2009-2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015-2023 Charlene BENKE + * Copyright (C) 2016 Raphaël Doursenaud + * Copyright (C) 2017 Nicolas ZABOURI + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2022 Antonin MARCHAL + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/core/class/extrafields.class.php + * \ingroup core + * \brief File of class to manage extra fields + */ + /** + * Class to manage standard extra fields + */ + class ExtraFields + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var array,type:array,size:array,default:array,computed:array,unique:array,required:array,param:array,perms:array,list:array,pos:array,totalizable:array,help:array,printable:array,enabled:array,langfile:array,css:array,csslist:array,cssview:array,hidden:array,mandatoryfieldsofotherentities:array,loaded?:int,count:int}> New array to store extrafields definition Note: count set as present to avoid static analysis notices + */ + public $attributes = array(); + /** + * @var array Array with boolean of status of groups + */ + public $expand_display; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Array of Error code (or message) + */ + public $errors = array(); + /** + * @var string DB Error number + */ + public $errno; + /** + * @var array Array of type to label + */ + public static $type2label = array( + 'varchar' => 'String1Line', + 'text' => 'TextLongNLines', + 'html' => 'HtmlText', + 'int' => 'Int', + 'double' => 'Float', + 'date' => 'Date', + 'datetime' => 'DateAndTime', + //'datetimegmt'=>'DateAndTimeUTC', + 'boolean' => 'Boolean', + 'price' => 'ExtrafieldPrice', + 'pricecy' => 'ExtrafieldPriceWithCurrency', + 'phone' => 'ExtrafieldPhone', + 'mail' => 'ExtrafieldMail', + 'url' => 'ExtrafieldUrl', + 'ip' => 'ExtrafieldIP', + 'icon' => 'Icon', + 'password' => 'ExtrafieldPassword', + 'radio' => 'ExtrafieldRadio', + 'select' => 'ExtrafieldSelect', + 'sellist' => 'ExtrafieldSelectList', + 'checkbox' => 'ExtrafieldCheckBox', + 'chkbxlst' => 'ExtrafieldCheckBoxFromList', + 'link' => 'ExtrafieldLink', + 'point' => 'ExtrafieldPointGeo', + 'multipts' => 'ExtrafieldMultiPointGeo', + 'linestrg' => 'ExtrafieldLinestringGeo', + 'polygon' => 'ExtrafieldPolygonGeo', + 'separate' => 'ExtrafieldSeparator', + ); + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Add a new extra field parameter + * + * @param string $attrname Code of attribute + * @param string $label label of attribute + * @param string $type Type of attribute ('boolean','int','varchar','text','html','date','datetime','price', 'pricecy', 'phone','mail','password','url','select','checkbox','separate',...) + * @param int $pos Position of attribute + * @param string $size Size/length definition of attribute ('5', '24,8', ...). For float, it contains 2 numeric separated with a comma. + * @param string $elementtype Element type. Same value than object->table_element (Example 'member', 'product', 'thirdparty', ...) + * @param int $unique Is field unique or not + * @param int $required Is field required or not + * @param string $default_value Defaulted value (In database. use the default_value feature for default value on screen. Example: '', '0', 'null', 'avalue') + * @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @param int $alwayseditable Is attribute always editable regardless of the document status + * @param string $perms Permission to check + * @param string $list Visibility ('0'=never visible, '1'=visible on list+forms, '2'=list only, '3'=form only or 'eval string') + * @param string $help Text with help tooltip + * @param string $computed Computed value + * @param string $entity Entity of extrafields (for multicompany modules) + * @param string $langfile Language file + * @param string $enabled Condition to have the field enabled or not + * @param int $totalizable Is a measure. Must show a total on lists + * @param int $printable Is extrafield displayed on PDF + * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>Css on list, 'cssview'=>...) + * @return int Return integer <=0 if KO, >0 if OK + */ + public function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique = 0, $required = 0, $default_value = '', $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array()) + { + } + /** + * Update an existing extra field parameter + * + * @param string $attrname Code of attribute + * @param string $label label of attribute + * @param string $type Type of attribute ('boolean','int','varchar','text','html','date','datetime','price', 'pricecy', 'phone','mail','password','url','select','checkbox','separate',...) + * @param int $pos Position of attribute + * @param string $size Size/length definition of attribute ('5', '24,8', ...). For float, it contains 2 numeric separated with a comma. + * @param string $elementtype Element type. Same value than object->table_element (Example 'member', 'product', 'thirdparty', ...) + * @param int $unique Is field unique or not + * @param int $required Is field required or not + * @param string $default_value Defaulted value (In database. use the default_value feature for default value on screen. Example: '', '0', 'null', 'avalue') + * @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @param int $alwayseditable Is attribute always editable regardless of the document status + * @param string $perms Permission to check + * @param string $list Visibility ('0'=never visible, '1'=visible on list+forms, '2'=list only, '3'=form only or 'eval string') + * @param string $help Text with help tooltip + * @param string $computed Computed value + * @param string $entity Entity of extrafields (for multicompany modules) + * @param string $langfile Language file + * @param string $enabled Condition to have the field enabled or not + * @param int $totalizable Is a measure. Must show a total on lists + * @param int $printable Is extrafield displayed on PDF + * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>Css on list, 'cssview'=>...) + * @return int Return integer <=0 if KO, >0 if OK + */ + public function updateExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique = 0, $required = 0, $default_value = '', $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array()) + { + } + /** + * Delete an optional attribute + * + * @param string $attrname Code of attribute to delete + * @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...) + * @return int Return integer < 0 if KO, 0 if nothing is done, 1 if OK + */ + public function delete($attrname, $elementtype = '') + { + } + /** + * Modify type of a personalized attribute + * + * @param string $attrname Name of attribute + * @param string $label Label of attribute + * @param string $type Type of attribute ('boolean', 'int', 'varchar', 'text', 'html', 'date', 'datetime','price','phone','mail','password','url','select','checkbox', ...) + * @param int $length Length of attribute + * @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...) + * @param int $unique Is field unique or not + * @param int $required Is field required or not + * @param int $pos Position of attribute + * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @param int $alwayseditable Is attribute always editable regardless of the document status + * @param string $perms Permission to check + * @param string $list Visibility + * @param string $help Help on tooltip + * @param string $default Default value (in database. use the default_value feature for default value on screen). + * @param string $computed Computed value + * @param string $entity Entity of extrafields + * @param string $langfile Language file + * @param string $enabled Condition to have the field enabled or not + * @param int $totalizable Is extrafield totalizable on list + * @param int $printable Is extrafield displayed on PDF + * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...) + * @return int >0 if OK, <=0 if KO + * @throws Exception + */ + public function update($attrname, $label, $type, $length, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = array(), $alwayseditable = 0, $perms = '', $list = '', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array()) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load the array of extrafields definition $this->attributes + * + * @param string $elementtype Type of element ('all' = all or $object->table_element like 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...). + * @param boolean $forceload Force load of extra fields whatever is status of cache. + * @param string $attrname The name of the attribute. + * @return array{}|array{label:array,type:array,size:array,default:array,computed:array,unique:array,required:array,param:array,perms:array,list:array|array,pos:array,totalizable:array,help:array,printable:array,enabled:array,langfile:array,css:array,csslist:array,hidden:array,mandatoryfieldsofotherentities?:array,loaded?:int,count:int} Array of attributes keys+label for all extra fields. Note: count set as present to avoid static analysis notices + */ + public function fetch_name_optionals_label($elementtype, $forceload = \false, $attrname = '') + { + } + /** + * Return HTML string to put an input field into a page + * Code very similar with showInputField of common object + * + * @param string $key Key of attribute + * @param string|array $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value); for dates in filter mode, a range array('start'=>, 'end'=>) should be provided + * @param string $moreparam To add more parameters on html input tag + * @param string $keysuffix Suffix string to add after name and id of field (can be used to avoid duplicate names) + * @param string $keyprefix Prefix string to add before name and id of field (can be used to avoid duplicate names) + * @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric) + * @param int $objectid Current object id + * @param string $extrafieldsobjectkey The key to use to store retrieved data (commonly $object->table_element) + * @param int $mode 1=Used for search filters + * @return string + */ + public function showInputField($key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '', $objectid = 0, $extrafieldsobjectkey = '', $mode = 0) + { + } + /** + * Return HTML string to put an output field into a page + * + * @param string $key Key of attribute + * @param string $value Value to show + * @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering) + * @param string $extrafieldsobjectkey Required (for example $object->table_element). + * @param Translate $outputlangs Output language + * @return string Formatted value + */ + public function showOutputField($key, $value, $moreparam = '', $extrafieldsobjectkey = '', $outputlangs = \null) + { + } + /** + * Return the CSS to use for this extrafield into list + * + * @param string $key Key of attribute + * @param string $extrafieldsobjectkey If defined, use the new method to get extrafields data + * @return string Formatted value + */ + public function getAlignFlag($key, $extrafieldsobjectkey = '') + { + } + /** + * Return HTML string to print separator extrafield + * + * @param string $key Key of attribute + * @param object $object Object + * @param int $colspan Value of colspan to use (it must includes the first column with title) + * @param string $display_type "card" for form display, "line" for document line display (extrafields on propal line, order line, etc...) + * @param string $mode Show output ('view') or input ('create' or 'edit') for extrafield + * @return string HTML code with line for separator + */ + public function showSeparator($key, $object, $colspan = 2, $display_type = 'card', $mode = '') + { + } + /** + * Fill array_options property of object by extrafields value (using for data sent by forms) + * + * @param array|null $extralabels Deprecated (old $array of extrafields, now set this to null) + * @param object $object Object + * @param string $onlykey Only some keys are filled: + * 'string' => When we make update of only one extrafield ($action = 'update_extras'), calling page can set this to avoid to have other extrafields being reset. + * '@GETPOSTISSET' => When we make update of several extrafields ($action = 'update'), calling page can set this to avoid to have fields not into POST being reset. + * @param int $todefaultifmissing 1=Set value to the default value in database if value is mandatory and missing + * @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example) + */ + public function setOptionalsFromPost($extralabels, &$object, $onlykey = '', $todefaultifmissing = 0) + { + } + /** + * return array_options array of data of extrafields value of object sent by a search form + * + * @param array|string $extrafieldsobjectkey array of extrafields (old usage) or value of object->table_element (new usage) + * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) + * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @return array|int array_options set or 0 if no value + */ + public function getOptionalsFromPost($extrafieldsobjectkey, $keysuffix = '', $keyprefix = '') + { + } + /** + * Return array with all possible types and labels of extrafields + * + * @return string[] + */ + public static function getListOfTypesLabels() + { + } + /** + * Return if a value is "empty" for a mandatory vision. + * + * @param mixed $v Value to test + * @param string $type Type of extrafield 'sellist', 'link', 'select', ... + * @return boolean True is value is an empty value, not allowed for a mandatory field. + */ + public static function isEmptyValue($v, string $type) + { + } + } + /* Copyright (C) 2020 Laurent Destailleur + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/core/class/extralanguages.class.php + * \ingroup core + * \brief File of class to manage extra languages for some fields + */ + /** + * Class to manage standard extra languages + */ + class ExtraLanguages + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var array New array to store extralanguages definition + */ + public $attributes; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Array of Error code (or message) + */ + public $errors = array(); + /** + * @var string DB Error number + */ + public $errno; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load array this->attributes with list of fields per object that need an alternate translation. The object and field must be managed with + * the widgetForTranslation() method. + * You must set variable MAIN_USE_ALTERNATE_TRANSLATION_FOR=elementA:fieldname,fieldname2;elementB:... + * Example: MAIN_USE_ALTERNATE_TRANSLATION_FOR=societe:name,town;contact:firstname,lastname + * + * @param string $elementtype Type of element ('' = all, 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...). + * @param boolean $forceload Force load of extra fields whatever is status of cache. + * @return array Array of attributes keys+label for all extra fields. + */ + public function fetch_name_extralanguages($elementtype, $forceload = \false) + { + } + /** + * Return HTML string to put an input field into a page + * Code very similar with showInputField of common object + * + * @param string $key Key of attribute + * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) + * @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data + * @param string $moreparam To add more parameters on html input tag + * @param string $keysuffix Prefix string to add after name and id of field (can be used to avoid duplicate names) + * @param string $keyprefix Suffix string to add before name and id of field (can be used to avoid duplicate names) + * @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric) + * @param int $objectid Current object id + * @param int $mode 1=Used for search filters + * @return string + */ + public function showInputField($key, $value, $extrafieldsobjectkey, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '', $objectid = 0, $mode = 0) + { + } + /** + * Return HTML string to put an output field into a page + * + * @param string $key Key of attribute + * @param string $value Value to show + * @param string $extrafieldsobjectkey If defined (for example $object->table_element), function uses the new method to get extrafields data + * @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering) + * @return string Formatted value + */ + public function showOutputField($key, $value, $extrafieldsobjectkey, $moreparam = '') + { + } + } + /** + * Class to parse Fediverse files + */ + class FediverseParser + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var String Error code (or message) + */ + public $error = ''; + /** + * Constructor + * + * @param string $platform name of social network + */ + public function __construct($platform) + { + } + /** + * Parse Fediverse API to retrieve posts. + * + * @param string $urlAPI URL of the Fediverse API. + * @param int $maxNb Maximum number of posts to retrieve (default is 5). + * @param int $cacheDelay Number of seconds to use cached data (0 to disable caching). + * @param string $cacheDir Directory to store cached data. + * @return int Status code: <0 if error, >0 if success. + */ + public function parser($urlAPI, $maxNb = 5, $cacheDelay = 60, $cacheDir = '') + { + } + /** + * Get the list of retrieved posts. + * + * @return array List of posts. + */ + public function getPosts() + { + } + /** + * Get the last fetch date. + * + * @return int|String Timestamp of the last successful fetch. + */ + public function getLastFetchDate() + { + } + } + /** + * This class is used to manage file upload using ajax + */ + class FileUpload + { + public $options; + protected $fk_element; + /** + * @var string object element + */ + protected $element; + /** + * Constructor. + * This set ->$options + * + * @param array $options Options array + * @param int $fk_element ID of element + * @param string $element Code of element + */ + public function __construct($options = \null, $fk_element = \null, $element = \null) + { + } + /** + * Return full URL + * + * @return string URL + */ + protected function getFullUrl() + { + } + /** + * Set delete url + * + * @param object $file Filename + * @return void + */ + protected function setFileDeleteUrl($file) + { + } + /** + * getFileObject + * + * @param string $file_name Filename + * @return stdClass|null + */ + protected function getFileObject($file_name) + { + } + /** + * getFileObjects + * + * @return array Array of objects + */ + protected function getFileObjects() + { + } + /** + * Create thumbs of a file uploaded. + * + * @param string $file_name Filename + * @param string $options is array('max_width', 'max_height') + * @return boolean + */ + protected function createScaledImage($file_name, $options) + { + } + /** + * Make validation on an uploaded file + * + * @param string $uploaded_file Upload file + * @param object $file File + * @param string $error Error + * @param string $index Index + * @return boolean True if OK, False if KO + */ + protected function validate($uploaded_file, $file, $error, $index) + { + } + /** + * Enter description here ... + * + * @param int $matches ??? + * @return string ??? + */ + protected function upcountNameCallback($matches) + { + } + /** + * Enter description here ... + * + * @param string $name ??? + * @return string ??? + */ + protected function upcountName($name) + { + } + /** + * trimFileName + * + * @param string $name Filename + * @param string $type ??? + * @param string $index ??? + * @return string + */ + protected function trimFileName($name, $type, $index) + { + } + /** + * handleFileUpload. + * Validate data, move the uploaded file then create the thumbs if this is an image. + * + * @param string $uploaded_file Upload file + * @param string $name Name + * @param int $size Size + * @param string $type Type + * @param string $error Error + * @param string $index Index + * @return stdClass|null + */ + protected function handleFileUpload($uploaded_file, $name, $size, $type, $error, $index) + { + } + /** + * Output data + * + * @return void + */ + /*public function get() + { + $file_name = isset($_REQUEST['file']) ? basename(stripslashes($_REQUEST['file'])) : null; + if ($file_name) { + $info = $this->getFileObject($file_name); + } else { + $info = $this->getFileObjects(); + } + + header('Content-type: application/json'); + echo json_encode($info); + } + */ + /** + * Output data + * + * @return int 0 if OK, nb of error if errors + */ + public function post() + { + } + /** + * Delete uploaded file + * + * @param string $file File + * @return int + */ + /* + public function delete($file) + { + $file_name = $file ? basename($file) : null; + $file_path = $this->options['upload_dir'].dol_sanitizeFileName($file_name); + $success = dol_is_file($file_path) && $file_name[0] !== '.' && unlink($file_path); + if ($success) { + foreach ($this->options['image_versions'] as $version => $options) { + $file = $options['upload_dir'].$file_name; + if (dol_is_file($file)) { + unlink($file); + } + } + } + // Return result in json format + header('Content-type: application/json'); + echo json_encode($success); + + return 0; + } + */ + } + /** + * Class to manage fiscal year + */ + class Fiscalyear extends \CommonObject + { + /** + * @var string ID to identify managed object + */ + public $element = 'fiscalyear'; + /** + * @var string picto + */ + public $picto = 'calendar'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'accounting_fiscalyear'; + /** + * @var string Name of subtable line + */ + public $table_element_line = ''; + /** + * @var string Field with ID of parent key if this field has a parent + */ + public $fk_element = ''; + /** + * @var int ID + */ + public $rowid; + /** + * @var string fiscal year label + */ + public $label; + /** + * Date start (date_start) + * + * @var integer + */ + public $date_start; + /** + * Date end (date_end) + * + * @var integer + */ + public $date_end; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + /** + * @var int status 0=open, 1=closed + * @deprecated + * @see $status + */ + public $statut; + /** + * @var int status 0=open, 1=closed + */ + public $status; + /** + * @var int Entity + */ + public $entity; + const STATUS_OPEN = 0; + const STATUS_CLOSED = 1; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct(\DoliDB $db) + { + } + /** + * Create object in database + * + * @param User $user User making creation + * @return int Return integer <0 if KO, >0 if OK + */ + public function create($user) + { + } + /** + * Update record + * + * @param User $user User making update + * @return int Return integer <0 if KO, >0 if OK + */ + public function update($user) + { + } + /** + * Load an object from database + * + * @param int $id Id of record to load + * @return int Return integer <0 if KO, >0 if OK + */ + public function fetch($id) + { + } + /** + * Delete record + * + * @param User $user User that delete + * @return int Return integer <0 if KO, >0 if OK + */ + public function delete($user) + { + } + /** + * getTooltipContentArray + * + * @param array $params ex option, infologin + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + } + /** + * Return clickable link of object (with eventually picto) + * + * @param int $withpicto Add picto into link + * @param int $notooltip 1=Disable tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $notooltip = 0, $save_lastsearch_value = -1) + { + } + /** + * Give a label from a status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label + */ + public function getLibStatut($mode = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Give a label from a status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label + */ + public function LibStatut($status, $mode = 0) + { + } + /** + * Information on record + * + * @param int $id Id of record + * @return void + */ + public function info($id) + { + } + /** + * Return the number of entries by fiscal year + * + * @param int|string $datestart Date start to scan + * @param int|string $dateend Date end to scan + * @return string Number of entries + */ + public function getAccountancyEntriesByFiscalYear($datestart = '', $dateend = '') + { + } + /** + * Return the number of movements by fiscal year + * + * @param int|string $datestart Date start to scan + * @param int|string $dateend Date end to scan + * @return string Number of movements + */ + public function getAccountancyMovementsByFiscalYear($datestart = '', $dateend = '') + { + } + } + /** + * Class of a generic business object + */ + class GenericObject extends \CommonObject + { + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + } + /* Copyright (C) 2024 Frédéric France + * + * 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 . + * or see https://www.gnu.org/ + */ + /** + * \file htdocs/core/class/geomapeditor.class.php + * \brief Class to manage a leaflet map width geometrics objects + */ + /** + * Class to manage a Leaflet map width geometrics objects + */ + class GeoMapEditor + { + /** + * __contruct + * + * @return void + */ + public function __construct() + { + } + /** + * getHtml + * + * @param string $htmlname htmlname + * @param string $geojson json of geometric objects + * @param string $centroidjson json of geometric center of object + * @param string $markertype type of marker, point, multipts, linestrg, polygon + * + * @return string + */ + public function getHtml($htmlname, $geojson, $centroidjson, $markertype) + { + } + } + /* Copyright (C) 2010 Laurent Destailleur + * Copyright (C) 2024 Frédéric France + * + * 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 . + * or see https://www.gnu.org/ + */ + /** + * \file htdocs/core/class/google.class.php + * \brief A set of functions for using Google APIs + */ + /** + * Class to manage Google API + */ + class GoogleAPI + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string google key + */ + public $key; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $key Google key + */ + public function __construct($db, $key) + { + } + /** + * Return geo coordinates of an address + * + * @param string $address Address + * Example: 68 Grande rue Charles de Gaulle,+94130,+Nogent sur Marne,+France + * Example: 188, rue de Fontenay,+94300,+Vincennes,+France + * @return string Coordinates + */ + public function getGeoCoordinatesOfAddress($address) + { + } + } + /* Copyright (C) 2010-2016 Laurent Destailleur + * Copyright (C) 2010-2014 Regis Houssin + * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/core/class/hookmanager.class.php + * \ingroup core + * \brief File of class to manage hooks + */ + /** + * Class to manage hooks + */ + class HookManager + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + /** + * @var string[] Context hookmanager was created for ('thirdpartycard', 'thirdpartydao', ...) + */ + public $contextarray = array(); + /** + * array> Array with instantiated classes + */ + public $hooks = array(); + /** + * array> Array with instantiated classes sorted by hook priority + */ + public $hooksSorted = array(); + /** + * @var array List of hooks called during this request (key = hash) + */ + public $hooksHistory = []; + /** + * @var mixed[] Result + */ + public $resArray = array(); + /** + * @var string Printable result + */ + public $resPrint = ''; + /** + * @var int Nb of qualified hook ran + */ + public $resNbOfHooks = 0; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @return void + */ + public function __construct($db) + { + } + /** + * Init array $this->hooks with instantiated action controllers. + * First, a hook is declared by a module by adding a constant MAIN_MODULE_MYMODULENAME_HOOKS with value 'nameofcontext1:nameofcontext2:...' into $this->const of module descriptor file. + * This makes $conf->hooks_modules loaded with an entry ('modulename'=>array(nameofcontext1,nameofcontext2,...)) + * When initHooks function is called, with initHooks(list_of_contexts), an array $this->hooks is defined with instance of controller + * class found into file /mymodule/class/actions_mymodule.class.php (if module has declared the context as a managed context). + * Then when a hook executeHooks('aMethod'...) is called, the method aMethod found into class will be executed. + * + * @param string[] $arraycontext Array list of context hooks to activate. For example: 'thirdpartycard' (for hook methods into page card thirdparty), 'thirdpartydao' (for hook methods into Societe), ... + * @return int<0,1> 0 or 1 + */ + public function initHooks($arraycontext) + { + } + /** + * Execute hooks (if they were initialized) for the given method + * + * @param string $method Name of method hooked ('doActions', 'printSearchForm', 'showInputField', ...) + * @param array $parameters Array of parameters + * @param object $object Object to use hooks on + * @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...) + * @return int<-1,1> For 'addreplace' hooks (doActions, formConfirm, formObjectOptions, pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop/replace standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller. + * For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0 if we want to keep standard actions, >0 uf we want to stop/replace standard actions (at least one > 0 and replacement will be done), <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller. + * All types can also return some values into an array ->results that will be merged into this->resArray for caller. + * $this->error or this->errors are also defined by class called by this function if error. + */ + public function executeHooks($method, $parameters = array(), &$object = \null, &$action = '') + { + } + } + /** + * Class to manage generation of HTML components for accounting management + */ + class FormAccounting extends \Form + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * @var int Nb of accounts found + */ + public $nbaccounts; + /** + * @var int Nb of accounts category found + */ + public $nbaccounts_category; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of journals with label by nature + * + * @param string $selectid Preselected journal code + * @param string $htmlname Name of field in html form + * @param int<0,9> $nature Limit the list to a particular type of journals (1:various operations / 2:sale / 3:purchase / 4:bank / 9: has-new) + * @param int<0,1> $showempty Add an empty field + * @param int<0,1> $select_in 0=selectid value is the journal rowid (default) or 1=selectid is journal code + * @param int<0,1> $select_out Set value returned by select. 0=rowid (default), 1=code + * @param string $morecss More css non HTML object + * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache. + * @param int<0,1> $disabledajaxcombo Disable ajax combo box. + * @return string|int String with HTML select, or -1 if error + */ + public function select_journal($selectid, $htmlname = 'journal', $nature = 0, $showempty = 0, $select_in = 0, $select_out = 0, $morecss = 'maxwidth300 maxwidthonsmartphone', $usecache = '', $disabledajaxcombo = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of journals with label by nature + * + * @param string[] $selectedIds Preselected journal code array + * @param string $htmlname Name of field in html form + * @param int $nature Limit the list to a particular type of journals (1:various operations / 2:sale / 3:purchase / 4:bank / 9: has-new) + * @param int $showempty Add an empty field + * @param int $select_in 0=selectid value is the journal rowid (default) or 1=selectid is journal code + * @param int $select_out Set value returned by select. 0=rowid (default), 1=code + * @param string $morecss More css non HTML object + * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache. + * @param int $disabledajaxcombo Disable ajax combo box. + * @return string|int<-1,-1> String with HTML select, or -1 if error + */ + public function multi_select_journal($selectedIds = array(), $htmlname = 'journal', $nature = 0, $showempty = 0, $select_in = 0, $select_out = 0, $morecss = '', $usecache = '', $disabledajaxcombo = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of accounting category. + * Use mysoc->country_id or mysoc->country_code so they must be defined. + * + * @param int $selected Preselected type + * @param string $htmlname Name of field in form + * @param int $useempty Set to 1 if we want an empty value + * @param int $maxlen Max length of text in combo box + * @param int $help Add or not the admin help picto + * @param int $allcountries All countries + * @return void|string HTML component with the select + */ + public function select_accounting_category($selected = 0, $htmlname = 'account_category', $useempty = 0, $maxlen = 0, $help = 1, $allcountries = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return select filter with date of transaction + * + * @param string $htmlname Name of select field + * @param string $selectedkey Value + * @return string|int<-1,-1> HTML edit field, or -1 if error + */ + public function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of accounts with label by chart of accounts + * + * @param string $selectid Preselected id of accounting accounts (depends on $select_in) + * @param string $htmlname Name of HTML field id. If name start with '.', it is name of HTML css class, so several component with same name in different forms can be used. + * @param int|string $showempty 1=Add an empty field, 2=Add an empty field+'None' field + * @param array> $event Event options + * @param int $select_in 0=selectid value is a aa.rowid (default) or 1=selectid is aa.account_number + * @param int $select_out Set value returned by select. 0=rowid (default), 1=account_number + * @param string $morecss More css non HTML object + * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache. + * @param string $active Filter on status active or not: '0', '1' or '' for no filter + * @return string|int<-1,-1> String with HTML select, or -1 if error + */ + public function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss = 'minwidth100 maxwidth300 maxwidthonsmartphone', $usecache = '', $active = '1') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of auxiliary accounts. Cumulate list from customers, suppliers and users. + * + * @param string $selectid Preselected pcg_type + * @param string $htmlname Name of field in html form + * @param int|string $showempty Add an empty field + * @param string $morecss More css + * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache. + * @param string $labelhtmlname HTML name of label for autofill of account from name. + * @return string|int<-1,-1> String with HTML select, or -1 if error + */ + public function select_auxaccount($selectid, $htmlname = 'account_num_aux', $showempty = 0, $morecss = 'minwidth100 maxwidth300 maxwidthonsmartphone', $usecache = '', $labelhtmlname = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return HTML combo list of years existing into book keepping + * + * @param string $selected Preselected value + * @param string $htmlname Name of HTML select object + * @param int $useempty Affiche valeur vide dans liste + * @param string $output_format (html/option (for option html only)/array (to return options arrays + * @return string|array|int<-1,-1> HTML select component || array of select options || - 1 if error + */ + public function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html') + { + } + /** + * Output html select to select accounting account + * + * @param string $page Page + * @param string $selected Id preselected + * @param string $htmlname Name of HTML select object + * @param int $option option (0: aggregate by general account or 1: aggregate by subaccount) + * @param int $useempty Show empty value in list + * @param string $filter optional filters criteria + * @param int $nooutput No print output. Return it only. + * @return void|string + */ + public function formAccountingAccount($page, $selected = '', $htmlname = 'none', $option = 0, $useempty = 1, $filter = '', $nooutput = 0) + { + } + } + /* Copyright (c) 2008-2012 Laurent Destailleur + * Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2010-2018 Juanjo Menent + * Copyright (C) 2024 Frédéric France + * + * 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 . + */ + /** + * \file htdocs/core/class/html.formactions.class.php + * \ingroup core + * \brief File of class with predefined functions and HTML components + */ + /** + * Class to manage building of HTML components + */ + class FormActions + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show list of action status + * + * @param string $formname Name of form where select is included + * @param string $selected Preselected value (-1..100) + * @param int $canedit 1=can edit, 0=read only + * @param string $htmlname Name of html prefix for html fields (selectX and valX) + * @param integer $showempty Show an empty line if select is used + * @param integer $onlyselect 0=Standard, 1=Hide percent of completion and force usage of a select list, 2=Same than 1 and add "Incomplete (Todo+Running) + * @param string $morecss More css on select field + * @return void + */ + public function form_select_status_action($formname, $selected, $canedit = 1, $htmlname = 'complete', $showempty = 0, $onlyselect = 0, $morecss = 'maxwidth100') + { + } + /** + * Show list of actions for element + * + * @param Object $object Object + * @param string $typeelement 'invoice', 'propal', 'order', 'invoice_supplier', 'order_supplier', 'fichinter' + * @param int $socid Socid of user + * @param int $forceshowtitle Show title even if there is no actions to show + * @param string $morecss More css on table + * @param int $max Max number of record + * @param string $moreparambacktopage More param for the backtopage + * @param string $morehtmlcenter More html text on center of title line + * @param int $assignedtouser Assign event by default to this user id (will be ignored if not enough permissions) + * @return int Return integer <0 if KO, >=0 if OK + */ + public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '', $assignedtouser = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Output html select list of type of event + * + * @param array|string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx'). Can be an array too. + * @param string $htmlname Name of select field + * @param string $excludetype A type to exclude ('systemauto', 'system', '') + * @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual", -2=Combined line is disabled (not implemented yet) + * @param int $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value + * @param int $multiselect 1=Allow multiselect of action type + * @param int $nooutput 1=No output + * @param string $morecss More css to add to SELECT component. + * @return string + */ + public function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0, $nooutput = 0, $morecss = 'minwidth300') + { + } + } + /* Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW + * + * 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 . + */ + /** + * \file htdocs/core/class/html.formadmin.class.php + * \ingroup core + * \brief File of class for html functions for admin pages + */ + /** + * Class to generate html code for admin pages + */ + class FormAdmin + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string error message + */ + public $error; + /** + * Constructor + * + * @param DoliDB|null $db Database handler + */ + public function __construct($db) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return html select list with available languages (key='en_US', value='United States' for example) + * + * @param string|string[] $selected Language pre-selected. Can be an array if $multiselect is 1. + * @param string $htmlname Name of HTML select + * @param int<0,1> $showauto Show 'auto' choice + * @param string[] $filter Array of keys to exclude in list (opposite of $onlykeys) + * @param int<1,1>|string $showempty '1'=Add empty value or 'string to show' + * @param int<0,1> $showwarning Show a warning if language is not complete + * @param int<0,1> $disabled Disable edit of select + * @param string $morecss Add more css styles + * @param int<0,2> $showcode 1=Add language code into label at beginning, 2=Add language code into label at end + * @param int<0,1> $forcecombo Force to use combo box (so no ajax beautify effect) + * @param int<0,1> $multiselect Make the combo a multiselect + * @param string[] $onlykeys Array of language keys to restrict list with the following keys (opposite of $filter). Example array('fr', 'es', ...) + * @param int<0,1> $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...) + * @return string Return HTML select string with list of languages + */ + public function select_language($selected = '', $htmlname = 'lang_id', $showauto = 0, $filter = array(), $showempty = '', $showwarning = 0, $disabled = 0, $morecss = '', $showcode = 0, $forcecombo = 0, $multiselect = 0, $onlykeys = array(), $mainlangonly = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of available menus (eldy_backoffice, ...) + * + * @param string $selected Preselected menu value + * @param string $htmlname Name of html select + * @param string[] $dirmenuarray Array of directories to scan + * @param string $moreattrib More attributes on html select tag + * @return integer|void + */ + public function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return combo list of available menu families + * + * @param string $selected Menu pre-selected + * @param string $htmlname Name of html select + * @param string[] $dirmenuarray Directories to scan + * @return void + */ + public function select_menu_families($selected, $htmlname, $dirmenuarray) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return a HTML select list of timezones + * + * @param string $selected Menu pre-selectionnee + * @param string $htmlname Nom de la zone select + * @return void + */ + public function select_timezone($selected, $htmlname) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return html select list with available languages (key='en_US', value='United States' for example) + * + * @param string $selected Paper format pre-selected + * @param string $htmlname Name of HTML select field + * @param string $filter Value to filter on code + * @param int $showempty Add empty value + * @param int $forcecombo Force to load all values and output a standard combobox (with no beautification) + * @return string Return HTML output + */ + public function select_paper_format($selected = '', $htmlname = 'paperformat_id', $filter = '', $showempty = 0, $forcecombo = 0) + { + } + /** + * Function to show the combo select to chose a type of field (varchar, int, email, ...) + * + * @param string $htmlname Name of HTML select component + * @param string $type Type preselected + * @param array $typewecanchangeinto Array of possible switch combination from 1 type to another one. This will grey not possible combinations. + * @return string The combo HTML select component + */ + public function selectTypeOfFields($htmlname, $type, $typewecanchangeinto = array()) + { + } + } + /** + * Class to manage generation of HTML components for bank module + */ + class FormBank + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Retourne la liste des types de comptes financiers + * + * @param integer $selected Type pre-selectionne + * @param string $htmlname Nom champ formulaire + * @return void + */ + public function selectTypeOfBankAccount($selected = \Account::TYPE_CURRENT, $htmlname = 'type') + { + } + /** + * Returns the name of the Iban label. India uses 'IFSC' and the rest of the world 'IBAN' name. + * + * @param Account $account Account object + * @return string + */ + public static function getIBANLabel(\Account $account) + { + } + } + /* Copyright (C) 2007-2012 Regis Houssin + * Copyright (C) 2008-2012 Laurent Destailleur + * Copyright (C) 2018-2024 Frédéric France + * + * 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 . + * + */ + /** + * \file htdocs/core/class/html.formbarcode.class.php + * \brief Fichier de la class des functions predefinie de composants html + */ + /** + * Class to manage barcode HTML + */ + class FormBarCode + { + /** + * @var DoliDB Database handler. + */ + public $db; + /** + * @var string Error code (or message) + */ + public $error = ''; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + } + /** + * Return HTML select with list of bar code generators + * + * @param int $selected Id code pre-selected + * @param array $barcodelist Array of barcodes generators + * @param int $code_id Id du code barre + * @param string $idForm Id of html form, ex id="idform" + * @return string HTML select string + */ + public function setBarcodeEncoder($selected, $barcodelist, $code_id, $idForm = 'formbarcode') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Print form to select type of barcode + * + * @param int $selected Id code pre-selected + * @param string $htmlname Name of HTML select field + * @param int $useempty Affiche valeur vide dans liste + * @return void + * @deprecated + */ + public function select_barcode_type($selected = 0, $htmlname = 'barcodetype_id', $useempty = 0) + { + } + /** + * Return html form to select type of barcode + * + * @param int $selected Id code pre-selected + * @param string $htmlname Name of HTML select field + * @param int $useempty Display empty value in select + * @return string + */ + public function selectBarcodeType($selected = 0, $htmlname = 'barcodetype_id', $useempty = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Show form to select type of barcode + * + * @param string $page Page + * @param int $selected Id condition preselected + * @param string $htmlname Nom du formulaire select + * @return void + * @deprecated + */ + public function form_barcode_type($page, $selected = 0, $htmlname = 'barcodetype_id') + { + } + /** + * Return html form to select type of barcode + * + * @param string $page Page + * @param int $selected Id condition preselected + * @param string $htmlname Nom du formulaire select + * @return string + */ + public function formBarcodeType($page, $selected = 0, $htmlname = 'barcodetype_id') + { + } + } + /** + * Class to manage forms for categories + */ + class FormCategory extends \Form + { + /** + * Return a HTML filter box for a list filter view + * + * @param string $type The categorie type (e.g Categorie::TYPE_WAREHOUSE) + * @param array $preSelected A list with the elements that should pre-selected + * @param string $morecss More CSS + * @param int $searchCategoryProductOperator Used only if $multiselect is 1. Set to 0 or 1 to enable the checkbox to search with a or (0=not preseleted, 1=preselected), -1=Checkbox never shown. + * @param int $multiselect 0 or 1 + * @param int $nocateg 1=Add an entry '- No Category -' + * @param string $showempty 1 or 'string' to add an empty entry + * @return string A HTML filter box (Note: selected results can get with GETPOST("search_category_".$type."_list")) + */ + public function getFilterBox($type, array $preSelected, $morecss = "minwidth300imp widthcentpercentminusx", $searchCategoryProductOperator = -1, $multiselect = 1, $nocateg = 1, $showempty = '') + { + } + /** + * Prints a select form for products categories + * @param int $selected Id category pre-selection + * @param string $htmlname Name of HTML field + * @param int $showempty Add an empty field + * @return int|null + */ + public function selectProductCategory($selected = 0, $htmlname = 'product_category_id', $showempty = 0) + { + } + } + /** + * Class of forms component to manage companies + */ + class FormCompany extends \Form + { + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of labels (translated) of third parties type + * + * @param int $mode 0=Return id+label, 1=Return code+label + * @param string $filter Add a SQL filter to select. Data must not come from user input. + * @return array Array of types + */ + public function typent_array($mode = 0, $filter = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the list of entries for staff (no translation, it is number ranges) + * + * @param int $mode 0=return id+label, 1=return code+Label + * @param string $filter Add a SQL filter to select. Data must not come from user input. + * @return array Array of types d'effectifs + */ + public function effectif_array($mode = 0, $filter = '') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Affiche formulaire de selection des modes de reglement + * + * @param int $page Page + * @param int $selected Id or code preselected + * @param string $htmlname Nom du formulaire select + * @param int $empty Add empty value in list + * @return void + */ + public function form_prospect_level($page, $selected = 0, $htmlname = 'prospect_level_id', $empty = 0) + { + } + /** + * Affiche formulaire de selection des niveau de prospection pour les contacts + * + * @param int $page Page + * @param int $selected Id or code preselected + * @param string $htmlname Nom du formulaire select + * @param int $empty Add empty value in list + * @return void + */ + public function formProspectContactLevel($page, $selected = 0, $htmlname = 'prospect_contact_level_id', $empty = 0) + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns the drop-down list of departments/provinces/cantons for all countries or for a given country. + * In the case of an all-country list, the display breaks on the country. + * The key of the list is the code (there can be several entries for a given code but in this case, the country field differs). + * Thus the links with the departments are done on a department independently of its name. + * + * @param string $selected Code state preselected + * @param int $country_codeid 0=list for all countries, otherwise country code or country rowid to show + * @param string $htmlname Id of department + * @return void + */ + public function select_departement($selected = '', $country_codeid = 0, $htmlname = 'state_id') + { + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns the drop-down list of departments/provinces/cantons for all countries or for a given country. + * In the case of an all-country list, the display breaks on the country. + * The key of the list is the code (there can be several entries for a given code but in this case, the country field differs). + * Thus the links with the departments are done on a department independently of its name. + * + * @param int $selected Code state preselected (mus be state id) + * @param integer $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show + * @param string $htmlname Id of department. If '', we want only the string with