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

This commit is contained in:
Laurent Destailleur 2023-03-16 09:43:30 +01:00
commit b2afcad3f5
24 changed files with 459 additions and 1417 deletions

File diff suppressed because one or more lines are too long

View File

@ -290,6 +290,7 @@ export list="
--ignore-table=$base.llx_monmodule_abcdef
--ignore-table=$base.llx_notes
--ignore-table=$base.llx_packages
--ignore-table=$base.llx_packages_extrafields
--ignore-table=$base.llx_pos_cash
--ignore-table=$base.llx_pos_control_cash
--ignore-table=$base.llx_pos_facture
@ -305,6 +306,19 @@ export list="
--ignore-table=$base.llx_residence
--ignore-table=$base.llx_residence_building
--ignore-table=$base.llx_residence_building_links
--ignore-table=$base.llx_scaninvoices_filestoimport
--ignore-table=$base.llx_scaninvoices_filestoimport_extrafields
--ignore-table=$base.llx_scaninvoices_settings
--ignore-table=$base.llx_scaninvoices_settings_extrafields
--ignore-table=$base.llx_sellyoursaas_blacklistcontent
--ignore-table=$base.llx_sellyoursaas_blacklistdir
--ignore-table=$base.llx_sellyoursaas_blacklistfrom
--ignore-table=$base.llx_sellyoursaas_blacklistip
--ignore-table=$base.llx_sellyoursaas_blacklistmail
--ignore-table=$base.llx_sellyoursaas_blacklistto
--ignore-table=$base.llx_sellyoursaas_deploymentserver
--ignore-table=$base.llx_sellyoursaas_stats
--ignore-table=$base.llx_sellyoursaas_whitelistip
--ignore-table=$base.llx_societe_rib2
--ignore-table=$base.llx_sellyoursaas_cancellation
--ignore-table=$base.llx_ticketsup

View File

@ -1181,7 +1181,11 @@ if ($mode == 'deploy') {
} else {
if (getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')) {
// Show clean message
$message = info_admin($langs->trans('InstallModuleFromWebHasBeenDisabledContactUs'));
if (!is_numeric('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')) {
$message = info_admin($langs->trans(getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')));
} else {
$message = info_admin($langs->trans('InstallModuleFromWebHasBeenDisabledContactUs'));
}
} else {
// Show technical message
$message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile", $dolibarrdataroot.'/installmodules.lock'));

View File

@ -109,12 +109,18 @@ if (!$base) {
$arrayoffilesrich = dol_dir_list(DOL_DOCUMENT_ROOT.'/install/mysql/tables/', 'files', 0, '\.sql$');
$arrayoffiles = array();
$arrayoftablesautocreated = array();
foreach ($arrayoffilesrich as $value) {
//print $shortsqlfilename.' ';
$shortsqlfilename = preg_replace('/\-[a-z]+\./', '.', $value['name']);
$arrayoffiles[] = $shortsqlfilename;
$arrayoffiles[$value['name']] = $shortsqlfilename;
if ($value['name'] == $shortsqlfilename && ! preg_match('/\.key\.sql$/', $value['name'])) {
// This is a sql file automatically created
$arrayoftablesautocreated[$value['name']] = $shortsqlfilename;
}
}
// Now loop on tables really found into database
$sql = "SHOW TABLE STATUS";
$resql = $db->query($sql);
@ -123,6 +129,7 @@ if (!$base) {
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td>'.($i+1).'</td>';
@ -130,11 +137,14 @@ if (!$base) {
$tablename = preg_replace('/^'.MAIN_DB_PREFIX.'/', 'llx_', $obj->Name);
if (in_array($tablename.'.sql', $arrayoffiles)) {
$img = "info";
//print img_picto($langs->trans("ExternalModule"), $img);
if (in_array($tablename.'.sql', $arrayoftablesautocreated)) {
$img = "info";
} else {
$img = "info_black";
print img_picto($langs->trans("NotAvailableByDefaultEnabledOnModuleActivation"), $img, 'class="small opacitymedium"');
}
} else {
$img = "info_black";
//print DOL_DOCUMENT_ROOT.'/install/mysql/tables/'.$tablename.'.sql';
print img_picto($langs->trans("ExternalModule"), $img, 'class="small"');
}
print '</td>';

View File

@ -1119,6 +1119,8 @@ class Account extends CommonObject
$this->db->begin();
// @TODO Check there is no child into llx_payment_various, ... to allow deletion ?
// Delete link between tag and bank account
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account";
@ -2018,7 +2020,6 @@ class AccountLine extends CommonObjectLine
$sql .= " b.fk_user_author, b.fk_user_rappro,";
$sql .= " b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note,";
$sql .= " b.fk_bordereau, b.banque, b.emetteur,";
//$sql.= " b.author"; // Is this used ?
$sql .= " ba.ref as bank_account_ref, ba.label as bank_account_label";
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b,";
$sql .= " ".MAIN_DB_PREFIX."bank_account as ba";

View File

@ -126,6 +126,22 @@ class PaymentVarious extends CommonObject
public $fk_user_modif;
/**
* @var int Type of bank account if the payment is on a bank account
*/
public $fk_type;
/**
* @var int 1 if the payment is on a bank account line that is conciliated
*/
public $rappro;
/**
* @var string ID of bank receipt
*/
public $bank_num_releve;
/**
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
@ -251,7 +267,6 @@ class PaymentVarious extends CommonObject
*/
public function fetch($id, $user = null)
{
global $langs;
$sql = "SELECT";
$sql .= " v.rowid,";
$sql .= " v.tms,";
@ -262,7 +277,7 @@ class PaymentVarious extends CommonObject
$sql .= " v.fk_typepayment,";
$sql .= " v.num_payment,";
$sql .= " v.label,";
$sql .= " v.note,";
$sql .= " v.note as note_private,";
$sql .= " v.accountancy_code,";
$sql .= " v.subledger_account,";
$sql .= " v.fk_projet as fk_project,";
@ -271,7 +286,8 @@ class PaymentVarious extends CommonObject
$sql .= " v.fk_user_modif,";
$sql .= " b.fk_account,";
$sql .= " b.fk_type,";
$sql .= " b.rappro";
$sql .= " b.rappro,";
$sql .= " b.num_releve as bank_num_releve";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON v.fk_bank = b.rowid";
$sql .= " WHERE v.rowid = ".((int) $id);
@ -292,7 +308,8 @@ class PaymentVarious extends CommonObject
$this->type_payment = $obj->fk_typepayment;
$this->num_payment = $obj->num_payment;
$this->label = $obj->label;
$this->note = $obj->note;
$this->note = $obj->note_private; // For backward compatibility
$this->note_private = $obj->note_private;
$this->subledger_account = $obj->subledger_account;
$this->accountancy_code = $obj->accountancy_code;
$this->fk_project = $obj->fk_project;
@ -302,6 +319,7 @@ class PaymentVarious extends CommonObject
$this->fk_account = $obj->fk_account;
$this->fk_type = $obj->fk_type;
$this->rappro = $obj->rappro;
$this->bank_num_releve = $obj->bank_num_releve;
}
$this->db->free($resql);

View File

@ -643,18 +643,28 @@ if ($id) {
print $form->editfieldval('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $user->rights->banque->modifier), 'string', '', 0);
print '</td></tr>';
if (isModEnabled("banque")) {
if ($object->fk_account > 0) {
$bankline = new AccountLine($db);
$bankline->fetch($object->fk_bank);
$bankaccountnotfound = 0;
print '<tr>';
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
print '<td colspan="3">';
print $bankline->getNomUrl(1, 0, 'showall');
print '</td>';
print '</tr>';
if (isModEnabled('banque')) {
print '<tr>';
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
print '<td colspan="3">';
if ($object->fk_bank > 0) {
$bankline = new AccountLine($db);
$result = $bankline->fetch($object->fk_bank);
if ($result <= 0) {
$bankaccountnotfound = 1;
} else {
print $bankline->getNomUrl(1, 0, 'showall');
}
} else {
$bankaccountnotfound = 1;
print '<span class="opacitymedium">'.$langs->trans("NoRecordfound").'</span>';
}
print '</td>';
print '</tr>';
}
// Other attributes
@ -684,7 +694,7 @@ if ($id) {
}
// Delete
if (empty($object->rappro)) {
if (empty($object->rappro) || $bankaccountnotfound) {
if (!empty($user->rights->banque->modifier)) {
if ($alreadyaccounted) {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("Accounted").'">'.$langs->trans("Delete").'</a></div>';

View File

@ -9033,6 +9033,9 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
}
}
}
if (is_array($s) || $s === 'Array') {
return 'Bad string syntax to evaluate (value is Array) '.var_export($s, true);
}
if (strpos($s, '::') !== false) {
if ($returnvalue) {
return 'Bad string syntax to evaluate (double : char is forbidden): '.$s;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -217,6 +217,10 @@ DELETE from llx_bank_url where type = 'company' and url_id not in (select rowid
--SELECT * from llx_bank where rappro = 0 and label LIKE '(CustomerInvoicePayment%)' and rowid not in (select fk_bank from llx_bank_url where type = 'payment');
--SELECT * from llx_bank where rappro = 0 and label LIKE '(SupplierInvoicePayment%)' and rowid not in (select fk_bank from llx_bank_url where type = 'payment_supplier');
-- Fix: delete orphelins in llx_bank
DELETE FROM llx_bank WHERE fk_account NOT IN (select rowid from llx_bank_account);
-- Fix link on parent that were removed
DROP table tmp_user;
CREATE TABLE tmp_user as (select * from llx_user);

View File

@ -2374,5 +2374,5 @@ WarningModuleHasChangedSecurityCsrfParameter=Warning: the module %s has disabled
EMailsInGoingDesc=Incoming emails are managed by the module %s. You must enable and configure it if you need to support ingoing emails.
MAIN_IMAP_USE_PHPIMAP=Use the PHP-IMAP library for IMAP instead of native PHP IMAP. This also allows the use of an OAuth2 connection for IMAP (module OAuth must also be activated).
MAIN_CHECKBOX_LEFT_COLUMN=Show the column for field and line selection on the left (on the right by default)
NotAvailableByDefaultEnabledOnModuleActivation=Not created by default. Created on module activation only.
CSSPage=CSS Style