Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
eldy committed Dec 10, 2024
2 parents d542b21 + 78ece83 commit 4e86e65
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 143 deletions.
72 changes: 0 additions & 72 deletions build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4638,12 +4638,6 @@ parameters:
count: 1
path: ../../htdocs/comm/propal/tpl/linkedobjectblock.tpl.php

-
message: '#^Variable \$id might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/comm/recap-client.php

-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
Expand Down Expand Up @@ -5496,42 +5490,12 @@ parameters:
count: 1
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Variable \$accountingaccount might not be defined\.$#'
identifier: variable.undefined
count: 5
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Variable \$accountingjournal might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Variable \$accountstatic might not be defined\.$#'
identifier: variable.undefined
count: 7
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Variable \$bankline might not be defined\.$#'
identifier: variable.undefined
count: 4
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
identifier: empty.variable
count: 1
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Variable \$variousstatic might not be defined\.$#'
identifier: variable.undefined
count: 12
path: ../../htdocs/compta/bank/various_payment/list.php

-
message: '#^Loose comparison using \=\= between ''card'' and ''card'' will always evaluate to true\.$#'
identifier: equal.alwaysTrue
Expand Down Expand Up @@ -34224,30 +34188,6 @@ parameters:
count: 1
path: ../../htdocs/zapier/class/api_zapier.class.php

-
message: '#^Variable \$conf might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../scripts/bank/export-bank-receipts.php

-
message: '#^Variable \$db might not be defined\.$#'
identifier: variable.undefined
count: 27
path: ../../scripts/bank/export-bank-receipts.php

-
message: '#^Variable \$hookmanager might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../scripts/bank/export-bank-receipts.php

-
message: '#^Variable \$langs might not be defined\.$#'
identifier: variable.undefined
count: 9
path: ../../scripts/bank/export-bank-receipts.php

-
message: '#^Variable \$num in isset\(\) always exists and is not nullable\.$#'
identifier: isset.variable
Expand Down Expand Up @@ -34302,18 +34242,6 @@ parameters:
count: 1
path: ../../scripts/emailings/reset-invalid-emails.php

-
message: '#^Variable \$db might not be defined\.$#'
identifier: variable.undefined
count: 21
path: ../../scripts/emailings/reset-invalid-emails.php

-
message: '#^Variable \$hookmanager might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../scripts/emailings/reset-invalid-emails.php

-
message: '#^Variable \$conf might not be defined\.$#'
identifier: variable.undefined
Expand Down
5 changes: 2 additions & 3 deletions htdocs/admin/mails_senderprofile_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)

$id = GETPOSTINT('id');
$rowid = GETPOST('rowid', 'alpha');

// Load variable for pagination
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
Expand Down Expand Up @@ -83,8 +82,8 @@

// Default sort order (if not yet defined by previous GETPOST)
if (!$sortfield) {
reset($object->fields); // Reset is required to avoid key() to return null.
$sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
reset($object->fields); // Reset is required to avoid key() to return null.
$sortfield = "t.position"; // Set here default search field. By default 1st field in definition.
}
if (!$sortorder) {
$sortorder = "ASC";
Expand Down
5 changes: 3 additions & 2 deletions htdocs/comm/recap-client.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -44,6 +44,7 @@

// Security check
$socid = GETPOSTINT("socid");
$id = 0;
if ($user->socid > 0) {
$action = '';
$id = $user->socid;
Expand Down
5 changes: 3 additions & 2 deletions htdocs/compta/bank/class/paymentvarious.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ public function getKanbanView($option = '', $arraydata = null)
global $langs;

$selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']);
$bankline = ((empty($arraydata['bankline']) || empty($arraydata['bankline']->id)) ? 0 : $arraydata['bankline']);

$return = '<div class="box-flex-item box-flex-grow-zero">';
$return .= '<div class="info-box info-box-sm">';
Expand All @@ -844,8 +845,8 @@ public function getKanbanView($option = '', $arraydata = null)
if ($selected >= 0) {
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
if (property_exists($this, 'fk_bank')) {
$return .= ' | <span class="info-box-status ">'.$this->fk_bank.'</span>';
if (!empty($bankline)) {
$return .= ' | <span class="info-box-status ">'.$bankline->getNomUrl(1).'</span>';

Check warning on line 849 in htdocs/compta/bank/class/paymentvarious.class.php

View workflow job for this annotation

GitHub Actions / phan / Run phan

paymentvarious.class.php: PhanPluginUnknownObjectMethodCall: Phan could not infer any class/interface types for the object of the method call $bankline-&gt;getNomUrl(1) - inferred a type of non-empty-mixed
}
if (property_exists($this, 'datep')) {
$return .= '<br><span class="opacitymedium">'.$langs->trans("Date").'</span> : <span class="info-box-label">'.dol_print_date($this->db->jdate($this->datep), 'day').'</span>';
Expand Down
33 changes: 16 additions & 17 deletions htdocs/compta/bank/various_payment/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,27 +239,23 @@

$form = new Form($db);
$proj = null;
$accountingaccount = new AccountingAccount($db);
$bankline = new AccountLine($db);
$variousstatic = new PaymentVarious($db);
$accountstatic = null;
$accountingjournal = null;
if ($arrayfields['account']['checked'] || $arrayfields['subledger']['checked']) {
$formaccounting = new FormAccounting($db);
}
if ($arrayfields['bank']['checked'] && isModEnabled('accounting')) {
$accountingjournal = new AccountingJournal($db);
}
if ($arrayfields['ref']['checked']) {
$variousstatic = new PaymentVarious($db);
}
if ($arrayfields['bank']['checked']) {
$accountstatic = new Account($db);
$accountstatic = new Account($db);
}
if ($arrayfields['project']['checked']) {
$proj = new Project($db);
}
if ($arrayfields['entry']['checked']) {
$bankline = new AccountLine($db);
}
if ($arrayfields['account']['checked']) {
$accountingaccount = new AccountingAccount($db);
}

$title = $langs->trans("VariousPayments");
//$help_url = "EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject";
Expand Down Expand Up @@ -720,20 +716,25 @@
$variousstatic->label = $obj->label;
$variousstatic->datep = $obj->datep;
$variousstatic->type_payment = $obj->payment_code;
$bankline->fetch($obj->fk_bank);
$variousstatic->fk_bank = $bankline->getNomUrl(1);

$variousstatic->amount = $obj->amount;

$accountingaccount->fetch(0, $obj->accountancy_code, 1);
$variousstatic->accountancy_code = $accountingaccount->getNomUrl(0, 0, 1, $obj->accountingaccount, 1);

if ($mode == 'kanban') {
if ($obj->fk_bank > 0) {
$bankline->fetch($obj->fk_bank);
} else {
$bankline->id = 0;
}

if ($i == 0) {
print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
print '<div class="box-flex-container kanban">';
}
// Output Kanban
print $variousstatic->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected)));
print $variousstatic->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected), 'bankline' => $bankline));
if ($i == ($imaxinloop) - 1) {
print '</div>';
print '</td></tr>';
Expand Down Expand Up @@ -819,21 +820,19 @@
// Bank account
if ($arrayfields['bank']['checked']) {
print '<td class="nowraponall">';
if ($obj->bid > 0) {
if (is_object($accountstatic) && $obj->bid > 0) {
$accountstatic->id = $obj->bid;
$accountstatic->ref = $obj->bref;
$accountstatic->number = $obj->bnumber;

if (isModEnabled('accounting')) {
if (isModEnabled('accounting') && is_object($accountingjournal)) {
$accountstatic->account_number = $obj->bank_account_number;
$accountingjournal->fetch($obj->accountancy_journal);
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
}

$accountstatic->label = $obj->blabel;
print $accountstatic->getNomUrl(1);
} else {
print '&nbsp;';
}
print '</td>';
if (!$i) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/paiement/class/paiement.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public function create($user, $closepaidinvoices = 0, $thirdparty = null)
if (empty($value)) {
continue;
}

$value_converted = false;
$tmparray = MultiCurrency::getInvoiceRate($key, 'facture');
$invoice_multicurrency_tx = $tmparray['invoice_multicurrency_tx'];
$invoice_multicurrency_code = $tmparray['invoice_multicurrency_code'];
Expand Down
33 changes: 0 additions & 33 deletions htdocs/core/class/html.formfile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -840,39 +840,6 @@ public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource,
$morecss = 'maxwidth100';
}
$out .= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss, 1, '', 0, 0);
// script for select the separator
/* TODO This must appear on export feature only
$out .= '<label class="forhide" for="delimiter">Delimiter:</label>';
$out .= '<input type="radio" class="testinput forhide" name="delimiter" value="," id="comma" checked><label class="forhide" for="comma">,</label>';
$out .= '<input type="radio" class="testinput forhide" name="delimiter" value=";" id="semicolon"><label class="forhide" for="semicolon">;</label>';
$out .= '<script>
jQuery(document).ready(function() {
$(".selectformat").on("change", function() {
var separator;
var selected = $(this).val();
if (selected == "excel2007" || selected == "tsv") {
$("input.testinput").prop("disabled", true);
$(".forhide").hide();
} else {
$("input.testinput").prop("disabled", false);
$(".forhide").show();
}
if ($("#semicolon").is(":checked")) {
separator = ";";
} else {
separator = ",";
}
});
if ("' . $conf->global->EXPORT_CSV_SEPARATOR_TO_USE . '" == ";") {
$("#semicolon").prop("checked", true);
} else {
$("#comma").prop("checked", true);
}
});
</script>';
*/
if ($conf->use_javascript_ajax) {
$out .= ajax_combobox('model');
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/tpl/objectline_create.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@

// Free line
$labelforempty = 1;
print '<span class="prod_entry_mode_free">';
print '<span class="prod_entry_mode_free nowraponall">';
// Show radio for the non predefined product
if ($forceall >= 0 && (isModEnabled("product") || isModEnabled("service"))) {
print '<label for="prod_entry_mode_free">';
Expand All @@ -232,7 +232,7 @@
}
}

$form->select_type_of_lines(GETPOSTISSET("type") ? GETPOST("type", 'alpha', 2) : -1, 'type', $labelforempty, 1, $forceall, '');
$form->select_type_of_lines(GETPOSTISSET("type") ? GETPOST("type", 'alpha', 2) : -1, 'type', $labelforempty, 1, $forceall, 'minwidth200');
print '</span>';
}
// Predefined product/service
Expand Down
9 changes: 8 additions & 1 deletion htdocs/ecm/class/ecmfiles.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,14 @@ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $maxlen
}

if ($option) {
$url = DOL_URL_ROOT.'/document.php?modulepart='.$option.'&file='.urlencode(preg_replace('/^[^\/]+\//', '', $this->filepath).'/'.$this->filename).'&entity='.$this->entity;
if ($option == 'facture_fournisseur') {
$tmppath = preg_replace('/^fournisseur\/facture\//', '', $this->filepath);
} elseif ($option == 'commande_fournisseur') {
$tmppath = preg_replace('/^fournisseur\/commande\//', '', $this->filepath);
} else {
$tmppath = preg_replace('/^[^\/]+\//', '', $this->filepath);
}
$url = DOL_URL_ROOT.'/document.php?modulepart='.urlencode($option).'&file='.urlencode($tmppath.'/'.$this->filename).'&entity='.$this->entity;
} else {
$url = DOL_URL_ROOT.'/ecm/file_card.php?id='.$this->id;
}
Expand Down
8 changes: 4 additions & 4 deletions htdocs/fourn/facture/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -3595,7 +3595,7 @@ function setRadioForTypeOfInvoice() {
print '</table>';


// List of payments
// List of payments already done

$totalpaid = 0;

Expand Down Expand Up @@ -3649,8 +3649,8 @@ function setRadioForTypeOfInvoice() {
print '<table class="noborder paymenttable centpercent">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">'.($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).'</td>';
print '<td>'.$langs->trans('Date').'</td>';
print '<td>'.$langs->trans('Type').'</td>';
print '<td><span class="hideonsmartphone">'.$langs->trans('Date').'</span></td>';
print '<td><span class="hideonsmartphone">'.$langs->trans('Type').'</span></td>';
if (isModEnabled("bank")) {
print '<td class="right">'.$langs->trans('BankAccount').'</td>';
}
Expand Down Expand Up @@ -4172,7 +4172,7 @@ function setRadioForTypeOfInvoice() {
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
$genallowed = $usercanread;
$delallowed = $usercancreate;
$modelpdf = (!empty($object->model_pdf) ? $object->model_pdf : (!getDolGlobalString('INVOICE_SUPPLIER_ADDON_PDF') ? '' : $conf->global->INVOICE_SUPPLIER_ADDON_PDF));
$modelpdf = (empty($object->model_pdf) ? getDolGlobalString('INVOICE_SUPPLIER_ADDON_PDF') : $object->model_pdf);

print $formfile->showdocuments('facture_fournisseur', $subdir, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 40, 0, '', '', '', $societe->default_lang);
$somethingshown = $formfile->numoffiles;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/multicurrency/class/multicurrency.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ public static function getAmountConversionFromInvoiceRate($fk_facture, $amount,
*
* @param int $fk_facture id of facture
* @param string $table facture or facture_fourn
* @return array|bool Rate and code of currency or false if error
* @return array{invoice_multicurrency_tx: float,invoice_multicurrency_code: string}|bool Rate and code of currency or false if error
*/
public static function getInvoiceRate($fk_facture, $table = 'facture')
{
Expand Down
12 changes: 9 additions & 3 deletions scripts/bank/export-bank-receipts.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env php
<?php
/*
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* 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
Expand Down Expand Up @@ -53,7 +54,12 @@
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';

/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Translate $langs
*/
// Global variables
$version = DOL_VERSION;
$error = 0;
Expand Down
Loading

0 comments on commit 4e86e65

Please sign in to comment.