Merge remote-tracking branch 'upstream/develop' into extrafields_object_filter

This commit is contained in:
Frédéric France 2024-11-19 21:26:20 +01:00
commit ad8a5c9054
No known key found for this signature in database
GPG key ID: CE25B0B7B53B9177
264 changed files with 1986 additions and 2600 deletions

View file

@ -1,9 +1,9 @@
name: 'PHPStan baseline'
on:
# Every Thursday we want to refresh the baseline
# Every day we want to refresh the baseline
schedule:
- cron: '0 6 * * 4'
- cron: '0 12 * * *'
# We want to be able to manually refresh the baseline too
workflow_dispatch:
@ -14,18 +14,21 @@ on:
required: true
type: string
# Run PHPStan analyse on pull requests
#pull_request:
# pull_request:
permissions: {} # none
env:
PHP_VERSION: '8.2'
GH_TOKEN: ${{ github.token }}
gh_event: ${{ inputs.gh_event || github.event_name }}
CACHE_KEY_PART: ${{ ( inputs.gh_event == 'pull_request' || github.event_name == 'pull_request' ) && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }}
jobs:
phpstan:
runs-on: ubuntu-latest
permissions: write-all
# contents: write
# pull-requests: write
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
@ -54,7 +57,7 @@ jobs:
phpstan-cache-${{ env.PHP_VERSION }}-
- uses: ruudk/phpstan-baseline-refresh-create-pr-action@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ env.GH_TOKEN }}
phpstan_path: phpstan
configuration_path: phpstan.neon.dist
phpstan_additional_arguments: --memory-limit 7G -a build/phpstan/bootstrap_action.php
@ -63,8 +66,8 @@ jobs:
commit_email: dolibarr-bot@users.noreply.github.com
commit_message: PHPStan > Update baseline
target_branch: develop
pr_create: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 1 || 0 }}
# pr_create: 1
# pr_create: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 1 || 0 }}
pr_create: 1
pr_title: PHPStan > Update baseline
pr_reviewer: eldy
pr_body: |

File diff suppressed because it is too large Load diff

View file

@ -1150,7 +1150,7 @@ CREATE TABLE `llx_c_field_list` (
LOCK TABLES `llx_c_field_list` WRITE;
/*!40000 ALTER TABLE `llx_c_field_list` DISABLE KEYS */;
INSERT INTO `llx_c_field_list` VALUES (1,'2011-02-06 11:18:30','product_default',1,'p.ref','ref','Ref','left',1,1,'1',1),(2,'2011-02-06 11:18:30','product_default',1,'p.label','label','Label','left',1,1,'1',2),(3,'2011-02-06 11:18:30','product_default',1,'p.barcode','barcode','BarCode','center',1,1,'$conf->barcode->enabled',3),(4,'2011-02-06 11:18:30','product_default',1,'p.tms','datem','DateModification','center',1,0,'1',4),(5,'2011-02-06 11:18:30','product_default',1,'p.price','price','SellingPriceHT','right',1,0,'1',5),(6,'2011-02-06 11:18:30','product_default',1,'p.price_ttc','price_ttc','SellingPriceTTC','right',1,0,'1',6),(7,'2011-02-06 11:18:30','product_default',1,'p.stock','stock','Stock','right',0,0,'$conf->stock->enabled',7),(8,'2011-02-06 11:18:30','product_default',1,'p.envente','status','Status','right',1,0,'1',8);
INSERT INTO `llx_c_field_list` VALUES (1,'2011-02-06 11:18:30','product_default',1,'p.ref','ref','Ref','left',1,1,'1',1),(2,'2011-02-06 11:18:30','product_default',1,'p.label','label','Label','left',1,1,'1',2),(3,'2011-02-06 11:18:30','product_default',1,'p.barcode','barcode','BarCode','center',1,1,'isModEnabled("barcode")',3),(4,'2011-02-06 11:18:30','product_default',1,'p.tms','datem','DateModification','center',1,0,'1',4),(5,'2011-02-06 11:18:30','product_default',1,'p.price','price','SellingPriceHT','right',1,0,'1',5),(6,'2011-02-06 11:18:30','product_default',1,'p.price_ttc','price_ttc','SellingPriceTTC','right',1,0,'1',6),(7,'2011-02-06 11:18:30','product_default',1,'p.stock','stock','Stock','right',0,0,'isModEnabled("stock")',7),(8,'2011-02-06 11:18:30','product_default',1,'p.envente','status','Status','right',1,0,'1',8);
/*!40000 ALTER TABLE `llx_c_field_list` ENABLE KEYS */;
UNLOCK TABLES;

View file

@ -149,7 +149,7 @@ $phpstanversion = $output_arrtd[0];
$output_arrtd = array();
if ($dirphpstan != 'disabled') {
$commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --level='.$PHPSTANLEVEL.' -v analyze -a build/phpstan/bootstrap.php --memory-limit 8G --error-format=github';
$commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --level='.$PHPSTANLEVEL.' -v analyze -a build/phpstan/bootstrap.php --memory-limit 8G --error-format=github -c ~/preview.dolibarr.org/dolibarr/phpstan.v1.neon';
print 'Execute PHPStan to get the technical debt: '.$commandcheck."\n";
$resexectd = 0;
exec($commandcheck, $output_arrtd, $resexectd);

View file

@ -10,31 +10,31 @@
return [
// # Issue statistics:
// PhanUndeclaredProperty : 560+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 500+ occurrences
// PhanUndeclaredGlobalVariable : 350+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 270+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 370+ occurrences
// PhanUndeclaredGlobalVariable : 300+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 230+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 180+ occurrences
// PhanTypeMismatchProperty : 140+ occurrences
// PhanPluginUnknownPropertyType : 130+ occurrences
// PhanPluginUnknownArrayMethodParamType : 120+ occurrences
// PhanPossiblyUndeclaredVariable : 110+ occurrences
// PhanPluginUndeclaredVariableIsset : 65+ occurrences
// PhanPluginUndeclaredVariableIsset : 60+ occurrences
// PhanRedefineFunction : 45+ occurrences
// PhanTypeExpectedObjectPropAccess : 45+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 45+ occurrences
// PhanTypeInvalidDimOffset : 35+ occurrences
// PhanPluginEmptyStatementIf : 30+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 40+ occurrences
// PhanTypeInvalidDimOffset : 30+ occurrences
// PhanTypeMismatchDimFetch : 30+ occurrences
// PhanPluginEmptyStatementIf : 15+ occurrences
// PhanUndeclaredConstant : 15+ occurrences
// PhanEmptyForeach : 10+ occurrences
// PhanPluginUnknownObjectMethodCall : 10+ occurrences
// PhanTypeArraySuspiciousNull : 10+ occurrences
// PhanTypeComparisonFromArray : 10+ occurrences
// PhanTypeMismatchDimFetchNullable : 10+ occurrences
// PhanUndeclaredMethod : 10+ occurrences
// PhanPluginBothLiteralsBinaryOp : 8 occurrences
// PhanEmptyForeach : 9 occurrences
// PhanPluginBothLiteralsBinaryOp : 7 occurrences
// PhanPluginDuplicateExpressionBinaryOp : 7 occurrences
// PhanPluginSuspiciousParamPosition : 7 occurrences
// PhanTypeArraySuspiciousNull : 7 occurrences
// PhanPossiblyNullTypeMismatchProperty : 5 occurrences
// PhanParamTooMany : 4 occurrences
// PhanPluginDuplicateArrayKey : 4 occurrences
@ -108,85 +108,36 @@ return [
'htdocs/compta/bank/various_payment/document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/compta/bank/various_payment/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'],
'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
'htdocs/compta/cashcontrol/cashcontrol_list.php' => ['PhanTypeMismatchProperty'],
'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullableInternal'],
'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/deplacement/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/facture/agenda-rec.php' => ['PhanPluginEmptyStatementIf'],
'htdocs/compta/facture/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/facture/class/facture.class.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/facture/contact.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/invoicetemplate_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/note.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/prelevement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/tpl/linkedobjectblock.tpl.php' => ['PhanEmptyFQSENInClasslike', 'PhanInvalidFQSENInClasslike', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/journal/purchasesjournal.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/journal/sellsjournal.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/localtax/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/localtax/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/localtax/index.php' => ['PhanRedefineFunction'],
'htdocs/compta/localtax/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/localtax/clients.php' => ['PhanTypeExpectedObjectPropAccess'],
'htdocs/compta/localtax/list.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/paiement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetch'],
'htdocs/compta/paiement/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/compta/paiement/cheque/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/paiement.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/compta/paiement/card.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/paiement/cheque/list.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/paiement/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/paiement_charge.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/paiement_vat.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/payment_vat/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/prelevement/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/prelevement/demandes.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/prelevement/factures.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/prelevement/line.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/prelevement/orders_list.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/prelevement/stats.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/resultat/clientfourn.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/resultat/index.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/resultat/result.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/sociales/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'],
'htdocs/compta/sociales/list.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/compta/sociales/payments.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/stats/byratecountry.php' => ['PhanPluginEmptyStatementIf'],
'htdocs/compta/stats/cabyprodserv.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/stats/cabyuser.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/stats/casoc.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/stats/supplier_turnover.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/stats/supplier_turnover_by_prodserv.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/stats/supplier_turnover_by_thirdparty.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/tva/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/tva/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/tva/index.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'],
'htdocs/compta/tva/clients.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'],
'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullableInternal'],
'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'],
'htdocs/contact/card.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/contact/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/contact/list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/contact/perso.php' => ['PhanTypeMismatchProperty'],
'htdocs/contrat/agenda.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/contrat/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
'htdocs/contrat/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/contrat/class/api_contracts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/contrat/messaging.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/contrat/services_list.php' => ['PhanEmptyForeach', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/actions_comments.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/core/actions_lineupdown.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/actions_linkedfiles.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/actions_massactions.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'],
'htdocs/core/actions_massactions.inc.php' => ['PhanUndeclaredProperty'],
'htdocs/core/actions_printing.inc.php' => ['PhanUndeclaredProperty'],
'htdocs/core/actions_sendmails.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/core/actions_setmoduleoptions.inc.php' => ['PhanPluginUnknownObjectMethodCall'],
'htdocs/core/ajax/ajaxdirpreview.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/core/ajax/ajaxdirtree.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/ajax/selectobject.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/ajax/selectsearchbox.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/core/ajax/ajaxdirtree.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/boxes/box_actions.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/boxes/box_actions_future.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/boxes/box_external_rss.php' => ['PhanPluginUnknownPropertyType'],
@ -300,7 +251,6 @@ return [
'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/core/search_page.php' => ['PhanEmptyForeach', 'PhanPluginBothLiteralsBinaryOp'],
'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/bloc_comment.tpl.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/commonfields_view.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/core/tpl/document_actions_post_headers.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/extrafields_edit.tpl.php' => ['PhanPluginUndeclaredVariableIsset'],
@ -439,10 +389,9 @@ return [
'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/knowledgemanagement/knowledgerecord_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/loan/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/loan/document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/loan/note.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/loan/document.php' => ['PhanUndeclaredProperty'],
'htdocs/loan/note.php' => ['PhanUndeclaredProperty'],
'htdocs/loan/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/loan/schedule.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/margin/customerMargins.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/margin/productMargins.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/master.inc.php' => ['PhanUndeclaredGlobalVariable'],
@ -555,7 +504,6 @@ return [
'htdocs/public/recruitment/view.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/public/stripe/ipn.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'],
'htdocs/public/test/test_forms.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/public/ticket/create_ticket.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty'],
'htdocs/public/ticket/view.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'],
@ -599,7 +547,7 @@ return [
'htdocs/societe/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'],
'htdocs/societe/price.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/societe/price.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/societe/website.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition'],
@ -640,7 +588,6 @@ return [
'htdocs/user/class/api_users.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/user/class/user.class.php' => ['PhanUndeclaredProperty'],
'htdocs/user/class/usergroup.class.php' => ['PhanUndeclaredProperty'],
'htdocs/user/param_ihm.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/variants/ajax/get_attribute_values.php' => ['PhanTypeComparisonFromArray'],
'htdocs/variants/class/ProductCombination.class.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/variants/combinations.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'],

View file

@ -71,9 +71,10 @@ $permissiontodelete = $user->hasRight('accounting', 'chartofaccount');
if ($user->socid > 0) {
accessforbidden();
}
if (!$user->hasRight('accounting', 'chartofaccount')) {
if (!$permissiontoadd) {
accessforbidden();
}
// now $permissiontoadd or $user->hasRight('accounting', 'chartofaccount') are always equal to 1
// Load variable for pagination
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
@ -162,7 +163,7 @@ if (empty($reshook)) {
|| (GETPOSTINT('chartofaccounts') > 0 && GETPOSTINT('chartofaccounts') != getDolGlobalInt('CHARTOFACCOUNTS'))) { // a submit of form is done and chartofaccounts combo has been modified
$error = 0;
if ($chartofaccounts > 0 && $permissiontoadd) {
if ($chartofaccounts > 0 /* && $permissiontoadd */) {
$country_code = '';
// Get language code for this $chartofaccounts
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a';
@ -209,7 +210,7 @@ if (empty($reshook)) {
}
}
if ($action == 'disable' && $permissiontoadd) {
if ($action == 'disable' /* && $permissiontoadd */) {
if ($accounting->fetch($id)) {
$mode = GETPOSTINT('mode');
$result = $accounting->accountDeactivate($id, $mode);
@ -219,7 +220,7 @@ if (empty($reshook)) {
}
$action = 'update';
} elseif ($action == 'enable' && $permissiontoadd) {
} elseif ($action == 'enable' /* && $permissiontoadd */) {
if ($accounting->fetch($id)) {
$mode = GETPOSTINT('mode');
$result = $accounting->accountActivate($id, $mode);
@ -350,7 +351,8 @@ if ($resql) {
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
// if null contextpage is forced to 'accountingaccountlist' so never empty
if (/* !empty($contextpage) && */$contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
}
if ($limit > 0 && $limit != $conf->liste_limit) {
@ -398,9 +400,9 @@ if ($resql) {
// List of mass actions available
$arrayofmassactions = array();
if ($user->hasRight('accounting', 'chartofaccount')) {
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
}
// if ($permissiontoadd) { // test is always true
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
// }
if (in_array($massaction, array('presend', 'predelete', 'closed'))) {
$arrayofmassactions = array();
}
@ -471,20 +473,21 @@ if ($resql) {
$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
$moreforfilter = '';
if ($moreforfilter) {
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
print '</div>';
}
$accountstatic = new AccountingAccount($db);
$accountparent = new AccountingAccount($db);
$totalarray = array();
$totalarray['nbfield'] = 0;
$moreforfilter = '';
// if ($moreforfilter) {
// print '<div class="liste_titre liste_titre_bydiv centpercent">';
// print $moreforfilter;
// print '</div>';
// }
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
// print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<table class="tagtable liste">'."\n";
// Fields title search
// --------------------------------------------------------------------
@ -623,7 +626,7 @@ if ($resql) {
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="center nowraponall">';
if ($user->hasRight('accounting', 'chartofaccount')) {
// if ($permissiontoadd) { // test is always true
print '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
print img_edit();
print '</a>';
@ -632,14 +635,14 @@ if ($resql) {
print img_delete();
print '</a>';
print '&nbsp;';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
}
// }
print '</td>'."\n";
if (!$i) {
$totalarray['nbfield']++;
@ -779,7 +782,7 @@ if ($resql) {
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="center nowraponall">';
if ($user->hasRight('accounting', 'chartofaccount')) {
// if ($permissiontoadd) { // test is always true
print '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
print img_edit();
print '</a>';
@ -788,14 +791,14 @@ if ($resql) {
print img_delete();
print '</a>';
print '&nbsp;';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
}
// }
print '</td>'."\n";
if (!$i) {
$totalarray['nbfield']++;

View file

@ -775,10 +775,11 @@ class AccountancyCategory // extends CommonObject
*
* @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups
* @param int $active 1= active, 0=not active
* @param int $id_report id of the report
* @return never|array<array{rowid:string,code:string,label:string,formula:string,position:string,category_type:string,sens:string,bc:string}>|int Array of groups or -1 if error
* @see getCatsCpts(), getCptsCat()
*/
public function getCats($categorytype = -1, $active = 1)
public function getCats($categorytype = -1, $active = 1, $id_report = 1)
{
global $conf, $mysoc;
@ -790,6 +791,7 @@ class AccountancyCategory // extends CommonObject
$sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type, c.sens";
$sql .= " FROM ".$this->db->prefix().$this->table_element." as c";
$sql .= " WHERE c.active = " . (int) $active;
$sql .= " AND c.fk_report=".((int) $id_report);
$sql .= " AND c.entity = ".$conf->entity;
if ($categorytype >= 0) {
$sql .= " AND c.category_type = 1";

View file

@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 Alexandre Janniaux <alexandre.janniaux@gmail.com>
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Alexandre Janniaux <alexandre.janniaux@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -626,7 +626,9 @@ class Adherent extends CommonObject
$now = dol_now();
// Clean parameters
$this->import_key = trim($this->import_key);
if (isset($this->import_key)) {
$this->import_key = trim($this->import_key);
}
// Check parameters
if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEmail($this->email)) {

View file

@ -689,6 +689,12 @@ class Members extends DolibarrApi
throw new RestException(403);
}
$member = new Adherent($this->db);
$result = $member->fetch($id);
if (0 === $result) {
throw new RestException(404, 'Member not found');
}
$categories = new Categorie($this->db);
$result = $categories->getListForItem($id, 'member', $sortfield, $sortorder, $limit, $page);

View file

@ -136,6 +136,13 @@ if ($conf->use_javascript_ajax) {
$dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusExcluded"), $sumMembers['total']['members_excluded']);
$dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), $sumMembers['total']['members_resiliated']);
/**
* @var string $badgeStatus0
* @var string $badgeStatus1
* @var string $badgeStatus4
* @var string $badgeStatus6
* @var string $badgeStatus8
*/
include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';

View file

@ -390,7 +390,7 @@ foreach ($dirmodels as $reldir) {
// Default
print '<td class="center">';
if ($conf->global->BANKADDON_PDF == $name) {
if (getDolGlobalString('BANKADDON_PDF') == $name) {
print img_picto($langs->trans("Default"), 'on');
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
@ -499,13 +499,13 @@ print load_fiche_titre($langs->trans("Other"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td class="center width75">'.$langs->trans("Status")."</td>\n";
print '<td>'.$langs->trans("Parameter").'</td>';
print "<td></td>\n";
print "</tr>\n";
// Disable direct input
print '<tr class="oddeven">';
print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td><td></td>';
print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>';
if (getDolGlobalString('BANK_DISABLE_DIRECT_INPUT')) {
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
@ -517,9 +517,8 @@ if (getDolGlobalString('BANK_DISABLE_DIRECT_INPUT')) {
}
print '</tr>';
print '<tr class="oddeven"><td>';
print $langs->trans('AccountStatement');
print "</td><td>\n";
// Autofill bank statement
print '<tr class="oddeven"><td>'."\n";
print $langs->trans('AutoReportLastAccountStatement');
print '</td>';
// Active
@ -539,10 +538,9 @@ print "</tr>\n";
// Allow SEPA Mandate OnLine Sign
if (!getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT')) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("AllowOnLineSign").'</td>';
print '<td>'.$langs->trans("AllowOnLineSignDesc").'</td>';
print '<td>'.$form->textwithpicto($langs->trans("AllowOnLineSign"), $langs->trans("AllowOnLineSignDesc")).'</td>';
print '<td class="center">';
print ajax_constantonoff('SOCIETE_RIB_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1);
print ajax_constantonoff('SOCIETE_RIB_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->trans("WarningOnlineSignature"));
print '</td></tr>';
}

View file

@ -540,14 +540,18 @@ print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("AllowOnlineSign").'</td>';
print '<td class="right">';
if (getDolGlobalString('CONTRACT_ALLOW_ONLINESIGN')) {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=allowonlinesign&token='.newToken().'&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('CONTRACT_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->trans("WarningOnlineSignature"));
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=allowonlinesign&token='.newToken().'&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
if (getDolGlobalString('CONTRACT_ALLOW_ONLINESIGN')) {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=allowonlinesign&token='.newToken().'&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a>';
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=allowonlinesign&token='.newToken().'&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
}
}
print '</td>';
print '</tr>';

View file

@ -487,7 +487,7 @@ print '<tr class="oddeven">';
print '<td>'.$langs->trans("AllowOnLineSign");
print '</td>';
print '<td>';
print ajax_constantonoff('EXPEDITION_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1);
print ajax_constantonoff('EXPEDITION_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->trans("WarningOnlineSignature"));
print '</td></tr>';
print '</table>';

View file

@ -496,6 +496,9 @@ if (empty($reshook)) {
if ($field == 'content_lines') {
$_POST['content_lines'] = GETPOST('content_lines-'.$rowid, 'restricthtml');
}
if ($field == 'email_from') {
$_POST['email_from'] = GETPOST('email_from-'.$rowid, 'restricthtml');
}
if ($i) {
$sql .= ", ";
@ -1138,6 +1141,10 @@ if ($num) {
if (getDolGlobalString('MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES')) {
$fieldsforcontent[] = 'content_lines';
}
$parameters = array('fieldsforcontent' => &$fieldsforcontent, 'tabname' => $tabname[$id]);
$hookmanager->executeHooks('editEmailTemplateFieldsForContent', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
foreach ($fieldsforcontent as $tmpfieldlist) {
$showfield = 1;
$css = "left";

View file

@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
require_once DOL_DOCUMENT_ROOT.'/admin/remotestore/class/dolistore.class.php';
'
@ -745,7 +746,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
$moreforfilter = '<div class="valignmiddle">';
$moreforfilter .= '<div class="floatright right pagination paddingtop --module-list"><ul><li>';
$moreforfilter .= dolGetButtonTitle($langs->trans('CheckForModuleUpdate'), $langs->trans('CheckForModuleUpdate').'<br><br>'.img_warning('', '', 'paddingright').$langs->trans('CheckForModuleUpdateHelp').$langs->trans('CheckForModuleUpdateHelp'), 'fa fa-sync', $_SERVER["PHP_SELF"].'?action=checklastversion&token='.newToken().'&mode='.$mode.$param, '', 1, array('morecss' => 'reposition'));
$moreforfilter .= dolGetButtonTitle($langs->trans('CheckForModuleUpdate'), $langs->trans('CheckForModuleUpdate').'<br><br>'.img_warning('', '', 'paddingright').$langs->trans('CheckForModuleUpdateHelp').' '.$langs->trans('CheckForModuleUpdateHelp2', DolibarrModules::URL_FOR_BLACKLISTED_MODULES).'<br>'.$langs->trans("YourIPWillBeRevealedToThisExternalProviders"), 'fa fa-sync', $_SERVER["PHP_SELF"].'?action=checklastversion&token='.newToken().'&mode='.$mode.$param, '', 1, array('morecss' => 'reposition'));
$moreforfilter .= dolGetButtonTitleSeparator();
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', ($mode == 'common' ? 2 : 1), array('morecss' => 'reposition'));
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', ($mode == 'commonkanban' ? 2 : 1), array('morecss' => 'reposition'));

View file

@ -227,7 +227,7 @@ if (isModEnabled('propal')) {
*/
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), '');
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp"));
print '</td><td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL');
@ -259,7 +259,7 @@ if (isModEnabled('order')) {
print '<table summary="more" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), '');
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp"));
print '</td><td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_ORDER');
@ -373,7 +373,7 @@ if (isModEnabled('invoice')) {
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), '');
print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), $langs->trans("PdfAddTermOfSaleHelp"));
print '</td><td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_INVOICE');

View file

@ -677,7 +677,7 @@ print '</td></tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("AllowOnLineSign").'</td>';
print '<td class="center">';
print ajax_constantonoff('PROPOSAL_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1);
print ajax_constantonoff('PROPOSAL_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->trans("WarningOnlineSignature"));
print '</td></tr>';
@ -718,35 +718,21 @@ print '<center><input type="submit" class="button button-edit reposition" value=
print '</form>';
/*
* Directory
*/
print '<br>';
print load_fiche_titre($langs->trans("PathToDocuments"), '', '');
print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print " <td>".$langs->trans("Name")."</td>\n";
print " <td>".$langs->trans("Value")."</td>\n";
print "</tr>\n";
print "<tr class=\"oddeven\">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->propal->multidir_output[$conf->entity]."</td>\n</tr>\n";
print "</table>\n<br>";
print '<br><br>';
/*
* Notifications
* Other
*/
print load_fiche_titre($langs->trans("Notifications"), '', '');
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
print '<tr class="oddeven"><td colspan="2">';
print "<tr class=\"oddeven trfirstline\">\n <td>".$langs->trans("PathToDocuments")."</td>\n <td>".$conf->propal->multidir_output[$conf->entity]."</td>\n</tr>\n";
print '<tr class="oddeven lastline"><td>';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
print '</td><td class="right">';
print "</td></tr>\n";

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2017 Oscss-Shop <support@oscss-shop.fr>.
* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
/* Copyright (C) 2017 Oscss-Shop <support@oscss-shop.fr>.
* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020-2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modifyion 2.0 (the "License");
* it under the terms of the GNU General Public License as published bypliance with the License.

View file

@ -26,7 +26,6 @@
*/
class Documentation
{
/**
* Views
*
@ -206,7 +205,7 @@ class Documentation
*/
public function docFooter()
{
global $conf, $langs;
global $langs;
// DIV FOR SCROLL ANIMATION
print '<div id="documentation-scrollwrapper">';
@ -320,9 +319,6 @@ class Documentation
*/
public function showSummary($showsubmenu = 1, $showsubmenu_summary = 1)
{
global $langs;
$i = 0;
if (!empty($this->view)) :
// On se place au bon niveau

View file

@ -62,7 +62,7 @@ $documentation->showSidebar(); ?>
<div class="doc-content-wrapper">
<h1 class="documentation-title"><?php echo $langs->trans('DocTableTitle'); ?></h1>
<p class="documentation-text"><?php echo $langs->trans('DocTableMainDescription'); ?></p>
<p class="documentation-text"><?php echo $langs->trans('Description'); ?></p>
<!-- Summary -->
<?php $documentation->showSummary(); ?>
@ -70,37 +70,37 @@ $documentation->showSidebar(); ?>
<!-- Basic usage -->
<div class="documentation-section" id="tablesection-basicusage">
<h2 class="documentation-title"><?php echo $langs->trans('DocTableBasic'); ?></h2>
<h2 class="documentation-title">Table with a title line</h2>
<p class="documentation-text"><?php echo $langs->trans('DocTableBasicDescription'); ?></p>
<div class="documentation-example">
<div class="div-table-responsive">
<table class="tagtable nobottomiftotal noborder liste">
<table class="tagtable noborder liste nobottomiftotal">
<tr class="liste_titre">
<th class="wrapcolumntitle left liste_titre" title="First Name">First Name</th>
<th class="wrapcolumntitle left liste_titre" title="Last Name">Last Name</th>
<th class="wrapcolumntitle center liste_titre" title="Age">Age</th>
<th class="wrapcolumntitle right liste_titre" title="Country">Country</th>
</tr>
<tr>
<tr class="oddeven">
<td class="left">John</td>
<td class="left">Doe</td>
<td class="center">37</td>
<td class="right">U.S.A</td>
</tr>
<tr>
<tr class="oddeven">
<td class="left">Jack</td>
<td class="left">Sparrow</td>
<td class="center">29</td>
<td class="right">Caribbean</td>
</tr>
<tr>
<tr class="oddeven">
<td class="left">Sacha</td>
<td class="left">Ketchum</td>
<td class="center">16</td>
<td class="right">Kanto</td>
</tr>
<tr>
<tr class="oddeven">
<td class="left">Albert</td>
<td class="left">Einstein</td>
<td class="center">72</td>
@ -115,15 +115,15 @@ $documentation->showSidebar(); ?>
echo $documentation->showCode($lines); ?>
</div>
<!-- Basic usage -->
<!-- Table with filters -->
<div class="documentation-section" id="tablesection-withfilters">
<h2 class="documentation-title"><?php echo $langs->trans('DocTableWithFilters'); ?></h2>
<h2 class="documentation-title">Table with a filter line and title line</h2>
<p class="documentation-text"><?php echo $langs->trans('DocTableWithFiltersDescription'); ?></p>
<div class="documentation-example">
<div class="div-table-responsive">
<table class="tagtable nobottomiftotal liste">
<table class="tagtable noborder nobottomiftotal liste">
<tr class="liste_titre_filter">
<td><input></td>
<td></td>
@ -136,25 +136,25 @@ $documentation->showSidebar(); ?>
<th class="wrapcolumntitle center liste_titre" title="Age">Age</th>
<th class="wrapcolumntitle right liste_titre" title="Country">Country</th>
</tr>
<tr>
<tr class="oddeven">
<td class="left">John</td>
<td class="left">Doe</td>
<td class="center">37</td>
<td class="right">U.S.A</td>
</tr>
<tr>
<tr class="oddeven">
<td class="left">Jack</td>
<td class="left">Sparrow</td>
<td class="center">29</td>
<td class="right">Caribbean</td>
</tr>
<tr>
<tr class="oddeven">
<td class="left">Sacha</td>
<td class="left">Ketchum</td>
<td class="center">16</td>
<td class="right">Kanto</td>
</tr>
<tr>
<tr class="oddeven">
<td class="left">Albert</td>
<td class="left">Einstein</td>
<td class="center">72</td>
@ -170,6 +170,48 @@ $documentation->showSidebar(); ?>
</div>
<!-- Table with no filter and no title line -->
<div class="documentation-section" id="tablesection-withfilters">
<h2 class="documentation-title">Table with no filter, no title line</h2>
<p class="documentation-text"><?php echo $langs->trans('Description'); ?></p>
<div class="documentation-example">
<div class="div-table-responsive">
<table class="tagtable noborder nobottomiftotal liste">
<tr class="oddeven trfirstline">
<td class="left">John</td>
<td class="left">Doe</td>
<td class="center">37</td>
<td class="right">U.S.A</td>
</tr>
<tr class="oddeven">
<td class="left">Jack</td>
<td class="left">Sparrow</td>
<td class="center">29</td>
<td class="right">Caribbean</td>
</tr>
<tr class="oddeven">
<td class="left">Sacha</td>
<td class="left">Ketchum</td>
<td class="center">16</td>
<td class="right">Kanto</td>
</tr>
<tr class="oddeven trlastline">
<td class="left">Albert</td>
<td class="left">Einstein</td>
<td class="center">72</td>
<td class="right">Germany</td>
</tr>
</table>
</div>
</div>
<?php
$lines = array(
);
echo $documentation->showCode($lines); ?>
</div>
</div>
</div>

View file

@ -148,12 +148,14 @@ $head = user_admin_prepare_head();
print dol_get_fiche_head($head, 'card', $langs->trans("MenuUsersAndGroups"), -1, 'user');
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
print '<td align="center" width="100"></td>'."\n";
print '</tr>';

View file

@ -882,6 +882,10 @@ class Asset extends CommonObject
return -1;
}
if (! empty($this->not_depreciated)) {
return 1;
}
// Get depreciation options
//---------------------------
require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php';

View file

@ -94,7 +94,8 @@ class AssetModel extends CommonObject
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,),
'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'position' => 25, 'notnull' => 0, 'visible' => 0),
'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,),

View file

@ -484,7 +484,9 @@ class Categorie extends CommonObject
$this->description = trim($this->description);
$this->color = trim($this->color);
$this->position = (int) $this->position;
$this->import_key = trim($this->import_key);
if (isset($this->import_key)) {
$this->import_key = trim($this->import_key);
}
$this->ref_ext = trim($this->ref_ext);
if (empty($this->visible)) {
$this->visible = 0;
@ -1103,7 +1105,7 @@ class Categorie extends CommonObject
return -1;
}
if (!count($categories)) {
return 0;
return [];
}
return $categories;

View file

@ -634,7 +634,7 @@ if ($type == Categorie::TYPE_CUSTOMER) {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>';
print $langs->trans("AddCustomerIntoCategory").' &nbsp;';
$filter = '(s.client:IN:1,3)';
$filter = '(s.client:IN:1,2,3)';
print $form->select_company('', 'elemid', $filter);
print '<input type="submit" class="reposition button buttongen" name="addintocategory" value="'.$langs->trans("ClassifyInCategory").'"></td>';
print '</tr>';

View file

@ -367,6 +367,8 @@ if (empty($reshook) && $action == 'add' && $usercancreate) {
$object->type_code = GETPOST('actioncode', 'aZ09');
}
$listofresourceid = array();
if (!$error) {
// Initialisation of object actioncomm
$object->priority = GETPOSTISSET("priority") ? GETPOSTINT("priority") : 0;
@ -430,6 +432,11 @@ if (empty($reshook) && $action == 'add' && $usercancreate) {
if (!empty($_SESSION['assignedtouser'])) {
$listofuserid = json_decode($_SESSION['assignedtouser'], true);
}
if (!empty($_SESSION['assignedtoresource'])) {
$listofresourceid = json_decode($_SESSION['assignedtoresource'], true);
}
$i = 0;
foreach ($listofuserid as $key => $value) {
if ($i == 0) { // First entry
@ -541,6 +548,74 @@ if (empty($reshook) && $action == 'add' && $usercancreate) {
if ($idaction > 0) {
if (!$object->error) {
if (is_array($listofresourceid) && count($listofresourceid)) {
foreach ($listofresourceid as $resource_id => $val) {
$resource_type = 'dolresource';
$busy = 1;//GETPOSTINT('busy');
// Resources association
if (getDolGlobalString('RESOURCE_USED_IN_EVENT_CHECK')) {
$eventDateStart = $object->datep;
$eventDateEnd = $object->datef;
$isFullDayEvent = $object->fulldayevent;
if (empty($eventDateEnd)) {
if ($isFullDayEvent) {
$eventDateStartArr = dol_getdate($eventDateStart);
$eventDateStart = dol_mktime(0, 0, 0, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']);
$eventDateEnd = dol_mktime(23, 59, 59, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']);
}
}
$sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label";
$sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($resource_type) . "'";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'";
$sql .= " WHERE er.resource_id = " . ((int) $resource_id);
$sql .= " AND er.busy = 1";
$sql .= " AND (";
// event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end)
$sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))";
// event date end between ac.datep and ac.datep2
if (!empty($eventDateEnd)) {
$sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))";
}
// event date start before ac.datep and event date end after ac.datep2
$sql .= " OR (";
$sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'";
if (!empty($eventDateEnd)) {
$sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')";
}
$sql .= ")";
$sql .= ")";
$resql = $db->query($sql);
if (!$resql) {
$error++;
$object->error = $db->lasterror();
$object->errors[] = $object->error;
} else {
if ($db->num_rows($resql) > 0) {
// Resource already in use
$error++;
$object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : ';
while ($obj = $db->fetch_object($resql)) {
$object->error .= '<br> - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']');
}
$object->errors[] = $object->error;
}
$db->free($resql);
}
}
if (!$error) {
$res = $object->add_element_resource($resource_id, $resource_type, $busy, $val['mandatory']);
}
}
}
unset($_SESSION['assignedtoresource']);
// Category association
$categories = GETPOST('categories', 'array');
$object->setCategories($categories);
@ -2148,6 +2223,7 @@ if ($id > 0) {
// Related contact
print '<tr><td>'.$langs->trans("ActionOnContact").'</td><td>';
print '<div class="maxwidth200onsmartphone">';
print img_picto('', 'contact', 'class="paddingrightonly"');
if (getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT') && $conf->use_javascript_ajax) {
// FIXME Use the select_contact supporting the "multiple"

View file

@ -1411,9 +1411,9 @@ if (count($listofextcals)) {
$event->datep = $datestart + $usertime;
$event->datef = $dateend + $usertime;
if ($icalevent['SUMMARY']) {
if (isset($icalevent['SUMMARY']) && $icalevent['SUMMARY']) {
$event->label = dol_string_nohtmltag($icalevent['SUMMARY']);
} elseif ($icalevent['DESCRIPTION']) {
} elseif (isset($icalevent['DESCRIPTION']) && $icalevent['DESCRIPTION']) {
$event->label = dol_nl2br(dol_string_nohtmltag($icalevent['DESCRIPTION']), 1);
} else {
$event->label = $langs->trans("ExtSiteNoLabel");

View file

@ -927,9 +927,9 @@ if ($object->id > 0) {
$filedir = $conf->propal->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
if (is_array($file_list) && !empty($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
@ -1046,9 +1046,9 @@ if ($object->id > 0) {
$filedir = $conf->commande->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
if (is_array($file_list) && !empty($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
@ -1147,9 +1147,9 @@ if ($object->id > 0) {
$filedir = $conf->expedition->multidir_output[$objp->entity].'/sending/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
if (is_array($file_list) && !empty($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
@ -1261,9 +1261,9 @@ if ($object->id > 0) {
$filedir = $conf->contrat->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
if (is_array($file_list) && !empty($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
@ -1361,9 +1361,9 @@ if ($object->id > 0) {
$filedir = $conf->ficheinter->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
if (is_array($file_list) && !empty($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
@ -1590,9 +1590,9 @@ if ($object->id > 0) {
$filedir = $conf->facture->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
if (is_array($file_list) && !empty($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {

View file

@ -402,8 +402,8 @@ class Propal extends CommonObject
'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_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 220),
'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => 'isModEnabled("incoterm")', '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),

View file

@ -171,7 +171,7 @@ print '<div class="fichetwothirdright">';
* Last modified proposals
*/
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, date_cloture as datec, c.tms as datem,";
$sql = "SELECT c.rowid, c.entity, c.ref, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status, date_cloture as datec, c.tms as datem,";
$sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta as code_compta_client";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as c,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
@ -211,6 +211,9 @@ if ($resql) {
$propalstatic->id = $obj->rowid;
$propalstatic->ref = $obj->ref;
$propalstatic->total_ht = $obj->total_ht;
$propalstatic->total_tva = $obj->total_tva;
$propalstatic->total_ttc = $obj->total_ttc;
$companystatic->id = $obj->socid;
$companystatic->name = $obj->socname;
@ -263,7 +266,7 @@ if ($resql) {
*/
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
$sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta as code_compta_client,";
$sql .= " p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql .= " p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.total_tva, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,";
$sql .= " ".MAIN_DB_PREFIX."propal as p";
$sql .= " WHERE p.fk_soc = s.rowid";
@ -302,6 +305,9 @@ if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
$propalstatic->id = $obj->propalid;
$propalstatic->ref = $obj->ref;
$propalstatic->total_ht = $obj->total_ht;
$propalstatic->total_tva = $obj->total_tva;
$propalstatic->total_ttc = $obj->total_ttc;
$companystatic->id = $obj->socid;
$companystatic->name = $obj->socname;

View file

@ -97,18 +97,12 @@ $formother = new FormOther($db);
$langs->loadLangs(array('propal', 'other', 'companies'));
$picto = null;
$dir = null;
$cat_type = null;
$cat_label = null;
$picto = 'propal';
$title = $langs->trans("ProposalsStatistics");
$dir = $conf->propal->dir_temp;
$cat_type = Categorie::TYPE_CUSTOMER;
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
if ($mode == 'customer') {
$picto = 'propal';
$title = $langs->trans("ProposalsStatistics");
$dir = $conf->propal->dir_temp;
$cat_type = Categorie::TYPE_CUSTOMER;
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
}
if ($mode == 'supplier') {
$picto = 'supplier_proposal';
$title = $langs->trans("ProposalsStatisticsSuppliers");

View file

@ -62,7 +62,7 @@ if ($socid > 0) {
$societe->fetch($socid);
/*
* Affichage onglets
* Show tabs
*/
$head = societe_prepare_head($societe);

View file

@ -987,17 +987,17 @@ if (empty($reshook)) {
// Set unit price to use
if (!empty($price_ht) || $price_ht === '0') {
$pu_ht = price2num($price_ht, 'MU');
$pu_ttc = price2num((float) $pu_ht * (1 + ($tmpvat / 100)), 'MU');
$pu_ht = (float) price2num($price_ht, 'MU');
$pu_ttc = (float) price2num((float) $pu_ht * (1 + ($tmpvat / 100)), 'MU');
} elseif (!empty($price_ttc) || $price_ttc === '0') {
$pu_ttc = price2num($price_ttc, 'MU');
$pu_ht = price2num((float) $pu_ttc / (1 + ($tmpvat / 100)), 'MU');
$pu_ttc = (float) price2num($price_ttc, 'MU');
$pu_ht = (float) price2num((float) $pu_ttc / (1 + ($tmpvat / 100)), 'MU');
} elseif ($tmpvat != $tmpprodvat) {
// Is this still used ?
if ($price_base_type != 'HT') {
$pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
$pu_ht = (float) price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
} else {
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
$pu_ttc = (float) price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
}
}

View file

@ -304,9 +304,8 @@ $head[$h][1] = $langs->trans("ByMonthYear");
$head[$h][2] = 'byyear';
$h++;
if ($mode == 'customer') {
$type = 'order_stats';
}
$type = 'order_stats';
if ($mode == 'supplier') {
$type = 'supplier_order_stats';
}

View file

@ -174,7 +174,8 @@ if ($user->hasRight('banque', 'modifier') && $action == "update") {
$sql .= " SET ";
// Always opened
if (GETPOSTISSET('value')) {
$sql .= " fk_type='".$db->escape(GETPOST('value'))."',";
$type = GETPOST('value');
$sql .= " fk_type='".$db->escape(empty($type) && $object->fk_type == 'SOLD' ? 'SOLD' : $type)."',";
}
if (GETPOSTISSET('num_chq')) {
$sql .= " num_chq='".$db->escape(GETPOST("num_chq"))."',";

View file

@ -280,6 +280,9 @@ $theoricalnbofinvoiceforterminal = array();
llxHeader('', $langs->trans("CashControl"));
$terminalid = '';
$terminaltouse = '';
if ($action == "create" || $action == "start" || $action == 'close') {
if ($action == 'close') {
$posmodule = $object->posmodule;
@ -305,7 +308,7 @@ if ($action == "create" || $action == "start" || $action == 'close') {
}
}
if (isset($terminalid) && $terminalid != '') {
if (isset($terminalid) && $terminalid != '' && isset($posmodule)) {
// Calculate $initialbalanceforterminal for terminal 0
foreach ($arrayofpaymentmode as $key => $val) {
if ($key != 'cash') {

View file

@ -166,7 +166,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
$sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
$sql .= ")";
}
if (preg_match('/^cs\./', $sortfield) || preg_match('/^c\./', $sortfield) || preg_match('/^pc\./', $sortfield) || preg_match('/^pct\./', $sortfield)) {
if (preg_match('/^(cs?|pct?)\./', (string) $sortfield)) {
$sql .= $db->order($sortfield, $sortorder);
}
//$sql.= $db->plimit($limit+1,$offset);
@ -310,7 +310,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
// so we are compatible when period is not mandatory
$sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
}
if (preg_match('/^pv\./', $sortfield) || preg_match('/^ptva\./', $sortfield)) {
if (preg_match('/^(pv|ptva)\./', (string) $sortfield)) {
$sql .= $db->order($sortfield, $sortorder);
}
@ -465,7 +465,7 @@ while ($j < $numlt) {
// so we are compatible when period is not mandatory
$sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
}
if (preg_match('/^pv/', $sortfield)) {
if (preg_match('/^pv/', (string) $sortfield)) {
$sql .= $db->order($sortfield, $sortorder);
}

View file

@ -176,6 +176,7 @@ if (!$mesg) {
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
$filename_avg = '';
$fileurl_avg = '';
if (!$user->hasRight('societe', 'client', 'voir')) {
$filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png';
if ($mode == 'customer') {

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -227,15 +228,15 @@ if ($object->id > 0) {
//$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
//$morehtmlstatus .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2);
if (isModEnabled('agenda')) {
/*
if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
$morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
} else {
$morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0);
}
*/
//if (isModEnabled('agenda')) {
/*
if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
$morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
} else {
$morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0);
}
*/
//}
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {

View file

@ -1172,19 +1172,19 @@ class FactureRec extends CommonInvoice
}
// Clean parameters
$remise_percent = price2num($remise_percent);
$qty = price2num($qty);
$remise_percent = (float) price2num($remise_percent);
$qty = (float) price2num($qty);
if (empty($info_bits)) {
$info_bits = 0;
}
$pu_ht = price2num($pu_ht);
$pu_ttc = price2num($pu_ttc);
$pu_ht_devise = price2num($pu_ht_devise);
$pu_ht = (float) price2num($pu_ht);
$pu_ttc = (float) price2num($pu_ttc);
$pu_ht_devise = (float) price2num($pu_ht_devise);
if (!preg_match('/\((.*)\)/', (string) $txtva)) {
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
}
$txlocaltax1 = price2num($txlocaltax1);
$txlocaltax2 = price2num($txlocaltax2);
$txlocaltax1 = price2num($txlocaltax1);
$txlocaltax2 = price2num($txlocaltax2);
if (empty($txlocaltax1)) {
$txlocaltax1 = 0;
}

View file

@ -361,15 +361,15 @@ class Facture extends CommonInvoice
'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),
'situation_cycle_ref' => array('type' => 'smallint(6)', 'label' => 'Situation cycle ref', 'enabled' => 'getDolGlobalInt("INVOICE_USE_SITUATION")', 'visible' => -1, 'position' => 230),
'situation_counter' => array('type' => 'smallint(6)', 'label' => 'Situation counter', 'enabled' => 'getDolGlobalInt("INVOICE_USE_SITUATION")', 'visible' => -1, 'position' => 235),
'situation_final' => array('type' => 'smallint(6)', 'label' => 'Situation final', 'enabled' => 'getDolGlobalInt("INVOICE_USE_SITUATION")', 'visible' => -1, 'position' => 240),
'retained_warranty' => array('type' => 'double', 'label' => 'Retained warranty', 'enabled' => 'getDolGlobalString("INVOICE_USE_RETAINED_WARRANTY")', 'visible' => -1, 'position' => 245),
'retained_warranty_date_limit' => array('type' => 'date', 'label' => 'Retained warranty date limit', 'enabled' => 'getDolGlobalString("INVOICE_USE_RETAINED_WARRANTY")', 'visible' => -1, 'position' => 250),
'retained_warranty_fk_cond_reglement' => array('type' => 'integer', 'label' => 'Retained warranty fk cond reglement', 'enabled' => 'getDolGlobalString("INVOICE_USE_RETAINED_WARRANTY")', 'visible' => -1, 'position' => 255),
'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 260),
'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 265),
'date_pointoftax' => array('type' => 'date', 'label' => 'DatePointOfTax', 'enabled' => 'getDolGlobalString("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),
@ -2572,7 +2572,7 @@ class Facture extends CommonInvoice
$sql .= " localtax2=".(isset($this->total_localtax2) ? (float) $this->total_localtax2 : "null").",";
$sql .= " total_ht=".(isset($this->total_ht) ? (float) $this->total_ht : "null").",";
$sql .= " total_ttc=".(isset($this->total_ttc) ? (float) $this->total_ttc : "null").",";
$sql .= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '') ? (int) $this->revenuestamp : "null").",";
$sql .= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '') ? (float) $this->revenuestamp : "null").",";
$sql .= " fk_statut=".(isset($this->status) ? (int) $this->status : "null").",";
$sql .= " fk_user_valid=".(isset($this->fk_user_valid) ? (int) $this->fk_user_valid : "null").",";
$sql .= " fk_facture_source=".(isset($this->fk_facture_source) ? (int) $this->fk_facture_source : "null").",";
@ -3634,7 +3634,7 @@ class Facture extends CommonInvoice
$this->date_validation = $now;
$i = 0;
if (getDolGlobalString('INVOICE_USE_SITUATION')) {
if (getDolGlobalInt('INVOICE_USE_SITUATION')) {
$final = true;
$nboflines = count($this->lines);
while (($i < $nboflines) && $final) {

View file

@ -6,6 +6,7 @@
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2023 Christian Foellmann <christian@foellmann.de>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -63,7 +64,7 @@ if ($user->socid) {
$object = new Facture($db);
// Load object
if ($id > 0 || !empty($ref)) {
$ret = $object->fetch($id, $ref, '', '', (getDolGlobalString('INVOICE_USE_SITUATION') ? $conf->global->INVOICE_USE_SITUATION : 0));
$ret = $object->fetch($id, $ref, '', 0, getDolGlobalInt('INVOICE_USE_SITUATION'));
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('invoicecontactcard', 'globalcard'));
@ -77,7 +78,7 @@ $usercancreate = $user->hasRight("facture", "creer");
* Actions
*/
$parameters = array('id'=>$id);
$parameters = array('id' => $id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

View file

@ -927,7 +927,7 @@ while ($i < $imaxinloop) {
// Payment term
if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
print '<td class="tdoverflowmax150">';
$form->form_conditions_reglement('', $objp->fk_cond_reglement, 'none');
$form->form_conditions_reglement(0, $objp->fk_cond_reglement, 'none');
print '</td>'."\n";
if (!$i) {
$totalarray['nbfield']++;

View file

@ -570,6 +570,8 @@ if ($action == 'makepayment_confirm' && $user->hasRight('facture', 'paiement'))
$result_sql = $db->query($rsql);
if ($result_sql) {
$numprlv = $db->num_rows($result_sql);
} else {
$numprlv = 0;
}
if ($numprlv > 0) {
@ -633,9 +635,11 @@ if ($socid > 0) {
if (empty($search_company)) {
$search_company = $soc->name;
}
} else {
$soc = null;
}
$title = $langs->trans('BillsCustomers').' '.($socid > 0 ? ' - '.$soc->name : '');
$title = $langs->trans('BillsCustomers').' '.(($socid > 0 && $soc !== null) ? ' - '.$soc->name : '');
$help_url = 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes';
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
@ -1341,7 +1345,7 @@ if (isModEnabled('category') && $user->hasRight("categorie", "lire") && ($user->
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag');
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 0, 0, 1);
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1);
$moreforfilter .= '</div>';
}
@ -1509,7 +1513,7 @@ if (!empty($arrayfields['state.nom']['checked'])) {
// Country
if (!empty($arrayfields['country.code_iso']['checked'])) {
print '<td class="liste_titre center">';
print $form->select_country($search_country, 'search_country', '', 0, 'minwidth150imp maxwidth150', 'code2', 1, 0, 1, null, 1);
print $form->select_country($search_country, 'search_country', '', 0, 'minwidth150imp maxwidth150', 'code2', 1, 0, 1, array(), 1);
print '</td>';
}
// Company type
@ -2051,10 +2055,10 @@ if ($num > 0) {
$multicurrency_remaintopay = 0;
}
if ($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) { // If credit note closed, we take into account the amount not yet consumed
$remaincreditnote = $discount->getAvailableDiscounts($companystatic, '', 'rc.fk_facture_source='.$facturestatic->id);
$remaincreditnote = $discount->getAvailableDiscounts($companystatic, null, 'rc.fk_facture_source='.$facturestatic->id);
$remaintopay = -$remaincreditnote;
$totalallpayments = price2num($facturestatic->total_ttc - $remaintopay);
$multicurrency_remaincreditnote = $discount->getAvailableDiscounts($companystatic, '', 'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1);
$multicurrency_remaincreditnote = $discount->getAvailableDiscounts($companystatic, null, 'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1);
$multicurrency_remaintopay = -$multicurrency_remaincreditnote;
$multicurrency_totalpay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_remaintopay);
}
@ -2146,7 +2150,9 @@ if ($num > 0) {
}
$filename = dol_sanitizeFileName($obj->ref);
$filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($obj->ref);
$filepath = $conf->invoice->multidir_output[$obj->entity] ?? $conf->invoice->dir_output;
$filedir = $filepath.'/'.$filename;
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->id;
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '</td>';

View file

@ -5,6 +5,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -54,7 +55,7 @@ $action = GETPOST('action', 'aZ09');
$object = new Facture($db);
// Load object
if ($id > 0 || !empty($ref)) {
$object->fetch($id, $ref, '', '', (getDolGlobalString('INVOICE_USE_SITUATION') ? $conf->global->INVOICE_USE_SITUATION : 0));
$object->fetch($id, $ref, '', 0, getDolGlobalInt('INVOICE_USE_SITUATION'));
}
$permissionnote = $user->hasRight('facture', 'creer'); // Used by the include of actions_setnotes.inc.php

View file

@ -75,6 +75,7 @@ if ($type == 'bank-transfer') {
}
// Load object
$isdraft = 1;
if ($id > 0 || !empty($ref)) {
$ret = $object->fetch($id, $ref);
$isdraft = (($object->status == FactureFournisseur::STATUS_DRAFT) ? 1 : 0);
@ -310,8 +311,8 @@ if ($object->id > 0) {
$filtercreditnote = "fk_invoice_supplier_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS PAID)%')";
}
$absolute_discount = $object->thirdparty->getAvailableDiscounts('', $filterabsolutediscount, 0, 1);
$absolute_creditnote = $object->thirdparty->getAvailableDiscounts('', $filtercreditnote, 0, 1);
$absolute_discount = $object->thirdparty->getAvailableDiscounts(null, $filterabsolutediscount, 0, 1);
$absolute_creditnote = $object->thirdparty->getAvailableDiscounts(null, $filtercreditnote, 0, 1);
$absolute_discount = price2num($absolute_discount, 'MT');
$absolute_creditnote = price2num($absolute_creditnote, 'MT');
} else {
@ -323,8 +324,8 @@ if ($object->id > 0) {
$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
}
$absolute_discount = $object->thirdparty->getAvailableDiscounts('', $filterabsolutediscount);
$absolute_creditnote = $object->thirdparty->getAvailableDiscounts('', $filtercreditnote);
$absolute_discount = $object->thirdparty->getAvailableDiscounts(null, $filterabsolutediscount);
$absolute_creditnote = $object->thirdparty->getAvailableDiscounts(null, $filtercreditnote);
$absolute_discount = price2num($absolute_discount, 'MT');
$absolute_creditnote = price2num($absolute_creditnote, 'MT');
}
@ -821,7 +822,7 @@ if ($object->id > 0) {
print img_warning('Error on default bank number for IBAN : '.$langs->trans($companyBankAccount->error));
}
} elseif ($numopen || ($type != 'bank-transfer' && $object->mode_reglement_code == 'PRE') || ($type == 'bank-transfer' && $object->mode_reglement_code == 'VIR')) {
print img_warning($langs->trans("NoDefaultIBANFound"));
print img_warning($langs->trans("NoDefaultIBANFound"));
}
//print '</td></tr>';

View file

@ -142,6 +142,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
//var_dump($data);
$filenamenb = $dir."/invoicesnbinyear-".$year.".png";
$fileurlnb = '';
if ($mode == 'customer') {
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png';
}
@ -178,6 +179,7 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear);
// $data = array(array('Lib',val1,val2,val3),...)
$filenameamount = $dir."/invoicesamountinyear-".$year.".png";
$fileurlamount = '';
if ($mode == 'customer') {
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesamountinyear-'.$year.'.png';
}
@ -212,6 +214,7 @@ if (!$mesg) {
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
$fileurl_avg = '';
if (!$user->hasRight('societe', 'client', 'voir')) {
$filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png';
if ($mode == 'customer') {
@ -318,6 +321,8 @@ print '</td></tr>';
// Category
if (isModEnabled('category')) {
$cat_type = '';
$cat_label = '';
if ($mode == 'customer') {
$cat_type = Categorie::TYPE_CUSTOMER;
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
@ -327,7 +332,7 @@ if (isModEnabled('category')) {
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier"));
}
print '<tr><td>'.$cat_label.'</td><td>';
$cate_arbo = $form->select_all_categories($cat_type, null, 'parent', null, null, 1);
$cate_arbo = $form->select_all_categories($cat_type, '', 'parent', 0, 0, 1);
print img_picto('', 'category', 'class="pictofixedwidth"');
print $form->multiselectarray('select_categ_categ_id', $cate_arbo, GETPOST('select_categ_categ_id', 'array'), 0, 0, 'widthcentpercentminusx maxwidth300');
//print $formother->select_categories($cat_type, $categ_id, 'categ_id', true);

View file

@ -147,6 +147,8 @@ if (in_array($db->type, array('mysql', 'mysqli'))) {
$db->query('SET SQL_BIG_SELECTS=1');
}
$tabfac = array();
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
@ -154,7 +156,6 @@ if ($result) {
$cptfour = ((getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') != "") ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"));
$cpttva = (getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT') ? $conf->global->ACCOUNTING_VAT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$tabfac = array();
$tabht = array();
$tabtva = array();
$tabttc = array();

View file

@ -161,9 +161,10 @@ if (in_array($db->type, array('mysql', 'mysqli'))) {
$db->query('SET SQL_BIG_SELECTS=1');
}
$tabfac = array();
$result = $db->query($sql);
if ($result) {
$tabfac = array();
$tabht = array();
$tabtva = array();
$tablocaltax1 = array();

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -118,6 +119,8 @@ if ($action == 'delete' && $permissiontodelete) {
if ($result > 0) {
$result = $accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing)
}
} else {
$accountline = null;
}
if ($result >= 0) {
@ -125,7 +128,7 @@ if ($action == 'delete' && $permissiontodelete) {
header("Location: ".DOL_URL_ROOT.'/compta/localtax/list.php?localTaxType='.$object->ltt);
exit;
} else {
$object->error = $accountline->error;
$object->error = $accountline !== null ? $accountline->error : "No account line / no bank identified found";
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
}

View file

@ -57,6 +57,7 @@ if (empty($year)) {
}
$date_start = dol_mktime(0, 0, 0, GETPOSTINT("date_startmonth"), GETPOSTINT("date_startday"), GETPOSTINT("date_startyear"));
$date_end = dol_mktime(23, 59, 59, GETPOSTINT("date_endmonth"), GETPOSTINT("date_endday"), GETPOSTINT("date_endyear"));
$q = 0;
// Quarter
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
$q = GETPOST("q");
@ -124,7 +125,12 @@ if (empty($local)) {
accessforbidden('Parameter localTaxType is missing');
}
$builddate = dol_now();
$calc = 0;
$calcmode = "Unknown";
$find = '';
$replace = '';
$period = '';
/*
* View
*/
@ -203,6 +209,9 @@ $vatsup = $langs->transcountry($local == 1 ? "LT1" : "LT2", $mysoc->country_code
print '<div class="div-table-responsive">';
print '<table class="liste noborder centpercent">';
$x_coll_sum = 0; // Initialize value
$x_paye_sum = 0; // Initialize value
// IRPF that the customer has retained me
if ($calc == 0 || $calc == 2) {
print '<tr class="liste_titre">';
@ -231,11 +240,11 @@ if ($calc == 0 || $calc == 2) {
$total = 0;
$totalamount = 0;
$i = 1;
foreach ($coll_list as $coll) {
if (($min == 0 || ($min > 0 && $coll->amount > $min)) && ($local == 1 ? $coll->localtax1 : $coll->localtax2) != 0) {
$intra = str_replace($find, $replace, $coll->tva_intra);
foreach ($coll_list as $coll_obj) {
if (($min == 0 || ($min > 0 && $coll_obj->amount > $min)) && ($local == 1 ? $coll_obj->localtax1 : $coll_obj->localtax2) != 0) {
$intra = str_replace($find, $replace, $coll_obj->tva_intra);
if (empty($intra)) {
if ($coll->assuj == '1') {
if ($coll_obj->assuj == '1') {
$intra = $langs->trans('Unknown');
} else {
$intra = '';
@ -243,16 +252,16 @@ if ($calc == 0 || $calc == 2) {
}
print '<tr class="oddeven">';
print '<td class="nowrap">'.$i."</td>";
$company_static->id = $coll->socid;
$company_static->name = $coll->name;
$company_static->id = $coll_obj->socid;
$company_static->name = $coll_obj->name;
print '<td class="nowrap">'.$company_static->getNomUrl(1).'</td>';
$find = array(' ', '.');
$replace = array('', '');
print '<td class="nowrap">'.$intra.'</td>';
print '<td class="nowrap right">'.price($coll->amount).'</td>';
print '<td class="nowrap right">'.price($local == 1 ? $coll->localtax1 : $coll->localtax2).'</td>';
$totalamount += $coll->amount;
$total += ($local == 1 ? $coll->localtax1 : $coll->localtax2);
print '<td class="nowrap right">'.price($coll_obj->amount).'</td>';
print '<td class="nowrap right">'.price($local == 1 ? $coll_obj->localtax1 : $coll_obj->localtax2).'</td>';
$totalamount += $coll_obj->amount;
$total += ($local == 1 ? $coll_obj->localtax1 : $coll_obj->localtax2);
print "</tr>\n";
$i++;
}
@ -296,11 +305,11 @@ if ($calc == 0 || $calc == 1) {
$total = 0;
$totalamount = 0;
$i = 1;
foreach ($coll_list as $coll) {
if (($min == 0 || ($min > 0 && $coll->amount > $min)) && ($local == 1 ? $coll->localtax1 : $coll->localtax2) != 0) {
$intra = str_replace($find, $replace, $coll->tva_intra);
foreach ($coll_list as $coll_obj) {
if (($min == 0 || ($min > 0 && $coll_obj->amount > $min)) && ($local == 1 ? $coll_obj->localtax1 : $coll_obj->localtax2) != 0) {
$intra = str_replace($find, $replace, $coll_obj->tva_intra);
if (empty($intra)) {
if ($coll->assuj == '1') {
if ($coll_obj->assuj == '1') {
$intra = $langs->trans('Unknown');
} else {
$intra = '';
@ -308,16 +317,16 @@ if ($calc == 0 || $calc == 1) {
}
print '<tr class="oddeven">';
print '<td class="nowrap">'.$i."</td>";
$company_static->id = $coll->socid;
$company_static->name = $coll->name;
$company_static->id = $coll_obj->socid;
$company_static->name = $coll_obj->name;
print '<td class="nowrap">'.$company_static->getNomUrl(1).'</td>';
$find = array(' ', '.');
$replace = array('', '');
print '<td class="nowrap">'.$intra."</td>";
print '<td class="nowrap right">'.price($coll->amount).'</td>';
print '<td class="nowrap right">'.price($local == 1 ? $coll->localtax1 : $coll->localtax2).'</td>';
$totalamount += $coll->amount;
$total += ($local == 1 ? $coll->localtax1 : $coll->localtax2);
print '<td class="nowrap right">'.price($coll_obj->amount).'</td>';
print '<td class="nowrap right">'.price($local == 1 ? $coll_obj->localtax1 : $coll_obj->localtax2).'</td>';
$totalamount += $coll_obj->amount;
$total += ($local == 1 ? $coll_obj->localtax1 : $coll_obj->localtax2);
print "</tr>\n";
$i++;
}

View file

@ -114,7 +114,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
* @param string $date Date
* @return void
*/
function pt($db, $sql, $date)
function localtax_pt($db, $sql, $date)
{
global $conf, $bc, $langs;
@ -600,7 +600,7 @@ $sql .= " GROUP BY dm";
$sql .= " ORDER BY dm ASC, mode ASC";
//print $sql;
pt($db, $sql, $langs->trans("Month"));
localtax_pt($db, $sql, $langs->trans("Month"));
print '</div></div>';

View file

@ -106,10 +106,10 @@ if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
$paiement_id = 0;
if (empty($reshook)) {
if (($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm == 'yes')) && $usercanissuepayment) {
$datepaye = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
$paiement_id = 0;
$totalpayment = 0;
$multicurrency_totalpayment = 0;
$atleastonepaymentnotnull = 0;
@ -277,6 +277,7 @@ if (empty($reshook)) {
$paiement->note_private = GETPOST('comment', 'alpha');
$paiement->fk_account = GETPOSTINT('accountid');
$paiement_id = 0;
if (!$error) {
// Create payment and update this->multicurrency_amounts if this->amounts filled or
// this->amounts if this->multicurrency_amounts filled.
@ -648,6 +649,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$totalrecu = 0;
$totalrecucreditnote = 0;
$totalrecudeposits = 0;
$sign = 1;
while ($i < $num) {
$objp = $db->fetch_object($resql);
@ -669,6 +671,11 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT');
// Multicurrency Price
$tooltiponmulticurrencyfullamount = '';
$multicurrency_remaintopay = '';
$multicurrency_payment = 0;
$multicurrency_creditnotes = 0;
$multicurrency_deposits = 0;
if (isModEnabled('multicurrency')) {
$multicurrency_payment = $invoice->getSommePaiement(1);
$multicurrency_creditnotes = $invoice->getSumCreditNotesUsed(1);
@ -676,15 +683,15 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$multicurrency_alreadypayed = price2num($multicurrency_payment + $multicurrency_creditnotes + $multicurrency_deposits, 'MT');
$multicurrency_remaintopay = price2num($invoice->multicurrency_total_ttc - $multicurrency_payment - $multicurrency_creditnotes - $multicurrency_deposits, 'MT');
// Multicurrency full amount tooltip
$tootltiponmulticurrencyfullamount = $langs->trans('AmountHT') . ": " . price($objp->multicurrency_total_ht, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "<br>";
$tootltiponmulticurrencyfullamount .= $langs->trans('AmountVAT') . ": " . price($objp->multicurrency_total_tva, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "<br>";
$tootltiponmulticurrencyfullamount .= $langs->trans('AmountTTC') . ": " . price($objp->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "<br>";
$tooltiponmulticurrencyfullamount = $langs->trans('AmountHT') . ": " . price($objp->multicurrency_total_ht, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "<br>";
$tooltiponmulticurrencyfullamount .= $langs->trans('AmountVAT') . ": " . price($objp->multicurrency_total_tva, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "<br>";
$tooltiponmulticurrencyfullamount .= $langs->trans('AmountTTC') . ": " . price($objp->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "<br>";
}
// Full amount tooltip
$tootltiponfullamount = $langs->trans('AmountHT') . ": " . price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . "<br>";
$tootltiponfullamount .= $langs->trans('AmountVAT') . ": " . price($objp->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . "<br>";
$tootltiponfullamount .= $langs->trans('AmountTTC') . ": " . price($objp->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . "<br>";
$tooltiponfullamount = $langs->trans('AmountHT') . ": " . price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . "<br>";
$tooltiponfullamount .= $langs->trans('AmountVAT') . ": " . price($objp->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . "<br>";
$tooltiponfullamount .= $langs->trans('AmountTTC') . ": " . price($objp->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . "<br>";
print '<tr class="oddeven'.(($invoice->id == $facid) ? ' highlight' : '').'">';
@ -721,7 +728,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (isModEnabled('multicurrency')) {
print '<td class="right">';
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) {
print '<span class="amount classfortooltip" title="'.$tootltiponmulticurrencyfullamount.'">' . price($sign * $objp->multicurrency_total_ttc);
print '<span class="amount classfortooltip" title="'.$tooltiponmulticurrencyfullamount.'">' . price($sign * $objp->multicurrency_total_ttc);
}
print '</span></td>';
@ -767,7 +774,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
// Full amount
print '<td class="right"><span class="amount classfortooltip" title="'.$tootltiponfullamount.'">'.price($sign * $objp->total_ttc).'</span></td>';
print '<td class="right"><span class="amount classfortooltip" title="'.$tooltiponfullamount.'">'.price($sign * $objp->total_ttc).'</span></td>';
// Received + already paid
print '<td class="right"><span class="amount">'.price($sign * $paiement);
@ -908,6 +915,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$preselectedchoice = $addwarning ? 'no' : 'yes';
print '<br>';
$text = '';
if (!empty($totalpayment)) {
$text = $langs->trans('ConfirmCustomerPayment', $totalpayment, $langs->transnoentitiesnoconv("Currency".$conf->currency));
}

View file

@ -330,6 +330,8 @@ print '</td></tr>';
print '<tr><td>'.$langs->trans('Amount').'</td><td>'.price($object->amount, 0, $langs, 0, -1, -1, $conf->currency).'</td></tr>';
$disable_delete = 0;
$bankline = null;
// Bank account
if (isModEnabled("bank")) {
$bankline = new AccountLine($db);
@ -392,7 +394,7 @@ if (isModEnabled("bank")) {
print '<tr>';
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
print '<td>';
if ($object->fk_account > 0) {
if ($object->fk_account > 0 && $bankline !== null) {
print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
} else {
$langs->load("admin");
@ -442,6 +444,7 @@ if (!empty($object->ext_payment_id)) {
print '<tr><td class="tdtop">'.$langs->trans("StripePaymentId").'</td><td class="wordbreak">';
if (isModEnabled('stripe') && in_array($object->ext_payment_site, array('Stripe', 'StripeLive'))) {
$tmp1 = explode('@', $object->ext_payment_id);
$site_account_payment = '';
if (!empty($tmp1[1])) {
$site_account_payment = $tmp1[1]; // pk_live_...
}

View file

@ -6,6 +6,7 @@
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -203,7 +204,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('banque'
header("Location: index.php");
exit;
} else {
setEventMessages($paiement->error, $paiement->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -201,6 +202,7 @@ if ($action == 'create') {
$sql = "SELECT sum(p.amount) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
$sql .= " WHERE p.fk_charge = ".((int) $chid);
$sumpaid = 0;
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);

View file

@ -203,6 +203,7 @@ if ($action == 'create') {
$sql = "SELECT sum(p.amount) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_vat as p";
$sql .= " WHERE p.fk_tva = ".((int) $chid);
$sumpaid = 0;
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);

View file

@ -87,6 +87,8 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('tax', '
}
}
$outputlangs = $langs;
// Validate social contribution
/*
if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->charges->creer)

View file

@ -3,6 +3,7 @@
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -245,7 +246,7 @@ if ($id > 0 || $ref) {
print '<form name="setdate_trans" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_trans">';
print $form->selectDate($object->date_trans ? $object->date_trans : -1, 'date_trans', 0, 0, "setdate_trans");
print $form->selectDate($object->date_trans ? $object->date_trans : -1, 'date_trans', 0, 0, 0, "setdate_trans");
print '<input type="submit" class="button button-edit smallpaddingimp valign middle" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
@ -564,12 +565,14 @@ if ($id > 0 || $ref) {
if (!$salaryBonPl) {
$thirdparty = new Societe($db);
$thirdparty->fetch($obj->socid);
$name = $thirdparty->getNomUrl(1);
} else {
$userSalary = new User($db);
$userSalary->fetch($obj->fk_user);
$name = $userSalary->getNomUrl(-1);
}
print '<td class="tdoverflowmax150">';
print(!$salaryBonPl ? $thirdparty->getNomUrl(1) : $userSalary->getNomUrl(-1));
print($name);
print "</td>\n";
print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>\n";

View file

@ -4,6 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -215,6 +216,7 @@ if ($sourcetype != 'salary') {
}
// Count total nb of records
$nbtotalofrecords = '';
$resql = null;
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);

View file

@ -4,6 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -329,6 +330,10 @@ if ($resql) {
$totalinvoices = 0;
$totalamount_requested = 0;
$salarytmp = null;
$usertmp = null;
$invoicetmpcustomer = null;
$invoicetmpsupplier = null;
if ($salaryBonPl) {
$salarytmp = new Salary($db);

View file

@ -93,7 +93,7 @@ $error = 0;
if ($action == 'confirm_rejet' && $permissiontoadd) {
if (GETPOST("confirm") == 'yes') {
$datarej = null;
$daterej = null;
if (GETPOSTINT('remonth')) {
$daterej = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
}

View file

@ -5,6 +5,7 @@
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -118,6 +119,8 @@ if (($massaction == "delete" || ($action == 'delete' && $confirm == 'yes')) && $
$TMsg = array();
$db->begin();
$objecttmp = new BonPrelevement($db);
$nbignored = 0;
$nbok = 0;
foreach ($toselect as $toselectid) {
$result = $objecttmp->fetch($toselectid);
if ($result > 0) {

View file

@ -4,6 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -79,6 +80,8 @@ if ($type == 'bank-transfer') {
$sql .= " AND pb.type = 'debit-order'";
}
$sql .= " AND pb.entity = ".$conf->entity;
$total = 0;
$nbtotal = 0;
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);

View file

@ -10,6 +10,7 @@
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -185,6 +186,10 @@ $exportlink = '';
$total_ht = 0;
$total_ttc = 0;
$builddate = '';
$name = '';
$period = '';
// Affiche en-tete de rapport
if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
@ -211,7 +216,7 @@ if ($modecompta == "CREANCES-DETTES") {
} elseif ($modecompta == "BOOKKEEPING") {
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
$arraylist = array('no'=>$langs->trans("CustomerCode"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All"));
$arraylist = array('no' => $langs->trans("CustomerCode"), 'yes' => $langs->trans("AccountWithNonZeroValues"), 'all' => $langs->trans("All"));
$period .= ' &nbsp; &nbsp; <span class="opacitymedium">'.$langs->trans("DetailBy").'</span> '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year'] - 1)."&modecompta=".$modecompta."&showaccountdetail=".$showaccountdetail."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year'] + 1)."&modecompta=".$modecompta."&showaccountdetail=".$showaccountdetail."'>".img_next()."</a>" : "");
$description = $langs->trans("RulesResultBookkeepingPredefined");
@ -238,7 +243,7 @@ if (isModEnabled('accounting')) {
$calcmode .= '</label>';
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta, 'showaccountdetail'=>$showaccountdetail), $calcmode);
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta' => $modecompta, 'showaccountdetail' => $showaccountdetail), $calcmode);
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, '1');

View file

@ -7,7 +7,7 @@
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -150,6 +150,11 @@ llxHeader();
$form = new Form($db);
$builddate = 0;
$name = '';
$period = '';
$periodlink = '';
$exportlink = '';
$encaiss = array();
@ -209,7 +214,6 @@ if (isModEnabled('accounting')) {
}
$calcmode .= '</label>';
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
@ -277,9 +281,9 @@ if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta
} else {
dol_print_error($db);
}
} elseif ($modecompta == "BOOKKEEPING") {
// Nothing from this table
}
} // elseif ($modecompta == "BOOKKEEPING") {
// Nothing from this table
//}
if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
// On ajoute les paiements clients anciennes version, non lies par paiement_facture
@ -322,12 +326,12 @@ if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta
} else {
dol_print_error($db);
}
} elseif ($modecompta == "RECETTES-DEPENSES") {
// Nothing from this table
}
} elseif ($modecompta == "BOOKKEEPING") {
} //elseif ($modecompta == "RECETTES-DEPENSES") {
// Nothing from this table
}
//}
} //elseif ($modecompta == "BOOKKEEPING") {
// Nothing from this table
//}
/*
@ -391,9 +395,9 @@ if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta
} else {
dol_print_error($db);
}
} elseif ($modecompta == "BOOKKEEPING") {
// Nothing from this table
}
} //elseif ($modecompta == "BOOKKEEPING") {
// Nothing from this table
//}
@ -557,9 +561,9 @@ if (isModEnabled('tax') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "
dol_print_error($db);
}
}
} elseif ($modecompta == "BOOKKEEPING") {
// Nothing from this table
}
}// elseif ($modecompta == "BOOKKEEPING") {
// Nothing from this table
//}
/*
* Social contributions
@ -616,9 +620,9 @@ if (isModEnabled('tax') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "
} else {
dol_print_error($db);
}
} elseif ($modecompta == "BOOKKEEPING") {
// Nothing from this table
}
} //elseif ($modecompta == "BOOKKEEPING") {
// Nothing from this table
//}
/*
@ -626,6 +630,7 @@ if (isModEnabled('tax') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "
*/
if (isModEnabled('salaries') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
$sql = '';
if ($modecompta == 'CREANCES-DETTES') {
$column = 's.dateep'; // we use the date of end of period of salary
@ -678,9 +683,9 @@ if (isModEnabled('salaries') && ($modecompta == 'CREANCES-DETTES' || $modecompta
} else {
dol_print_error($db);
}
} elseif ($modecompta == "BOOKKEEPING") {
// Nothing from this table
}
} //elseif ($modecompta == "BOOKKEEPING") {
// Nothing from this table
//}
/*
@ -740,9 +745,9 @@ if (isModEnabled('expensereport') && ($modecompta == 'CREANCES-DETTES' || $modec
} else {
dol_print_error($db);
}
} elseif ($modecompta == 'BOOKKEEPING') {
// Nothing from this table
}
} //elseif ($modecompta == 'BOOKKEEPING') {
// Nothing from this table
//}
/*
@ -800,9 +805,9 @@ if (isModEnabled('don') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "
} else {
dol_print_error($db);
}
} elseif ($modecompta == 'BOOKKEEPING') {
// Nothing from this table
}
} //elseif ($modecompta == 'BOOKKEEPING') {
// Nothing from this table
//}
/*
* Various Payments

View file

@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyreport.class.php';
/**
* @var Conf $conf
@ -45,6 +46,8 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php
// Load translation files required by the page
$langs->loadLangs(array('compta', 'bills', 'donation', 'salaries', 'accountancy'));
$id_report = GETPOSTINT('id_report');
$error = 0;
$mesg = '';
@ -197,13 +200,17 @@ $months = array(
llxHeader('', $langs->trans('ReportInOut'));
$builddate = 0;
$name = '';
$period = '';
$calcmode = 0;
$form = new Form($db);
$textprevyear = '<a href="'.$_SERVER["PHP_SELF"].'?year='.($start_year - 1).'&showaccountdetail='.urlencode($showaccountdetail).'">'.img_previous().'</a>';
$textnextyear = ' &nbsp; <a href="'.$_SERVER["PHP_SELF"].'?year='.($start_year + 1).'&showaccountdetail='.urlencode($showaccountdetail).'">'.img_next().'</a>';
// Affiche en-tete de rapport
if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("AnnualByAccountDueDebtMode");
@ -238,7 +245,12 @@ if ($modecompta == "CREANCES-DETTES") {
$builddate = dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
} elseif ($modecompta == "BOOKKEEPING") {
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups");
$accountingreportstatic = new AccountancyReport($db);
$accountingreportstatic->fetch($id_report);
$reportLabel = '';
$reportLabel = $accountingreportstatic->label;
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups").' '.$reportLabel;
$calcmode = $langs->trans("CalcModeBookkeeping");
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
@ -292,8 +304,8 @@ if ($modecompta == 'CREANCES-DETTES') {
// $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
} elseif ($modecompta == "BOOKKEEPING") {
// Get array of all report groups that are active
$cats = $AccCat->getCats(); // WARNING: Computed groups must be after group they include
$unactive_cats = $AccCat->getCats(-1, 0);
$cats = $AccCat->getCats(-1, 1, $id_report); // WARNING: Computed groups must be after group they include
$unactive_cats = $AccCat->getCats(-1, 0, $id_report);
/*
$sql = 'SELECT DISTINCT t.numero_compte as nb FROM '.MAIN_DB_PREFIX.'accounting_bookkeeping as t, '.MAIN_DB_PREFIX.'accounting_account as aa';

View file

@ -356,6 +356,8 @@ $title = $langs->trans("SocialContribution").' - '.$langs->trans("Card");
$help_url = 'EN:Module_Taxes_and_social_contributions|FR:Module_Taxes_et_charges_spéciales|ES:M&oacute;dulo Impuestos y cargas sociales (IVA, impuestos)';
llxHeader("", $title, $help_url);
$reseapayer = 0;
// Form to create a social contribution
if ($action == 'create') {

View file

@ -651,10 +651,8 @@ $totalarray = array();
$totalarray['nbfield'] = 0;
$totalarray['val'] = array('totalttcfield' => 0);
$imaxinloop = ($limit ? min($num, $limit) : $num);
if (!isset($TLoadedUsers) || !is_array($TLoadedUsers)) {
// Ensure array is initialised
$TLoadedUsers = array();
}
$TLoadedUsers = array();
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);

View file

@ -189,6 +189,7 @@ if ($sortfield !== null
// Count total nb of records
$nbtotalofrecords = '';
$resql = null;
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -280,9 +281,9 @@ if ($modecompta == "CREANCES-DETTES") {
$description .= $langs->trans("DepositsAreIncluded");
$builddate = dol_now();
} elseif ($modecompta == "BOOKKEEPING") {
} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
}
} //elseif ($modecompta == "BOOKKEEPING") {
//} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
//}
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0);
$period .= ' - ';
$period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);

View file

@ -216,7 +216,7 @@ if (!empty($selected_catsoc)) {
if (!empty($selected_soc)) {
$tableparams['search_soc'] = $selected_soc;
}
if (!empty($selected_type)) {
if ($selected_type > 0) {
$tableparams['search_type'] = $selected_type;
}
if (!empty($typent_id)) {
@ -254,6 +254,12 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") {
$exportlink = "";
$namelink = "";
$builddate = 0;
$calcmode = '';
$name = '';
$period = '';
$periodlink = '';
// Show report header
if ($modecompta == "CREANCES-DETTES") {
@ -277,9 +283,9 @@ if ($modecompta == "CREANCES-DETTES") {
$description .= $langs->trans("DepositsAreIncluded");
$builddate = dol_now();
} elseif ($modecompta == "BOOKKEEPING") {
} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
}
} // elseif ($modecompta == "BOOKKEEPING") {
// } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
// }
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
$period .= ' - ';
@ -290,6 +296,12 @@ if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
$periodlink = '';
}
$builddate = 0;
$calcmode = '';
$name = '';
$period = '';
$periodlink = '';
report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $tableparams, $calcmode);
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
@ -477,7 +489,7 @@ if ($modecompta == 'CREANCES-DETTES') {
print '>';
print '<label for="subcat" class="marginrightonly">'.$langs->trans("SubCats").'?</label>';
// type filter (produit/service)
$form->select_type_of_lines(isset($selected_type) ? $selected_type : -1, 'search_type', $langs->trans("Type"), 1, 1);
$form->select_type_of_lines($selected_type, 'search_type', $langs->trans("Type"), 1, 1);
// Third party filter
print '<br>';

View file

@ -5,6 +5,7 @@
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -197,6 +198,9 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") {
$exportlink = "";
$namelink = "";
$builddate = 0;
$calcmode = '';
$name = '';
// Show report header
if ($modecompta == "CREANCES-DETTES") {
@ -285,9 +289,9 @@ if ($modecompta == 'CREANCES-DETTES') {
if ($date_start && $date_end) {
$sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
}
} elseif ($modecompta == "BOOKKEEPING") {
} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
}
} // elseif ($modecompta == "BOOKKEEPING") {
// } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
// }
$sql .= " AND f.entity IN (".getEntity('invoice').")";
if ($socid) {
$sql .= " AND f.fk_soc = ".((int) $socid);

View file

@ -233,6 +233,9 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") {
$exportlink = "";
$namelink = "";
$builddate = 0;
$calcmode = '';
$name = '';
// Show report header
if ($modecompta == "CREANCES-DETTES") {
@ -255,9 +258,9 @@ if ($modecompta == "CREANCES-DETTES") {
$description .= $langs->trans("DepositsAreIncluded");
$builddate = dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
} elseif ($modecompta == "BOOKKEEPING") {
} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
}
} // elseif ($modecompta == "BOOKKEEPING") {
// } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
// }
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
$period .= ' - ';
$period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
@ -340,9 +343,9 @@ if ($modecompta == 'CREANCES-DETTES') {
$sql .= ")";
$sql .= " AND cs.fk_categorie = c.rowid AND cs.fk_soc = s.rowid";
}
} elseif ($modecompta == "BOOKKEEPING") {
} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
}
} // elseif ($modecompta == "BOOKKEEPING") {
// } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
// }
if (!empty($search_societe)) {
$sql .= natural_search('s.nom', $search_societe);
}

View file

@ -158,6 +158,8 @@ $form = new Form($db);
$exportlink = '';
$namelink = '';
$builddate = dol_now();
$periodlink = '';
$name = '';
// Affiche en-tete du rapport
if ($modecompta == "CREANCES-DETTES") {

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2020 Maxime Kohlhaas <maxime@atm-consulting.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -143,6 +144,8 @@ $form = new Form($db);
$exportlink = '';
$namelink = '';
$builddate = dol_now();
$periodlink = '';
$name = '';
// TODO Report from bookkeeping not yet available, so we switch on report on business events
/*if ($modecompta == "BOOKKEEPING") {

View file

@ -98,6 +98,7 @@ $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_starty
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzserver'); // We use timezone of server so report is same from everywhere
// We define date_start and date_end
$q = 0;
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
$q = GETPOSTINT("q");
if (empty($q)) {
@ -189,7 +190,7 @@ if (!empty($selected_cat)) {
if (!empty($selected_soc)) {
$tableparams['search_soc'] = $selected_soc;
}
if (!empty($selected_type)) {
if ($selected_type > 0) {
$tableparams['search_type'] = $selected_type;
}
$tableparams['subcat'] = $subcat ? 'yes' : '';
@ -235,6 +236,11 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") {
$modecompta = "RECETTES-DEPENSES";
}
$builddate = dol_now();
$periodlink = '';
$name = '';
$calcmode = '';
// Show report header
if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("PurchaseTurnover").', '.$langs->trans("ByProductsAndServices");
@ -253,7 +259,7 @@ if ($modecompta == "CREANCES-DETTES") {
// TODO
}
$builddate = dol_now();
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
$period .= ' - ';
$period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
@ -402,7 +408,7 @@ if ($modecompta == 'CREANCES-DETTES') {
print '>';
// type filter (produit/service)
print ' &nbsp; ';
$form->select_type_of_lines(isset($selected_type) ? $selected_type : -1, 'search_type', $langs->trans("Type"), 1, 1);
$form->select_type_of_lines($selected_type, 'search_type', $langs->trans("Type"), 1, 1);
//select thirdparty
print '<br>';

View file

@ -213,6 +213,10 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") {
$modecompta = "RECETTES-DEPENSES";
}
$calcmode = '';
$name = '';
// Show report header
if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("PurchaseTurnover").', '.$langs->trans("ByThirdParties");

View file

@ -106,10 +106,13 @@ if (!empty($user->socid)) {
$result = restrictedArea($user, 'tax', $object->id, 'tva', 'charges');
$resteapayer = 0;
/*
* Actions
*/
$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
@ -279,6 +282,7 @@ if (empty($reshook)) {
$ret = $object->delete($user);
if ($ret > 0) {
$accountline = null;
if ($object->fk_bank) {
$accountline = new AccountLine($db);
$result = $accountline->fetch($object->fk_bank);
@ -292,7 +296,7 @@ if (empty($reshook)) {
header("Location: ".DOL_URL_ROOT.'/compta/tva/list.php');
exit;
} else {
$object->error = $accountline->error;
$object->error = $accountline !== null ? $accountline->error : 'No account line (no bank)';
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
}

View file

@ -1,11 +1,11 @@
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Yannick Warnier <ywarnier@beeznest.org>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Yannick Warnier <ywarnier@beeznest.org>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -55,6 +55,17 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.
$langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin"));
include DOL_DOCUMENT_ROOT.'/compta/tva/initdatesforvat.inc.php';
'
@phan-var-force int $date_start
@phan-var-force int $date_end
@phan-var-force string $date_start_month
@phan-var-force string $date_start_year
@phan-var-force string $date_start_day
@phan-var-force string $date_end_month
@phan-var-force string $date_end_year
@phan-var-force string $date_end_day
@phan-var-force int $year_current
';
$min = price2num(GETPOST("min", "alpha"));
if (empty($min)) {
@ -258,7 +269,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
$company_static->name = $x_coll[$my_coll_thirdpartyid]['company_name'][$id];
$company_static->name_alias = $x_coll[$my_coll_thirdpartyid]['company_alias'][$id];
$company_static->email = $x_coll[$my_coll_thirdpartyid]['company_email'][$id];
$company_static->tva_intra = isset($x_coll[$my_coll_thirdpartyid]['tva_intra'][$id]) ? $x_coll[$my_coll_thirdpartyid]['tva_intra'][$id] : '0';
$company_static->tva_intra = isset($x_coll[$my_coll_thirdpartyid]['tva_intra'][$id]) ? $x_coll[$my_coll_thirdpartyid]['tva_intra'][$id] : '0'; // @phan-suppress-current-line PhanTypeInvalidDimOffset,PhanTypeArraySuspiciousNull
$company_static->client = $x_coll[$my_coll_thirdpartyid]['company_client'][$id];
$company_static->fournisseur = $x_coll[$my_coll_thirdpartyid]['company_fournisseur'][$id];
$company_static->status = $x_coll[$my_coll_thirdpartyid]['company_status'][$id];
@ -274,8 +285,8 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
'pid' => $x_coll[$my_coll_thirdpartyid]['pid'][$id],
'pref' => isset($x_coll[$my_coll_thirdpartyid]['pref'][$id]) ? $x_coll[$my_coll_thirdpartyid]['pref'][$id] : '',
'ptype' => $x_coll[$my_coll_thirdpartyid]['ptype'][$id],
'pstatus' => isset($x_paye[$my_coll_thirdpartyid]['pstatus'][$id]) ? $x_paye[$my_coll_thirdpartyid]['pstatus'][$id] : '',
'pstatusbuy' => isset($x_paye[$my_coll_thirdpartyid]['pstatusbuy'][$id]) ? $x_paye[$my_coll_thirdpartyid]['pstatusbuy'][$id] : '',
'pstatus' => isset($x_paye[$my_coll_thirdpartyid]['pstatus'][$id]) ? $x_paye[$my_coll_thirdpartyid]['pstatus'][$id] : '', // @phan-suppress-current-line PhanTypeInvalidDimOffset,PhanTypeArraySuspiciousNull
'pstatusbuy' => isset($x_paye[$my_coll_thirdpartyid]['pstatusbuy'][$id]) ? $x_paye[$my_coll_thirdpartyid]['pstatusbuy'][$id] : '', // @phan-suppress-current-line PhanTypeInvalidDimOffset,PhanTypeArraySuspiciousNull
'payment_id' => $x_coll[$my_coll_thirdpartyid]['payment_id'][$id],
'payment_ref' => isset($x_coll[$my_coll_thirdpartyid]['payment_ref'][$id]) ? $x_coll[$my_coll_thirdpartyid]['payment_ref'][$id] : '',
@ -331,7 +342,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
'ftotal_ttc' => price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]),
'dtotal_ttc' => price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]),
'dtype' => $x_paye[$my_paye_thirdpartyid]['dtype'][$id],
'drate' => $x_paye[$my_coll_thirdpartyid]['drate'][$id],
'drate' => $x_paye[$my_paye_thirdpartyid]['drate'][$id],
'ddate_start' => $x_paye[$my_paye_thirdpartyid]['ddate_start'][$id],
'ddate_end' => $x_paye[$my_paye_thirdpartyid]['ddate_end'][$id],
'totalht' => price2num($x_paye[$my_paye_thirdpartyid]['totalht_list'][$id]),
@ -373,7 +384,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
'ftotal_ttc' => price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]),
'dtotal_ttc' => price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]),
'dtype' => $x_paye[$my_paye_thirdpartyid]['dtype'][$id],
'drate' => $x_paye[$my_coll_thirdpartyid]['drate'][$id],
'drate' => $x_paye[$my_paye_thirdpartyid]['drate'][$id],
'datef' => $x_paye[$my_paye_thirdpartyid]['datef'][$id],
'datep' => $x_paye[$my_paye_thirdpartyid]['datep'][$id],

View file

@ -57,6 +57,16 @@ $month_start = $month_current;
$refresh = true;
include DOL_DOCUMENT_ROOT.'/compta/tva/initdatesforvat.inc.php';
'
@phan-var-force int $date_start
@phan-var-force int $date_end
@phan-var-force string $date_start_month
@phan-var-force string $date_start_year
@phan-var-force string $date_start_day
@phan-var-force string $date_end_month
@phan-var-force string $date_end_year
@phan-var-force string $date_end_day
';
// Define modetax (0 or 1)
// 0=normal, 1=option vat for services is on debit, 2=option on payments for products

View file

@ -67,7 +67,7 @@ if (empty($page) || $page == -1) {
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortfield) {
if (empty($sortfield)) {
$sortfield = "ptva.datep";
}
if (!$sortorder) {

View file

@ -276,7 +276,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
$company_static->name = $x_coll[$my_coll_rate]['company_name'][$id];
$company_static->name_alias = $x_coll[$my_coll_rate]['company_alias'][$id];
$company_static->email = $x_coll[$my_coll_rate]['company_email'][$id];
$company_static->tva_intra = isset($x_coll[$my_coll_rate]['tva_intra'][$id]) ? $x_coll[$my_coll_rate]['tva_intra'][$id] : '0';
$company_static->tva_intra = isset($x_coll[$my_coll_rate]['tva_intra'][$id]) ? $x_coll[$my_coll_rate]['tva_intra'][$id] : '0'; // @phan-suppress-current-line PhanTypeArraySuspiciousNull,PhanTypeInvalidDimOffset
$company_static->client = $x_coll[$my_coll_rate]['company_client'][$id];
$company_static->fournisseur = $x_coll[$my_coll_rate]['company_fournisseur'][$id];
$company_static->status = $x_coll[$my_coll_rate]['company_status'][$id];

View file

@ -716,7 +716,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>';
} else {
print '<tr><td><label for="socid">'.$langs->trans("ThirdParty").'</label></td><td colspan="3" class="maxwidthonsmartphone">';
print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company($socid, 'socid', '', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company($socid, 'socid', '', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
print '</td></tr>';
}
}
@ -888,7 +888,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Default language
if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n";
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, array(), 1, 0, 0, 'maxwidth200onsmartphone');
print '</td>';
print '</tr>';
}
@ -897,7 +897,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
print '<tr><td>'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, '', 'parent', 64, 0, 3);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), null, null, null, null, '90%');
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), 0, 0, '', 0, '90%');
print "</td></tr>";
}
@ -1176,7 +1176,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Default language
if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n";
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, array(), 1, 0, 0, 'maxwidth200onsmartphone');
print '</td>';
print '</tr>';
}
@ -1210,7 +1210,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
foreach ($cats as $cat) {
$arrayselected[] = $cat->id;
}
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%');
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, $arrayselected, 0, 0, '', 0, '90%');
print "</td></tr>";
}

View file

@ -6,6 +6,7 @@
* Copyright (C) 2015-2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -212,7 +213,13 @@ print '<br>';
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$id.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
$documentstatic = null;
$documentstaticline = null;
$sql_select = '';
$doc_number = '';
$dateprint = '';
$tables_from = '';
$where = '';
if ($type_element == 'fichinter') { // Customer : show products from invoices
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
$documentstatic = new Fichinter($db);
@ -318,6 +325,8 @@ if ($type_element == 'fichinter') { // Customer : show products from invoices
}
$parameters = array();
$totalnboflines = 0;
$sql = '';
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
if (!empty($sql_select)) {
@ -343,7 +352,7 @@ if (!empty($sql_select)) {
// if ($type_element != 'fichinter') $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON d.fk_product = p.rowid ';
$sql .= $where;
$sql .= dolSqlDateFilter($dateprint, 0, $month, $year);
if ($sref) {
if ($sref && !empty($doc_number)) {
$sql .= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'";
}
if ($sprod_fulldescr) {
@ -386,7 +395,7 @@ $param .= "&type_element=".urlencode($type_element);
$total_qty = 0;
$num = 0;
if ($sql_select) {
if ($sql_select && $documentstatic !== null) {
$resql = $db->query($sql);
if (!$resql) {
dol_print_error($db);
@ -584,7 +593,7 @@ if ($sql_select) {
}
} else {
if ($objp->fk_product > 0) {
echo $form->textwithtooltip($text, $description, 3, '', '', $i, 0, '');
echo $form->textwithtooltip($text, $description, 3, 0, '', $i, 0, '');
// Show range
echo get_date_range($objp->date_start, $objp->date_end);
@ -603,7 +612,7 @@ if ($sql_select) {
if (!empty($objp->label)) {
$text .= ' <strong>'.$objp->label.'</strong>';
echo $form->textwithtooltip($text, dol_htmlentitiesbr($objp->description), 3, '', '', $i, 0, '');
echo $form->textwithtooltip($text, dol_htmlentitiesbr($objp->description), 3, 0, '', $i, 0, '');
} else {
echo $text.' '.dol_htmlentitiesbr($objp->description);
}

View file

@ -330,7 +330,7 @@ if ($action == "change" && $user->hasRight('takepos', 'run')) { // Change custom
if (!isset($invoice)) {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$invoice = new Facture($db);
$invoice->fetch(null, "(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")");
$invoice->fetch(0, "(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")");
$invoice->delete_linked_contact('external', 'BILLING');
}
$invoice->add_contact($idcontact, 'BILLING'); ?>
@ -1600,7 +1600,7 @@ while ($i < $imaxinloop) {
// EMail
if (!empty($arrayfields['p.email']['checked'])) {
print '<td class="nowraponall tdoverflowmax300">';
print '<td class="nowraponall tdoverflowmax200" title="'.dolPrintHTML($obj->email).'">';
if ($contextpage == 'poslist') {
print $obj->email;
} else {
@ -1640,7 +1640,7 @@ while ($i < $imaxinloop) {
// Company / Third Party
if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) {
print '<td class="tdoverflowmax150">';
print '<td class="tdoverflowmax125">';
if ($obj->socid) {
$objsoc = new Societe($db);
$objsoc->fetch($obj->socid);

View file

@ -96,7 +96,7 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact
if ($id > 0) {
/*
* Affichage onglets
* Show tabs
*/
if (isModEnabled('notification')) {
$langs->load("mails");

View file

@ -75,7 +75,7 @@ if ($action == 'update' && !GETPOST("cancel") && $user->hasRight('societe', 'con
$result = $object->update_perso($id, $user);
if ($result > 0) {
$object->oldcopy = dol_clone($object, 2);
$object->oldcopy = dol_clone($object, 2); // @phan-suppres-current-line PhanTypeMismatchProperty
// Logo/Photo save
$dir = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos';

View file

@ -3,6 +3,7 @@
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -181,7 +182,7 @@ if ($object->id > 0) {
$morehtmlref .= $object->ref;
} else {
$morehtmlref .= $form->editfieldkey("", 'ref', $object->ref, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 3);
$morehtmlref .= $form->editfieldval("", 'ref', $object->ref, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 2);
$morehtmlref .= $form->editfieldval("", 'ref', $object->ref, $object, $user->hasRight('contrat', 'creer'), 'string', null, 0, 2);
}
$permtoedit = 0;

View file

@ -795,7 +795,7 @@ if (empty($reshook)) {
if (GETPOST('buying_price')) {
$pa_ht = price2num(GETPOST('buying_price'), '', 2);
} else {
$pa_ht = null;
$pa_ht = 0;
}
$fk_unit = GETPOSTINT('unit');
@ -811,9 +811,9 @@ if (empty($reshook)) {
$objectline->fk_product = GETPOSTINT('idprod');
$objectline->description = GETPOST('product_desc', 'restricthtml');
$objectline->price_ht = $price_ht;
$objectline->subprice = price2num(GETPOST('elprice'), 'MU');
$objectline->qty = price2num(GETPOST('elqty'), 'MS');
$objectline->price_ht = (float) $price_ht;
$objectline->subprice = (float) price2num(GETPOST('elprice'), 'MU');
$objectline->qty = (float) price2num(GETPOST('elqty'), 'MS');
$objectline->remise_percent = $remise_percent;
$objectline->tva_tx = ($txtva ? $txtva : 0); // Field may be disabled, so we use vat rate 0
$objectline->vat_src_code = $vat_src_code;
@ -1821,7 +1821,12 @@ if ($action == 'create') {
} else {
$senderissupplier = 0; // @TODO Option to allow purchased products ?
if (empty($senderissupplier)) {
print $form->select_produits($currentLineProductId, 'idprod', '', 0, 0, 1, 2, '', 0, array(), 0, 1, 0, 'minwidth250onall maxwidth500 widthcentpercentminusx');
if (getDolGlobalString('CONTRACT_SUPPORT_PRODUCTS')) {
$filtertype = '';
} else {
$filtertype = '1';
}
print $form->select_produits($currentLineProductId, 'idprod', $filtertype, 0, 0, 1, 2, '', 0, array(), 0, 1, 0, 'minwidth250onall maxwidth500 widthcentpercentminusx');
} else {
$form->select_produits_fournisseurs($currentLineProductId, 'idprod');
}

View file

@ -8,6 +8,7 @@
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -177,7 +178,7 @@ if (!empty($modCodeContract->code_auto)) {
$morehtmlref .= $object->ref;
} else {
$morehtmlref .= $form->editfieldkey("", 'ref', $object->ref, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 3);
$morehtmlref .= $form->editfieldval("", 'ref', $object->ref, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 2);
$morehtmlref .= $form->editfieldval("", 'ref', $object->ref, $object, $user->hasRight('contrat', 'creer'), 'string', '', null, 2);
}
$permtoedit = 0;

View file

@ -555,7 +555,7 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort
if (!empty($sall)) {
$fieldstosearchall = array();
foreach ($fieldstosearchall as $key => $val) {
foreach ($fieldstosearchall as $key => $val) { // @phan-suppress-current-line PhanEmptyForeach
$fieldstosearchall[$key] = $langs->trans($val);
}
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall).implode(', ', $fieldstosearchall).'</div>';
@ -569,7 +569,7 @@ if (isModEnabled('category') && ($user->hasRight('produit', 'lire') || $user->ha
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag');
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 0, 0, 1);
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'widthcentpercentminusx maxwidth300', 1);
$moreforfilter .= '</div>';
}

View file

@ -416,7 +416,7 @@ if (preg_match('/^set(\w+)$/', $action, $reg) && GETPOSTINT('id') > 0 && !empty(
if ($action == "update_extras" && GETPOSTINT('id') > 0 && !empty($permissiontoadd)) {
$object->fetch(GETPOSTINT('id'));
$object->oldcopy = dol_clone($object, 2);
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
$attribute = GETPOST('attribute', 'alphanohtml');
@ -644,6 +644,7 @@ if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) {
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes' && !empty($permissiontoadd)) {
// @phan-suppress-next-line PhanPluginBothLiteralsBinaryOp
if (1 == 0 && !GETPOST('clone_content') && !GETPOST('clone_receivers')) {
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
} else {

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2011-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -32,6 +33,12 @@
* @var string $contextpage
*/
// Next should be define in the including php source file
'
@phan-var-force int $withproject
@phan-var-force int $idcomment
';
require_once DOL_DOCUMENT_ROOT.'/core/class/comment.class.php';
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -27,7 +28,11 @@
// $permissiontoedit must be defined to permission to edit object
// $object must be defined
// $langs must be defined
// $hidedetails, $hidedesc, $hideref must de defined
// $hidedetails, $hidedesc, $hideref must defined
'
@phan-var-force bool $permissiontoedit
@phan-var-force CommonObject $object
';
/**
* @var CommonObject $object
* @var Conf $conf

View file

@ -3,6 +3,7 @@
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -37,6 +38,10 @@
* @var string $confirm
* @var string $forceFullTextIndexation
*/
'
@phan-var-force string $upload_dir
@phan-var-force string $forceFullTextIndexation
';
// Protection to understand what happen when submitting files larger than post_max_size
if (GETPOSTINT('uploadform') && empty($_POST) && empty($_FILES)) {

View file

@ -545,6 +545,11 @@ if (!$error && $massaction == 'confirm_presend') {
$substitutionarray['__EMAIL__'] = $thirdparty->email;
$substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag=undefined&securitykey='.dol_hash(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')."-undefined", 'md5').'" width="1" height="1" style="width:1px;height:1px" border="0"/>';
if ($oneemailperrecipient) {
$substitutionarray['__ONLINE_PAYMENT_URL__'] = '';
$substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = '';
}
$parameters = array('mode' => 'formemail');
if (!empty($listofobjectthirdparties)) {
@ -923,6 +928,7 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto
$pdf->SetCompression(false);
}
$pagecount = 0;
// Add all others
foreach ($files as $file) {
// Charge un document PDF depuis un fichier.
@ -1924,7 +1930,7 @@ if (!$error && ($massaction == 'clonetasks' || ($action == 'clonetasks' && $conf
}
if (empty($toselect)) {
$toselect=[];
$toselect = [];
}
$parameters['toselect'] = &$toselect;
$parameters['uploaddir'] = $uploaddir;

View file

@ -138,10 +138,11 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
$langs->load('mails');
$sendtosocid = 0; // Id of related thirdparty
if (is_object($object)) {
$result = $object->fetch($id);
$sendtosocid = 0; // Id of related thirdparty
if (method_exists($object, "fetch_thirdparty") && !in_array($object->element, array('member', 'user', 'expensereport', 'societe', 'contact'))) {
$resultthirdparty = $object->fetch_thirdparty();
$thirdparty = $object->thirdparty;
@ -339,7 +340,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
// <img alt="" src="'.$urlwithroot.'viewimage.php?modulepart=medias&amp;entity=1&amp;file=image/ldestailleur_166x166.jpg" style="height:166px; width:166px" />
$message = preg_replace('/(<img.*src=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^\/]*\/>)/', '\1'.$urlwithroot.'/viewimage.php\2modulepart=medias\3file=\4\5', $message);
$sendtobcc = GETPOST('sendtoccc');
$sendtobcc = GETPOST('sendtoccc', 'alphawithlgt');
// Autocomplete the $sendtobcc
// $autocopy can be MAIN_MAIL_AUTOCOPY_PROPOSAL_TO, MAIN_MAIL_AUTOCOPY_ORDER_TO, MAIN_MAIL_AUTOCOPY_INVOICE_TO, MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO...
if (!empty($autocopy)) {
@ -436,7 +437,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
// Call of triggers (you should have set $triggersendname to execute trigger. $trigger_name is deprecated)
if (!empty($triggersendname) || !empty($trigger_name)) {
// Call trigger
$result = $object->call_trigger(empty($triggersendname) ? $trigger_name : $triggersendname, $user);
$result = $object->call_trigger(empty($triggersendname) ? $trigger_name : $triggersendname, $user); // @phan-suppress-current-line PhanPossiblyUndeclaredGlobalVariable
if ($result < 0) {
$error++;
}
@ -454,7 +455,8 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
setEventMessages($mesg, null, 'mesgs');
$moreparam = '';
if (isset($paramval2)) {
if (isset($paramval2)) { // @phan-var-suppress-current-line PhanPluginUndeclaredVariableIsset
// @phan-var-suppress-next-line PhanUndeclaredGlobalVariable
$moreparam .= '&'.($paramname2 ? $paramname2 : 'mid').'='.$paramval2;
}
header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname ?? 'id').'='.(is_object($object) ? $object->id : '').$moreparam);

View file

@ -41,15 +41,15 @@
* @var ?int $nomessageinsetmoduleoptions
*/
'
@phan-var-force FormSetup $formSetup
';
if ($action == 'update' && !empty($formSetup) && is_object($formSetup) && !empty($user->admin)) {
$formSetup->saveConfFromPost();
return;
}
'
@phan-var-force FormSetup $formSetup
';
$upload_dir = null;
if ($action == 'update' && !empty($arrayofparameters) && is_array($arrayofparameters) && !empty($user->admin)) {
@ -129,13 +129,19 @@ if ($action == 'setModuleOptions' && !empty($user->admin)) {
foreach ($_POST as $key => $val) {
$reg = array();
if (preg_match('/^param(\d*)$/', $key, $reg)) { // Works for POST['param'], POST['param1'], POST['param2'], ...
$param = GETPOST("param".$reg[1], 'alpha');
$param = GETPOST("param".$reg[1], 'aZ09');
$value = GETPOST("value".$reg[1], 'alpha');
if ($param) {
$res = dolibarr_set_const($db, $param, $value, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
}
// Case we modify the list of directories for ODT templases, we want to be sure directory exists
if (preg_match('/_ADDON_PDF_ODT_PATH$/', $param) && preg_match('/^DOL_DATA_ROOT/', $value)) {
$tmpdir = preg_replace('/^DOL_DATA_ROOT/', DOL_DATA_ROOT, $value);
dol_mkdir($tmpdir, DOL_DATA_ROOT);
}
}
}
}

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