diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 407dbc1aa53..5fb201ebfdc 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -1162,19 +1162,24 @@ if (empty($action) || $action == 'view') {
//var_dump($tabpay[$key]);
print '';
print '
';
+
+ // Date
print "| ".$date." | ";
- print "".$ref." | ";
+
+ // Ref
+ print "".dol_escape_htmltag($ref)." | ";
+
// Ledger account
- print "";
$accounttoshow = length_accountg($k);
if (empty($accounttoshow) || $accounttoshow == 'NotDefined') {
- print ''.$langs->trans("BankAccountNotDefined").'';
- } else {
- print $accounttoshow;
+ $accounttoshow = ''.$langs->trans("BankAccountNotDefined").'';
}
+ print ' | ';
+ print $accounttoshow;
print " | ";
+
// Subledger account
- print "";
+ print ' | ';
/*$accounttoshow = length_accountg($k);
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
{
@@ -1182,9 +1187,12 @@ if (empty($action) || $action == 'view') {
}
else print $accounttoshow;*/
print " | ";
- print "";
- print $reflabel;
+
+ // Label operation
+ print ' | ';
+ print $reflabel; // This is already html escaped content
print " | ";
+
print ''.$val["type_payment"]." | ";
print ''.($mt >= 0 ? price($mt) : '')." | ";
print ''.($mt < 0 ? price(-$mt) : '')." | ";
@@ -1208,10 +1216,14 @@ if (empty($action) || $action == 'view') {
print '';
print '
';
+
+ // Date
print "| ".$date." | ";
- print "".$ref." | ";
+
+ // Ref
+ print "".dol_escape_htmltag($ref)." | ";
+
// Ledger account
- print "";
$account_ledger = $k;
// Try to force general ledger account depending on type
if ($tabtype[$key] == 'payment') {
@@ -1240,9 +1252,9 @@ if (empty($action) || $action == 'view') {
if ($tabtype[$key] == 'unknown') {
// We will accept writing, but into a waiting account
if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE == '-1') {
- print ''.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'';
+ $accounttoshow = ''.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'';
} else {
- print ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will use a waiting account
+ $accounttoshow = ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will use a waiting account
}
} else {
// We will refuse writing
@@ -1265,15 +1277,15 @@ if (empty($action) || $action == 'view') {
if ($tabtype[$key] == 'member') {
$errorstring = 'MainAccountForSubscriptionPaymentNotDefined';
}
- print ''.$langs->trans($errorstring).'';
+ $accounttoshow = ''.$langs->trans($errorstring).'';
}
- } else {
- print $accounttoshow;
}
+ print ' | ';
+ print $accounttoshow;
print " | ";
// Subledger account
- print "";
+ $accounttoshowsubledger = '';
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payments that uses a subledger
$accounttoshowsubledger = length_accounta($k);
if ($accounttoshow != $accounttoshowsubledger) {
@@ -1285,18 +1297,20 @@ if (empty($action) || $action == 'view') {
if (!empty($tabcompany[$key]['code_compta'])) {
if (in_array($tabtype[$key], array('payment_various', 'payment_salary'))) {
// For such case, if subledger is not defined, we won't use subledger accounts.
- print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'';
+ $accounttoshowsubledger = ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'';
} else {
- print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'';
+ $accounttoshowsubledger = ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'';
}
} else {
- print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'';
+ $accounttoshowsubledger = ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'';
}
- } else {
- print $accounttoshowsubledger;
}
+ } else {
+ $accounttoshowsubledger = '';
}
}
+ print ' | ';
+ print $accounttoshowsubledger;
print " | ";
print "".$reflabel." | ";
diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php
index 5cf5d7288c3..d4f252bfd43 100644
--- a/htdocs/api/class/api_documents.class.php
+++ b/htdocs/api/class/api_documents.class.php
@@ -507,7 +507,9 @@ class Documents extends DolibarrApi
}
$objectType = $modulepart;
- if (! empty($object->id) && ! empty($object->table_element)) $objectType = $object->table_element;
+ if (! empty($object->id) && ! empty($object->table_element)) {
+ $objectType = $object->table_element;
+ }
$filearray = dol_dir_list($upload_dir, $type, $recursive, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
if (empty($filearray)) {
diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php
index a67feeffe64..28ac15a43ff 100644
--- a/htdocs/core/db/pgsql.class.php
+++ b/htdocs/core/db/pgsql.class.php
@@ -1238,7 +1238,7 @@ class DoliDBPgsql extends DoliDB
// phpcs:enable
$sql = "ALTER TABLE ".$table;
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
- if (in_array($field_desc['type'], array('double', 'tinyint', 'int', 'varchar')) && $field_desc['value']) {
+ if (in_array($field_desc['type'], array('double', 'varchar')) && $field_desc['value']) {
$sql .= "(".$field_desc['value'].")";
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index f167b23fc98..cf576d3b4d7 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4070,7 +4070,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
'uncheck', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private',
- 'conferenceorbooth', 'eventorganization'
+ 'conferenceorbooth', 'eventorganization',
+ 'stamp', 'signature'
))) {
$fakey = $pictowithouttext;
$facolor = '';
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index 7182dd45f31..95de1f53da8 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -791,16 +791,11 @@ END;
// Barcode type
print '
';
- print '| '.$langs->trans('BarcodeType').' | ';
+ print ''.$langs->trans('GencodBuyPrice').' | ';
print '';
- print $formbarcode->selectBarcodeType(($rowid ? $object->supplier_fk_barcode_type : getDolGlobalint("PRODUIT_DEFAULT_BARCODE_TYPE")), 'fk_barcode_type', 1);
- print ' | ';
- print '
';
-
- // Barcode value
- print '';
- print '| '.$langs->trans('BarcodeValue').' | ';
- print ''.img_picto('', 'barcode', 'class="pictofixedwidth"').' | ';
+ print img_picto('', 'barcode', 'class="pictofixedwidth"');
+ print $formbarcode->selectBarcodeType((GETPOSTISSET('fk_barcode_type') ? GETPOST('fk_barcode_type', 'int') : ($rowid ? $object->supplier_fk_barcode_type : getDolGlobalint("PRODUIT_DEFAULT_BARCODE_TYPE"))), 'fk_barcode_type', 1);
+ print ' ';
print '
';
}
diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php
index 0eaf8654421..cd232061bc4 100644
--- a/htdocs/projet/class/api_tasks.class.php
+++ b/htdocs/projet/class/api_tasks.class.php
@@ -544,7 +544,7 @@ class Tasks extends DolibarrApi
$this->task->timespent_datehour = $newdate;
$this->task->timespent_withhour = 1;
$this->task->timespent_duration = $duration;
- $this->task->timespent_fk_user = $user_id;
+ $this->task->timespent_fk_user = $uid;
$this->task->timespent_note = $note;
$result = $this->task->addTimeSpent(DolibarrApiAccess::$user, 0);