Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
4e86e65624
13 changed files with 57 additions and 143 deletions
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ''
|
|||
$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;
|
||||
|
|
@ -83,8 +82,8 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
|
|||
|
||||
// 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";
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -44,6 +44,7 @@ if (isModEnabled('invoice')) {
|
|||
|
||||
// Security check
|
||||
$socid = GETPOSTINT("socid");
|
||||
$id = 0;
|
||||
if ($user->socid > 0) {
|
||||
$action = '';
|
||||
$id = $user->socid;
|
||||
|
|
|
|||
|
|
@ -833,6 +833,7 @@ class PaymentVarious extends CommonObject
|
|||
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">';
|
||||
|
|
@ -844,8 +845,8 @@ class PaymentVarious extends CommonObject
|
|||
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>';
|
||||
}
|
||||
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>';
|
||||
|
|
|
|||
|
|
@ -239,27 +239,23 @@ if (empty($reshook)) {
|
|||
|
||||
$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";
|
||||
|
|
@ -720,20 +716,25 @@ while ($i < $imaxinloop) {
|
|||
$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>';
|
||||
|
|
@ -819,12 +820,12 @@ while ($i < $imaxinloop) {
|
|||
// 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);
|
||||
|
|
@ -832,8 +833,6 @@ while ($i < $imaxinloop) {
|
|||
|
||||
$accountstatic->label = $obj->blabel;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
|
|
|
|||
|
|
@ -334,7 +334,7 @@ class Paiement extends CommonObject
|
|||
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'];
|
||||
|
|
|
|||
|
|
@ -840,39 +840,6 @@ class FormFile
|
|||
$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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ if ($nolinesbefore) {
|
|||
|
||||
// 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">';
|
||||
|
|
@ -232,7 +232,7 @@ if ($nolinesbefore) {
|
|||
}
|
||||
}
|
||||
|
||||
$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
|
||||
|
|
|
|||
|
|
@ -1008,7 +1008,14 @@ class EcmFiles extends CommonObject
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3595,7 +3595,7 @@ if ($action == 'create') {
|
|||
print '</table>';
|
||||
|
||||
|
||||
// List of payments
|
||||
// List of payments already done
|
||||
|
||||
$totalpaid = 0;
|
||||
|
||||
|
|
@ -3649,8 +3649,8 @@ if ($action == 'create') {
|
|||
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>';
|
||||
}
|
||||
|
|
@ -4172,7 +4172,7 @@ if ($action == 'create') {
|
|||
$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;
|
||||
|
|
|
|||
|
|
@ -592,7 +592,7 @@ class MultiCurrency extends CommonObject
|
|||
*
|
||||
* @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')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -53,7 +54,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
/* Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2020 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -53,7 +54,12 @@ require_once $path."../../htdocs/master.inc.php";
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functionscli.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/comm/mailing/class/mailing.class.php";
|
||||
|
||||
/**
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
*
|
||||
* @var int $dolibarr_main_db_readonly
|
||||
*/
|
||||
// Global variables
|
||||
$version = DOL_VERSION;
|
||||
$error = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue