Skip to content

Commit

Permalink
Merge branch '19.0' of https://github.com/Dolibarr/dolibarr into 19.0…
Browse files Browse the repository at this point in the history
…_tropikelec
  • Loading branch information
support committed Sep 18, 2024
2 parents 74c5c1c + b0fe6a0 commit 1efd414
Show file tree
Hide file tree
Showing 283 changed files with 3,017 additions and 2,139 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ repos:
- id: fix-byte-order-marker
- id: check-case-conflict

# Beautify shell scripts
- repo: https://github.com/gitleaks/gitleaks.git
rev: v8.16.1
hooks:
- id: gitleaks

# Beautify shell scripts
- repo: https://github.com/lovesegfault/beautysh.git
rev: v6.2.1
Expand Down
79 changes: 75 additions & 4 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,77 @@ English Dolibarr ChangeLog
--------------------------------------------------------------


***** ChangeLog for 19.0.3 compared to 19.0.2 *****
FIX: #29403 HRM - Unable to delete a skill in a job Profile (#29779)
FIX: #29439 incomplete API return (#29796)
FIX: #29756 Sql error on comment search (#29761)
FIX: #29780 Restore filtes when using "back to list"
FIX: #30010 : Use conf TICKET_MESSAGE_MAIL_INTRO instead of translation key (#30081)
FIX: #30274 : Add the include before executing dolibarr_set_const (#30320)
FIX: #30467
FIX: #30576 - Salary payment - Date of the payment is not displayed (#30592)
FIX: Accountancy - Avoid space on FEC name file (#29716)
FIX: Accountancy - Generate entries of expense report with localtax (#30411)
FIX: ASSET: annual depreciation starting year (Again ;-)) #26084 (#30040)
FIX: Backport page inventory.php from v18 to fix pagination bugs causing data loss (#29688)
FIX: back to page on error in contact card (#29627)
FIX: Bad calculation of $nbtotalofrecord (#30183)
FIX: Bad count of total of supplie rinvoice into the list
FIX: Better compatibility when objectdesc is not valid, and warnings
FIX: broken pdf preview when multicompany sharing (#30188)
FIX: compatibility with MULTICOMPANY_TRANSVERSE_MODE (#30599)
FIX: Conflict with autoload (#30399)
FIX: Display the real_PMP on inventory when its value is equal to 0 (#22291)
FIX: Error mesg show untranslated extrafield name (#30227)
FIX: executeHooks $object default value (#29647)
FIX: expedition PDF models using units labels (#30358)
FIX: Extrafield intshowzero in list (#29789)
FIX: Extrafields always been delete and re insert for categories (#29781)
FIX: extrafields on Organized events was broken
FIX: fatal error on loading pictures in attached documents of an event (#30553)
FIX: for country type (#29745)
FIX: group by qty in product margin tab (#29853)
FIX: init total amounts in margin module (#29854)
FIX: issue to get the right files exported in Quadratrus export.php (#30004)
FIX: lang output for sales representative on PDF (#30469)
FIX: langs in common docgenerator (#29774)
FIX: langs overwrite (#29630)
FIX: lettering (auto) for invoice deposit with company discount (#29633)
FIX: missing $object and $action for hook parameters (#30484)
FIX: Missing $param in hook call for list
FIX: Missing expense report picto in list (#29917)
FIX: Missing expense report picto in menu (#29908)
FIX: Missing the description in tooltip when option show in tooltip on
FIX: mo cloning (#29686)
FIX: modification date from label in accounting bookkeeping list (#30038)
FIX: move porpale ref pdf cornas (#29989)
FIX: Not qualified lines for reception (#29473)
FIX: on change ref for bank account attachment are lost (#30529)
FIX: orders to bill menu (#30179)
FIX: Page expands when ticket messages are too long (#29785)
FIX: parameter name (#29666)
FIX: PHP8 warning if $conf->reception is checked the old fashion way (#29697)
FIX: PHP 8 warning on output of successful cronjob (#29922)
FIX: PHP exception on getSpecialCode (#29646)
FIX: php warning if cookie doesn’t exist (#29723)
FIX: pos: invoice date incorrectly set because of timezome mismatches (reverts #36e91da) (#30184)
FIX: public project form return an error if SOCIETE_EMAIL_UNIQUE (#29942)
FIX: REPLENISH MANY FOURN WHEN ORDER ALREADY CREATE (#29710)
FIX: Supplier Order search on date valid (#30448)
FIX: Ternary operator condition is always true/false (#29649)
FIX: to avoid error during upgrade with pgsql (#30443)
FIX: transfer in accountancy for expense reports.
FIX: uninitialised var (#29728)
FIX: - Unknown Character on HTML (#30257)
FIX: Unsigned propal having signing date (#29825)
FIX: Update asset.class.php
FIX: update date_echeance of supplier invoices when we update invoice date in the past (#29886)
FIX: User List - Function is show in wrong column when module HRM enabled (#30186)
FIX: var name error and remove useless code (#30601)
FIX: Warning: Undefined property: PropaleLigne::$situation_percent in /home/httpd/vhosts/aflac.fr/domains/dol190.aflac.fr/httpdocs/core/lib/pdf.lib.php on line 2442 (#30033)
FIX: wrong value for duration unit (#30261)
FIX: The ZAR currency must show the R before the amount

***** ChangeLog for 19.0.2 compared to 19.0.1 *****
FIX: $object->oldcopy may be a stdClass and not original object
FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269)
Expand Down Expand Up @@ -3091,7 +3162,7 @@ NEW: add quick dropdown menu in top right menu (experimental with MAIN_USE_TOP_M
NEW: add region in export companies and contacts
NEW: add rights on margin info on invoice list
NEW: add search param for close date on order list
NEW: add show preview for mail attachement on form mail
NEW: add show preview for mail attachment on form mail
NEW: add State/Province origin for products
NEW: add the workflow interaction close intervention on closing ticket
NEW: add tracking number in list and search_all items
Expand Down Expand Up @@ -4476,7 +4547,7 @@ FIX: access to public interface when origin email has an alias.
FIX: Alias name is not into the email recipient label.
FIX: allow standalone credit note even if no invoice
FIX: an admin can not access his own permissions after enabling advanced permissions
FIX: Attachement of linked files on ticket when sending a message
FIX: Attachment of linked files on ticket when sending a message
FIX: avoid non numeric warning
FIX: Bad currency var used in stripe for connect
FIX: Bad list of ticket on public interface for ticket emailcollector
Expand Down Expand Up @@ -5272,7 +5343,7 @@ NEW: hidden option to define an invoice template for each invoice type
NEW: Highlight lines on lists when they are checked
NEW: Notification module support expense report+holiday validation and approval
NEW: On customer/supplier card, add simple tooltip to amount boxes
NEW: Page to check if the operations/items created between two dates have attached item(s) and possibility to download all attachements
NEW: Page to check if the operations/items created between two dates have attached item(s) and possibility to download all attachments
NEW: possibility to add all rights of all modules in one time
NEW: redirect if only one result on global search on card
NEW: Permission to ignore price min
Expand Down Expand Up @@ -6716,7 +6787,7 @@ NEW: No external check of version without explicit click in about page.
NEW: ODT docs for USER USERGROUP CONTRACT and PRODUCT class
NEW: odt usergroup
NEW: On invoices generated by template, we save if invoice come from a source template.
NEW: option to copy into attachement files of events, files send by mail (with auto event creation)
NEW: option to copy into attachment files of events, files send by mail (with auto event creation)
NEW: PDF with numbertoword
NEW: Permit multiple file upload in linked documents
NEW: PHP 7.1 compatibility
Expand Down
14 changes: 7 additions & 7 deletions build/generate_filelist_xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// Test if batch mode
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit;
exit(1);
}

require_once $path."../htdocs/master.inc.php";
Expand All @@ -51,7 +51,7 @@
if (empty($argv[1])) {
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value] [buildzip=1]\n";
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
exit -1;
exit(1);
}


Expand Down Expand Up @@ -87,7 +87,7 @@
if (empty($release)) {
print "Error: Missing release parameter\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
exit -1;
exit(2);
}

$savrelease = $release;
Expand All @@ -107,21 +107,21 @@
if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto') {
print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpverbis[0].')'."\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
exit -1;
exit(3);
}
} else {
$tmpverter = explode('-', DOL_VERSION, 2);
if ($tmpverter[0] != $tmpverbis[0]) {
print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must have value without prefix ('.$tmpverter[0].') that is exact same value than "release" parameter ('.$tmpverbis[0].')'."\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
exit -1;
exit(4);
}
}
} else {
if (!preg_match('/'.preg_quote(DOL_VERSION, '/').'-/', $release)) {
print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parameter (ex: '.DOL_VERSION.'-mydistrib).'."\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
exit -1;
exit(5);
}
}

Expand All @@ -147,7 +147,7 @@
$fp = fopen($outputfile, 'w');
if (empty($fp)) {
print 'Failed to open file '.$outputfile."\n";
exit(-1);
exit(6);
}

fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Method to encode/decode ZATCA string is available in test/phpunit/BarcodeTest.ph


* FOR QR-Bill in switzerland - Facture-QR
-----------------------------------------
Syntax of QR Code - See file ig-qr-bill-v2.2-fr.pdf (more doc on https://www.swiss-qr-invoice.org/downloads/)
Syntax of complentary field named "structured information of invoice S1": https://www.swiss-qr-invoice.org/downloads/qr-bill-s1-syntax-fr.pdf
Syntax of complementary field named "structured information of invoice S1": https://www.swiss-qr-invoice.org/downloads/qr-bill-s1-syntax-fr.pdf
To test/validate: https://www.swiss-qr-invoice.org/validator/
4 changes: 3 additions & 1 deletion dev/tools/codespell/codespell-ignore.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# List of words codespell will ignore
# one per line, case-sensitive (when not lowercase)
# one per line, must be in lower case.
# PROVid
provid
# PostgreSQL
postgresql
# ZAR currency
zar

alltime
ba
Expand Down
7 changes: 2 additions & 5 deletions htdocs/accountancy/bookkeeping/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,6 @@
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$objectstatic = new Facture($db);
$objectstatic->fetch($line->fk_doc);
//$modulepart = 'facture';

$filename = dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
Expand All @@ -1208,19 +1207,17 @@
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$objectstatic = new FactureFournisseur($db);
$objectstatic->fetch($line->fk_doc);
//$modulepart = 'invoice_supplier';

$filename = dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
$subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $objectstatic->element).dol_sanitizeFileName($line->doc_ref);
$subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $objectstatic->element).dol_sanitizeFileName($line->doc_ref);
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
} elseif ($line->doc_type == 'expense_report') {
$langs->loadLangs(array('trips'));

require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$objectstatic = new ExpenseReport($db);
$objectstatic->fetch($line->fk_doc);
//$modulepart = 'expensereport';

$filename = dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/bookkeeping/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@
print $form->selectDate($search_date_modification_start, 'search_date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrapfordate">';
print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '</td>';
}
Expand Down
32 changes: 28 additions & 4 deletions htdocs/accountancy/class/lettering.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ class Lettering extends BookKeeping
'table' => 'societe_remise_except',
'fk_doc' => 'fk_facture_source',
'fk_link' => 'fk_facture',
'fk_line_link' => 'fk_facture_line',
'table_link_line' => 'facturedet',
'fk_table_link_line' => 'rowid',
'fk_table_link_line_parent' => 'fk_facture',
'prefix' => 'a',
'is_fk_link_is_also_fk_doc' => true,
),
Expand All @@ -73,6 +77,10 @@ class Lettering extends BookKeeping
'table' => 'societe_remise_except',
'fk_doc' => 'fk_invoice_supplier_source',
'fk_link' => 'fk_invoice_supplier',
'fk_line_link' => 'fk_invoice_supplier_line',
'table_link_line' => 'facture_fourn_det',
'fk_table_link_line' => 'rowid',
'fk_table_link_line_parent' => 'fk_facture_fourn',
'prefix' => 'a',
'is_fk_link_is_also_fk_doc' => true,
),
Expand Down Expand Up @@ -781,10 +789,26 @@ public function getLinkedDocumentByGroup($document_ids, $doc_type)
$link_by_element = array();
$element_by_link = array();
foreach ($doc_type_info['linked_info'] as $linked_info) {
$sql = "SELECT DISTINCT tl2." . $linked_info['fk_link'] . " AS fk_link, tl2." . $linked_info['fk_doc'] . " AS fk_doc";
$sql .= " FROM " . MAIN_DB_PREFIX . $linked_info['table'] . " AS tl";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $linked_info['table'] . " AS tl2 ON tl2." . $linked_info['fk_link'] . " = tl." . $linked_info['fk_link'];
$sql .= " WHERE tl." . $linked_info['fk_doc'] . " IN (" . $this->db->sanitize(implode(',', $document_ids)) . ")";
if (empty($linked_info['fk_line_link'])) {
$sql = "SELECT DISTINCT tl2.".$linked_info['fk_link']." AS fk_link, tl2.".$linked_info['fk_doc']." AS fk_doc";
$sql .= " FROM ".MAIN_DB_PREFIX.$linked_info['table']." AS tl";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$linked_info['table']." AS tl2 ON tl2.".$linked_info['fk_link']." = tl.".$linked_info['fk_link'];
$sql .= " WHERE tl.".$linked_info['fk_doc']." IN (".$this->db->sanitize(implode(',', $document_ids)).")";
} else {
$sql = "SELECT DISTINCT tl2.fk_link, tl2.fk_doc";
$sql .= " FROM (";
$sql .= " SELECT DISTINCT " . $this->db->ifsql("tll." . $linked_info['fk_table_link_line_parent'], "tll." . $linked_info['fk_table_link_line_parent'], "tl." . $linked_info['fk_link']) . " AS fk_link, tl." . $linked_info['fk_doc'] . " AS fk_doc";
$sql .= " FROM " . MAIN_DB_PREFIX . $linked_info['table'] . " AS tl";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $linked_info['table_link_line'] . " AS tll ON tll." . $linked_info['fk_table_link_line'] . " = tl." . $linked_info['fk_line_link'];
$sql .= ") AS tl";
$sql .= " LEFT JOIN (";
$sql .= " SELECT DISTINCT " . $this->db->ifsql("tll." . $linked_info['fk_table_link_line_parent'], "tll." . $linked_info['fk_table_link_line_parent'], "tl." . $linked_info['fk_link']) . " AS fk_link, tl." . $linked_info['fk_doc'] . " AS fk_doc";
$sql .= " FROM " . MAIN_DB_PREFIX . $linked_info['table'] . " AS tl";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $linked_info['table_link_line'] . " AS tll ON tll." . $linked_info['fk_table_link_line'] . " = tl." . $linked_info['fk_line_link'];
$sql .= ") AS tl2 ON tl2.fk_link = tl.fk_link";
$sql .= " WHERE tl.fk_doc IN (" . $this->db->sanitize(implode(',', $document_ids)) . ")";
$sql .= " AND tl2.fk_doc IS NOT NULL";
}

dol_syslog(__METHOD__ . " - Get document lines", LOG_DEBUG);
$resql = $this->db->query($sql);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/expensereport/lines.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
$sql .= natural_search("f.label", $search_label);
}
if (strlen(trim($search_desc))) {
$sql .= natural_search("er.comments", $search_desc);
$sql .= natural_search("erd.comments", $search_desc);
}
if (strlen(trim($search_amount))) {
$sql .= natural_search("erd.total_ht", $search_amount, 1);
Expand Down
25 changes: 21 additions & 4 deletions htdocs/accountancy/journal/bankjournal.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,11 @@
$tabtype = array();
$tabmoreinfo = array();

// Loop on each line into llx_bank table. For each line, we should get:
// Loop on each line into the llx_bank table. For each line, we should get:
// one line tabpay = line into bank
// one line for bank record = tabbq
// one line for thirdparty record = tabtp
// Note: tabcompany is used to store the subledger account
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($result);
Expand Down Expand Up @@ -269,7 +270,8 @@
);

// Set accountancy code for user
// $obj->accountancy_code is the accountancy_code of table u=user but it is defined only if a link with type 'user' exists)
// $obj->accountancy_code is the accountancy_code of table u=user (but it is defined only if
// a link with type 'user' exists and user as a subledger account)
$compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : '');

$tabuser[$obj->rowid] = array(
Expand Down Expand Up @@ -331,9 +333,12 @@
break;
}
}

// Now loop on each link of record in bank (code similar to bankentries_list.php)
foreach ($links as $key => $val) {
if ($links[$key]['type'] == 'user' && !$is_sc && !$is_salary && !$is_expensereport) {
// We must avoid as much as possible this "continue". If we want to jump to next loop, it means we don't want to process
// the case the link is user (often because managed by hard coded code into another link), and we must avoid this.
continue;
}
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) {
Expand Down Expand Up @@ -385,13 +390,25 @@
$userstatic->statut = $tabuser[$obj->rowid]['status'];
$userstatic->status = $tabuser[$obj->rowid]['status'];
$userstatic->accountancy_code = $tabuser[$obj->rowid]['accountancy_code'];
// For a payment of social contribution, we have a link sc + user.
// but we already fill the $tabpay[$obj->rowid]["soclib"] in the line 'sc'.
// If we fill it here to, we must concat
if ($userstatic->id > 0) {
$tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0);
if ($is_sc) {
$tabpay[$obj->rowid]["soclib"] .= ' '.$userstatic->getNomUrl(1, 'accountancy', 0);
} else {
$tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0);
}
} else {
$tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
}

if ($compta_user) {
$tabtp[$obj->rowid][$compta_user] += $amounttouse;
if ($is_sc) {
//$tabcompany[$obj->rowid][$compta_user] += $amounttouse;
} else {
$tabtp[$obj->rowid][$compta_user] += $amounttouse;
}
}
} elseif ($links[$key]['type'] == 'sc') {
$chargestatic->id = $links[$key]['url_id'];
Expand Down
Loading

0 comments on commit 1efd414

Please sign in to comment.