diff --git a/ChangeLog b/ChangeLog
index 48ba5daa562..c477a17d684 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,33 +2,12 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
-***** ChangeLog for 13.0.4 compared to 13.0.2 *****
-
-FIX: Allow disabling of a module (not a dangerous action) even if there is problem with token (due to bugged modules).
-FIX: 13.0 - fatal - missing inclusion of ajax.lib.php for calling `ajax_autocompleter()`
-FIX: #17919 pictures in docs.
-FIX: #18006
-FIX: Accountancy - if we define a date start, automatic binding try to continue to solve old binding
-FIX: Accoutancy Limit date payment not registered on purchases operations
-FIX: Can't edit replacement invoice
-FIX: deposit can create credit note in payment conf
-FIX: division by zero on create
-FIX: holiday: balances not updated correctly with pgsql because of case sensitivity field
-FIX: holiday: status filter parameter has been renamed but not in links it was used
-FIX: List and Create Companies Left Menus
-FIX: method exists
-FIX: need to add payment sum to getlibstatus function in object linked block
-FIX: permission to close a proposal when using advanced permissions
-FIX: Problem of z-index with popup and top menu
-FIX: same thing on supplier orders
-FIX: Status of invoice when making a replacement invoice
-FIX: update contact birthday alert
***** ChangeLog for 14.0.0 compared to 13.0.0 *****
For users:
----------
-NEW: Module Recruitement to follow application to job positions is now stable.
+NEW: Module Recruitment to follow application to job positions is now stable.
NEW: Feature to make Stock Inventories
NEW: Several security issues after a second private bug hunting campaign.
NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better)
@@ -71,7 +50,7 @@ NEW: Make public bookmarks editable by admin users only
NEW: If main logo not defined, can use the squarred logo on login page
NEW: The manifest file can use the squared image if available
NEW: Enhance the multicurrency rate editor
-NEW: Normalyse Type company field with ajax combobox
+NEW: Normalise Type company field with ajax combobox
NEW: preload product description on selection for customer propal/order/invoice
NEW: Search usergroups & resources
NEW: Setup Page for module creation with module builder enhancement #FoundationFunding
@@ -88,14 +67,15 @@ NEW: #16378 more E-Mail Contact substitution Values for better salutation
NEW: option to keep the "Automatically create the payment" checkbox empty on the tax creation page
Accountancy
-NEW: Accountancy - Add FEC import
-NEW: Accountancy - Add a confirmation form with options on export
-NEW: Accountancy - Add select date from/to in already bind customer and supplier list
-NEW: Accountancy - Format FEC - Add new field DateLimitReglmt
-NEW: Accountancy - In ledger & journals, show link on bank transaction
-NEW: Accountancy - Possibility to filter on journals in balance
-NEW: Accountancy - Add a page to list subledger accounts
-NEW: Multiselect ledger account code filter on book keeping list
+NEW: Add FEC import
+NEW: Add a confirmation form with options on export (for notified export and validate operations)
+NEW: Add select date from/to in already bind customer and supplier list
+NEW: FEC / FEC2 export - Add new field DateLimitReglmt
+NEW: In ledger & journals, show link on bank transaction
+NEW: Possibility to filter on journals in balance
+NEW: Add a page to list subledger accounts
+NEW: Multiselect journal code filter on journal / balance / ledger
+NEW: Add first step to close fiscal year
Agenda
NEW: add support for Friday as a non working day
@@ -114,7 +94,7 @@ NEW: can filter files in ECM/GED on status Shared / Not shared
NEW: add a check to avoid an invoice date in the future
NEW: add the total of margin in invoice list
NEW: can set a percentage when creating an invoice from another object
-NEW: Support down payment on supplier invoice (& somes ajustments)
+NEW: Support down payment on supplier invoice (& some adjustments)
Margin
NEW: add the total of margin in invoice list
@@ -183,7 +163,7 @@ NEW: Add a security center page with all information and advices related to the
NEW: Add a performance center page with all information and advices related to the performance of your instance
Modules
-NEW: Module Recruitement is now stable
+NEW: Module Recruitment is now stable
NEW: start new experimental module Event Organization Management
NEW: start new experimental module Partnership Management
NEW: start new experimental module Knowledge Management
@@ -192,11 +172,14 @@ NEW: Check update availability for externals modules using a button on module pa
Module SimplePOS is deprecated - TakePOS is recommended for the future
new Options
-NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
-NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
-NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
-NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field
-NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
+NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
+NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
+NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
+NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field
+NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
+NEW: add constant ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY to manage binding with accountancy account declared on thirdparty card
+NEW: add constant MAIN_PRODUCT_PERENTITY_SHARED to manage some informations (Accounting account) when product is shared on several entities
+NEW: add constant MAIN_COMPANY_PERENTITY_SHARED to manage some informations (Accounting account) when company is shared on several entities
For developers:
@@ -230,7 +213,7 @@ NEW: hook printFieldListTitle for cabyprodserv.php
NEW: hook to allow external modules to add their own shortlist of recent objects
NEW: SQL-altering hooks in the turnover by product report
NEW: add form confirm hook on company card
-NEW: add hook addSectionECMAuto method to add custom diretory into ECM auto files
+NEW: add hook addSectionECMAuto method to add custom directory into ECM auto files
WARNING:
@@ -240,13 +223,37 @@ Following changes may create regressions for some external modules, but were nec
* The ICS value for direct debit or credit transfer is now stored on each bank account instead of into the global setup.
* API /setup/shipment_methods has been replaced with API /setup/shipping_methods
* Field "total" renamed into "total_ht" for table llx_facture, llx_facture_rec for better field name consistency
-* Field "tva" renamed into "total_tva" for table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
+* Field "tva" renamed into "total_tva" for llx_facture, table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
* Field "total" renamed into "total_ttc" for table llx_propal, llx_supplier_proposal for better field name consistency
* If your database is PostgreSQL, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT)
* If your database is MySQL or MariaDB, you need at least version 5.1
* Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules
-* removed deprecated subtituion key __REFCLIENT__ (replaced with __REF_CLIENT__)
+* Removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__)
* Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries.
+* v14 seems to work correctly on PHP v8 but it generates a lot of verbose warnings. Currently, v14 i snot yet officialy supported with PHP 8.
+
+
+***** ChangeLog for 13.0.4 compared to 13.0.3 *****
+
+FIX: Allow disabling of a module (not a dangerous action) even if there is problem with token (due to bugged modules).
+FIX: 13.0 - fatal - missing inclusion of ajax.lib.php for calling 'ajax_autocompleter()'
+FIX: #17919 pictures in docs
+FIX: #18006
+FIX: Accountancy - if we define a date start, automatic binding try to continue to solve old binding
+FIX: Accountancy - Limit date payment not registered on purchases operations
+FIX: Can't edit replacement invoice
+FIX: deposit can create credit note in payment conf
+FIX: division by zero on create
+FIX: holiday: balances not updated correctly with pgsql because of case sensitivity field
+FIX: holiday: status filter parameter has been renamed but not in links it was used
+FIX: List and Create Companies Left Menus
+FIX: method exists
+FIX: need to add payment sum to getlibstatus function in object linked block
+FIX: permission to close a proposal when using advanced permissions
+FIX: Problem of z-index with popup and top menu
+FIX: same thing on supplier orders
+FIX: Status of invoice when making a replacement invoice
+FIX: update contact birthday alert
***** ChangeLog for 13.0.3 compared to 13.0.2 *****
@@ -337,7 +344,7 @@ FIX: File attachment on lots/batches
FIX: handling $heightforinfotot when he's superior to a page height on Supplier Invoice
FIX: hourglass and hide button to pay
FIX: massaction validate invoice do not regenerate PDF
-FIX: missing mp4 video mime
+FIX: #16627 fix missing mp4 video mime
FIX: picto on shipment to reset qty to 0. Some quantities were not reset.
FIX: Protection to avoid #16504
FIX: rounding amount on card updating
diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php
index 98320613bfc..f8c0c95d3c1 100644
--- a/htdocs/accountancy/admin/index.php
+++ b/htdocs/accountancy/admin/index.php
@@ -91,7 +91,6 @@ if ($action == 'update') {
if (!$error) {
foreach ($list as $constname) {
$constvalue = GETPOST($constname, 'alpha');
- var_dump($constname);
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index 4c7194b2255..c156a388735 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -637,6 +637,8 @@ if ($action == 'create') {
print_liste_field_titre("Credit", "", "", "", "", 'class="right"');
if (empty($object->date_validation)) {
print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"');
+ } else {
+ print_liste_field_titre("");
}
print "\n";
@@ -683,8 +685,8 @@ if ($action == 'create') {
print '
'.price($line->debit).'
';
print '
'.price($line->credit).'
';
- if (empty($line->date_export) || empty($line->date_validation)) {
- print '
';
print '';
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index a70bb710937..bc260c77ed3 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -366,42 +366,42 @@ if (empty($reshook)) {
if (!empty($search_date_creation_start)) {
$filter['t.date_creation>='] = $search_date_creation_start;
$tmp = dol_getdate($search_date_creation_start);
- $param .= '&date_creation_startmonth='.urlencode($tmp['mon']).'&date_creation_startday='.urlencode($tmp['mday']).'&date_creation_startyear='.urlencode($tmp['year']);
+ $param .= '&search_date_creation_startmonth='.urlencode($tmp['mon']).'&search_date_creation_startday='.urlencode($tmp['mday']).'&search_date_creation_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_creation_end)) {
$filter['t.date_creation<='] = $search_date_creation_end;
$tmp = dol_getdate($search_date_creation_end);
- $param .= '&date_creation_endmonth='.urlencode($tmp['mon']).'&date_creation_endday='.urlencode($tmp['mday']).'&date_creation_endyear='.urlencode($tmp['year']);
+ $param .= '&search_date_creation_endmonth='.urlencode($tmp['mon']).'&search_date_creation_endday='.urlencode($tmp['mday']).'&search_date_creation_endyear='.urlencode($tmp['year']);
}
if (!empty($search_date_modification_start)) {
$filter['t.tms>='] = $search_date_modification_start;
$tmp = dol_getdate($search_date_modification_start);
- $param .= '&date_modification_startmonth='.urlencode($tmp['mon']).'&date_modification_startday='.urlencode($tmp['mday']).'&date_modification_startyear='.urlencode($tmp['year']);
+ $param .= '&search_date_modification_startmonth='.urlencode($tmp['mon']).'&search_date_modification_startday='.urlencode($tmp['mday']).'&search_date_modification_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_modification_end)) {
$filter['t.tms<='] = $search_date_modification_end;
$tmp = dol_getdate($search_date_modification_end);
- $param .= '&date_modification_endmonth='.urlencode($tmp['mon']).'&date_modification_endday='.urlencode($tmp['mday']).'&date_modification_endyear='.urlencode($tmp['year']);
+ $param .= '&search_date_modification_endmonth='.urlencode($tmp['mon']).'&search_date_modification_endday='.urlencode($tmp['mday']).'&search_date_modification_endyear='.urlencode($tmp['year']);
}
if (!empty($search_date_export_start)) {
$filter['t.date_export>='] = $search_date_export_start;
$tmp = dol_getdate($search_date_export_start);
- $param .= '&date_export_startmonth='.urlencode($tmp['mon']).'&date_export_startday='.urlencode($tmp['mday']).'&date_export_startyear='.urlencode($tmp['year']);
+ $param .= '&search_date_export_startmonth='.urlencode($tmp['mon']).'&search_date_export_startday='.urlencode($tmp['mday']).'&search_date_export_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_export_end)) {
$filter['t.date_export<='] = $search_date_export_end;
$tmp = dol_getdate($search_date_export_end);
- $param .= '&date_export_endmonth='.urlencode($tmp['mon']).'&date_export_endday='.urlencode($tmp['mday']).'&date_export_endyear='.urlencode($tmp['year']);
+ $param .= '&search_date_export_endmonth='.urlencode($tmp['mon']).'&search_date_export_endday='.urlencode($tmp['mday']).'&search_date_export_endyear='.urlencode($tmp['year']);
}
if (!empty($search_date_validation_start)) {
$filter['t.date_validated>='] = $search_date_validation_start;
$tmp = dol_getdate($search_date_validation_start);
- $param .= '&date_validation_startmonth='.urlencode($tmp['mon']).'&date_validation_startday='.urlencode($tmp['mday']).'&date_validation_startyear='.urlencode($tmp['year']);
+ $param .= '&search_date_validation_startmonth='.urlencode($tmp['mon']).'&search_date_validation_startday='.urlencode($tmp['mday']).'&search_date_validation_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_validation_end)) {
$filter['t.date_validated<='] = $search_date_validation_end;
$tmp = dol_getdate($search_date_validation_end);
- $param .= '&date_validation_endmonth='.urlencode($tmp['mon']).'&date_validation_endday='.urlencode($tmp['mday']).'&date_validation_endyear='.urlencode($tmp['year']);
+ $param .= '&search_date_validation_endmonth='.urlencode($tmp['mon']).'&search_date_validation_endday='.urlencode($tmp['mday']).'&search_date_validation_endyear='.urlencode($tmp['year']);
}
if (!empty($search_debit)) {
$filter['t.debit'] = $search_debit;
@@ -576,7 +576,7 @@ if (!empty($sortfield)) {
// Export into a file with format defined into setup (FEC, CSV, ...)
// Must be after definition of $sql
if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) {
- // TODO Replace the fetchAll + ->export later that consume too much memory on large export with the query($sql) and loop on each line to export them.
+ // TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumew too much memory on large export. Replace this with the query($sql) and loop on each line to export them.
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1));
if ($result < 0) {
@@ -822,7 +822,7 @@ if (!empty($arrayfields['t.piece_num']['checked'])) {
// Code journal
if (!empty($arrayfields['t.code_journal']['checked'])) {
print '
';
diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php
index 0bd60445613..c8aa1407ddb 100644
--- a/htdocs/accountancy/class/accountancyexport.class.php
+++ b/htdocs/accountancy/class/accountancyexport.class.php
@@ -5,7 +5,7 @@
* Copyright (C) 2015 Florian Henry
* Copyright (C) 2015 Raphaël Doursenaud
* Copyright (C) 2016 Pierre-Henry Favre
- * Copyright (C) 2016-2020 Alexandre Spangaro
+ * Copyright (C) 2016-2021 Alexandre Spangaro
* Copyright (C) 2013-2017 Olivier Geffroy
* Copyright (C) 2017 Elarifr. Ari Elbaz
* Copyright (C) 2017-2019 Frédéric France
@@ -477,34 +477,43 @@ class AccountancyExport
}
/**
- * Export format : CIEL
+ * Export format : CIEL (Format XIMPORT)
+ * Format since 2003 compatible CIEL version > 2002 / Sage50
+ * Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr)
+ *
+ * Help : https://sage50c.online-help.sage.fr/aide-technique/
+ * In sage software | Use menu : "Exchange" > "Importing entries..."
+ *
+ * If you want to force filename to "XIMPORT.TXT" for automatically import file present in a directory :
+ * use constant ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME
*
* @param array $TData data
* @return void
*/
public function exportCiel(&$TData)
{
- global $conf;
-
$end_line = "\r\n";
$i = 1;
- $date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd
+
foreach ($TData as $data) {
- $code_compta = $data->numero_compte;
+ $code_compta = length_accountg($data->numero_compte);
if (!empty($data->subledger_account)) {
- $code_compta = $data->subledger_account;
+ $code_compta = length_accounta($data->subledger_account);
}
+ $date_document = dol_print_date($data->doc_date, '%Y%m%d');
+ $date_echeance = dol_print_date($data->date_lim_reglement, '%Y%m%d');
+
$Tab = array();
- $Tab['num_ecriture'] = str_pad($i, 5);
+ $Tab['num_ecriture'] = str_pad($data->piece_num, 5);
$Tab['code_journal'] = str_pad($data->code_journal, 2);
- $Tab['date_ecriture'] = $date_ecriture;
- $Tab['date_ope'] = dol_print_date($data->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
- $Tab['num_piece'] = str_pad(self::trunc($data->piece_num, 12), 12);
+ $Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT);
+ $Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT);
+ $Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12);
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 11), 11);
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25);
- $Tab['montant'] = str_pad(abs($data->debit - $data->credit), 13, ' ', STR_PAD_LEFT);
+ $Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT);
$Tab['type_montant'] = str_pad($data->sens, 1);
$Tab['vide'] = str_repeat(' ', 18);
$Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34);
diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index 6bd39f4e227..aeaa42154d8 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -1506,6 +1506,7 @@ class BookKeeping extends CommonObject
$sql = "DELETE";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql .= " WHERE piece_num = ".(int) $piecenum;
+ $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion
$sql .= " AND entity IN (".getEntity('accountancy').")";
$resql = $this->db->query($sql);
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 34e533974fc..bdda4583d54 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -177,7 +177,7 @@ $accountingjournalstatic->fetch($id_journal);
$journal = $accountingjournalstatic->code;
$journal_label = $accountingjournalstatic->label;
-
+//print $sql;
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
@@ -252,6 +252,7 @@ if ($result) {
);
// 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)
$compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : '');
$tabuser[$obj->rowid] = array(
@@ -277,7 +278,7 @@ if ($result) {
$tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60);
}
- // Load of url links to the line into llx_bank
+ // Load of url links to the line into llx_bank (so load llx_bank_url)
$links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> )
// By default
@@ -287,7 +288,7 @@ if ($result) {
// get_url may return -1 which is not traversable
if (is_array($links) && count($links) > 0) {
- // Now loop on each link of record in bank.
+ // Now loop on each link of record in bank (code similar to bankentries_list.php)
foreach ($links as $key => $val) {
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'))) {
// So we excluded 'company' and 'user' here. We want only payment lines
@@ -302,6 +303,7 @@ if ($result) {
}
}
+ // Special case to ask later to add more request to get information for old links without company link.
if ($links[$key]['type'] == 'withdraw') {
$tabmoreinfo[$obj->rowid]['withdraw'] = 1;
}
@@ -401,6 +403,44 @@ if ($result) {
$paymentsalstatic->label = $links[$key]['label'];
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentsalstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id;
+
+ // This part of code is no more required. it is here to solve case where a link were missing (ith v14.0.0) and keep writing in accountancy complete.
+ // Note: A better way to fix this is to delete payement of salary and recreate it, or to fix the bookkeeping table manually after.
+ if (!empty($conf->global->ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USEr_ON_SALARY_BANK_PAYMENT)) {
+ $tmpsalary = new Salary($db);
+ $tmpsalary->fetch($paymentsalstatic->id);
+ $tmpsalary->fetch_user($tmpsalary->fk_user);
+
+ $userstatic->id = $tmpsalary->user->id;
+ $userstatic->name = $tmpsalary->user->name;
+ $userstatic->email = $tmpsalary->user->email;
+ $userstatic->firstname = $tmpsalary->user->firstname;
+ $userstatic->lastname = $tmpsalary->user->lastname;
+ $userstatic->statut = $tmpsalary->user->statut;
+ $userstatic->accountancy_code = $tmpsalary->user->accountancy_code;
+
+ if ($userstatic->id > 0) {
+ $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0);
+ } else {
+ $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen
+ }
+
+ if (empty($obj->typeop_user)) { // Add test to avoid to add amount twice if a link already exists also on user.
+ $compta_user = $userstatic->accountancy_code;
+ if ($compta_user) {
+ $tabtp[$obj->rowid][$compta_user] += $obj->amount;
+ $tabuser[$obj->rowid] = array(
+ 'id' => $userstatic->id,
+ 'name' => dolGetFirstLastname($userstatic->firstname, $userstatic->lastname),
+ 'lastname' => $userstatic->lastname,
+ 'firstname' => $userstatic->firstname,
+ 'email' => $userstatic->email,
+ 'accountancy_code' => $compta_user,
+ 'status' => $userstatic->statut
+ );
+ }
+ }
+ }
} elseif ($links[$key]['type'] == 'payment_expensereport') {
$paymentexpensereportstatic->id = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= $paymentexpensereportstatic->getNomUrl(2);
@@ -468,7 +508,7 @@ if ($result) {
}
}
- // If no links were found to know the amount on thirdparty, we init it to account 'NotDefined'.
+ // If no links were found to know the amount on thirdparty/user, we init it to account 'NotDefined'.
if (empty($tabtp[$obj->rowid])) {
$tabtp[$obj->rowid]['NotDefined'] = $tabbq[$obj->rowid][$compta_bank];
}
@@ -1162,9 +1202,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').'';
+ print ''.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'';
} else {
- print ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will use a waiting account
+ print ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will use a waiting account
}
} else {
// We will refuse writing
@@ -1187,7 +1227,7 @@ if (empty($action) || $action == 'view') {
if ($tabtype[$key] == 'member') {
$errorstring = 'MainAccountForSubscriptionPaymentNotDefined';
}
- print ''.$langs->trans($errorstring).'';
+ print ''.$langs->trans($errorstring).'';
}
} else {
print $accounttoshow;
@@ -1196,7 +1236,7 @@ if (empty($action) || $action == 'view') {
// Subledger account
print "
";
- if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payment with subledger
+ 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) {
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') {
@@ -1205,14 +1245,14 @@ if (empty($action) || $action == 'view') {
var_dump($tabbq[$key]);*/
//print ''.$langs->trans("ThirdpartyAccountNotDefined").'';
if (!empty($tabcompany[$key]['code_compta'])) {
- if (in_array($tabtype[$key], array('payment_various'))) {
+ 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").'';
+ print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'';
} else {
- print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'';
+ print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'';
}
} else {
- print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'';
+ print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'';
}
} else {
print $accounttoshowsubledger;
@@ -1220,10 +1260,15 @@ if (empty($action) || $action == 'view') {
}
}
print "
";
+
print "
".$reflabel."
";
+
print '
'.$val["type_payment"]."
";
+
print '
'.($mt < 0 ? price(-$mt) : '')."
";
+
print '
'.($mt >= 0 ? price($mt) : '')."
";
+
print "
";
}
}
diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php
index 1700d391f54..ecb0f7a6b09 100644
--- a/htdocs/accountancy/tpl/export_journal.tpl.php
+++ b/htdocs/accountancy/tpl/export_journal.tpl.php
@@ -16,6 +16,8 @@
* along with this program. If not, see .
*/
+// $formatexportset ùust be defined
+
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) {
print "Error, template page can't be called as URL";
@@ -56,6 +58,8 @@ if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
$completefilename = $siren."FEC".$endaccountingperiod.".txt";
+} elseif ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_CIEL && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
+ $completefilename = "XIMPORT.TXT";
} else {
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;
}
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 1c93b247dfc..68430a71bab 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -176,7 +176,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
-$parameters = array('socid'=>$socid);
+$parameters = array('socid'=>isset($socid) ? $socid : null);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php
index d3d84cb3624..7146e89648e 100644
--- a/htdocs/adherents/subscription/list.php
+++ b/htdocs/adherents/subscription/list.php
@@ -115,7 +115,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
-$parameters = array('socid'=>$socid);
+$parameters = array('socid'=>isset($socid) ? $socid : null);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -496,7 +496,7 @@ while ($i < min($num, $limit)) {
$adherent->gender = $obj->gender;
$adherent->morphy = $obj->morphy;
$adherent->email = $obj->email;
- $adherent->typeid = $obj->type;
+ $adherent->typeid = $obj->fk_type;
$adherent->datefin = $db->jdate($obj->datef);
$typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index 033592a9afc..10560d38648 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -43,6 +43,8 @@ $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
+$sall = GETPOST("sall", "alpha");
+$filter = GETPOST("filter", 'alpha');
$search_lastname = GETPOST('search_lastname', 'alpha');
$search_login = GETPOST('search_login', 'alpha');
$search_email = GETPOST('search_email', 'alpha');
diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php
index 7435fc440ed..6c8f273ae77 100644
--- a/htdocs/adherents/type_translation.php
+++ b/htdocs/adherents/type_translation.php
@@ -157,7 +157,7 @@ $form = new Form($db);
$formadmin = new FormAdmin($db);
$head = member_type_prepare_head($object);
-$titre = $langs->trans("MemberType".$object->type);
+$titre = $langs->trans("MemberType".$object->id);
// Calculate $cnt_trans
$cnt_trans = 0;
diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php
index 25ada4d2d89..9fd92f45faa 100644
--- a/htdocs/admin/clicktodial.php
+++ b/htdocs/admin/clicktodial.php
@@ -134,7 +134,7 @@ if (!empty($conf->global->CLICKTODIAL_URL)) {
print '';
print $langs->trans("LinkToTestClickToDial", $user->login).' : ';
print '';
- print '';
+ print '';
print '';
$setupcomplete = 1;
@@ -149,7 +149,7 @@ if (!empty($conf->global->CLICKTODIAL_URL)) {
}
if ($setupcomplete) {
- print $langs->trans("LinkToTest", $user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL');
+ print $langs->trans("LinkToTest", $user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL', '', 'mobile');
} else {
$langs->load("errors");
print '