diff --git a/ChangeLog b/ChangeLog
index ecf20be261f..8b9edc38f2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,7 +16,7 @@ NEW: Accountancy - add options to disable binding on sales, purchases & expense
NEW: Accountancy balance - add a menu entry to show subtotal by group
NEW: Accountancy - change menu disposition
NEW: Accountancy - on transfers, select the periodicity by default
-NEW: Accountancy - Add export for Gestinum (v3 & v5)
+NEW: Accountancy - Add export for Gestinum (v3 & v5) #15180
NEW: new currency rate editor
NEW: Solve blocking feature. Can increase stock of a Kit without changing subproduct stock.
NEW: add a widget to show the customers with outstanding limits reached
@@ -162,7 +162,7 @@ NEW: Support for Samba4 AD
NEW: TakePOS connector compatibility with RECEIPT PRINTERS module
NEW: TakePOS Gift Receipt
NEW: TakePOS Multicurrency compatibility
-NEW: the global header of a website can also have dynamic content
+NEW: TakePOS Weighing Scale compatibility with TakePOS connector #14725
NEW: Third-Party Import new fields: mother company,outstanding debt limit,bank account,incoterms
NEW: Thirdparty module : box on customer/supplier tab for invoice outsantding amount late
NEW: ticket classification on create from email collector
@@ -172,11 +172,11 @@ NEW: VAT rate for Angola #15606
NEW: VAT and juridical status for Algeria
NEW: VAT report - Invert constant to show by default zero VAT in reports
NEW: website page fields selection
-NEW: Weighing Scale compatibility with TakePOS connector
+NEW: website - global header of a website can also have dynamic content
NEW: when creating a user from a member linked to a thirdparty, you can choose to create it as external or internal user
-NEW: add clone button on miscellaneous payment
-NEW: #15065 Add option to put the product label in bold in the PDF templates if configured
-NEW: Add option "If the feature to manage kits of module Stock is used, show details of subproducts of a kit on PDF."
+NEW: add clone button on miscellaneous payment
+NEW: add option to put the product label in bold in the PDF templates if configured #15065
+NEW: add option "If the feature to manage kits of module Stock is used, show details of subproducts of a kit on PDF."
For developers:
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 6d9cabc6789..0d812d70009 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -692,7 +692,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position'
if ((!GETPOSTISSET($value) || GETPOST($value) == '')
&& (!in_array($listfield[$f], array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking', 'picto')) // Fields that are not mandatory
- && (!($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
+ && ($id != 10 || ($listfield[$f] != 'code' && $listfield[$f] != 'note')) // Field code and note is not mandatory for dictionary table 10
)
) {
$ok = 0;
@@ -757,9 +757,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"] = ''; // If empty, we force to null
if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"] = ''; // If empty, we force to null
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"] = ''; // If empty, we force to null
- if ($id == 10 && GETPOSTISSET("code")) // Spaces are not allowed into code
+ if ($id == 10 && GETPOSTISSET("code")) // Spaces are not allowed into code for tax dictionary
{
- $_POST["code"] = preg_replace('/\s/', '', $_POST["code"]);
+ $_POST["code"] = preg_replace('/[^a-zA-Z0-9\-\+]/', '', $_POST["code"]);
}
// If check ok and action add, add the line
@@ -826,8 +826,13 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$result = $db->query($sql);
if ($result) // Add is ok
{
- setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
- $_POST = array('id'=>$id); // Clean $_POST array, we keep only
+ setEventMessages($langs->transnoentities("RecordCreatedSuccessfully"), null, 'mesgs');
+
+ // Clean $_POST array, we keep only id of dictionary
+ if ($id == 10 && GETPOST('country', 'int') > 0) {
+ $search_country_id = GETPOST('country', 'int');
+ }
+ $_POST = array('id'=>$id);
} else {
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index b37762a644a..dc0ada64eb3 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -214,6 +214,7 @@ llxHeader('', $langs->trans("Agenda"), $help_url);
$form = new Form($db);
$companystatic = new Societe($db);
$contactstatic = new Contact($db);
+$userstatic = new User($db);
$now = dol_now();
$nowarray = dol_getdate($now);
@@ -1071,7 +1072,6 @@ if (count($listofextcals))
{
$event->id = $icalevent['UID'];
$event->ref = $event->id;
-
$userId = $userstatic->findUserIdByEmail($namecal);
if (!empty($userId) && $userId > 0)
{
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 5fa4a3adfaa..885081e84a1 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
// Load translation files required by the page
-$langs->loadLangs(array("orders", 'sendings', 'deliveries', 'companies', 'compta', 'bills', 'stocks'));
+$langs->loadLangs(array("orders", 'sendings', 'deliveries', 'companies', 'compta', 'bills', 'stocks', 'products'));
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php
index 734d21b1c87..02098e986ba 100644
--- a/htdocs/compta/accounting-files.php
+++ b/htdocs/compta/accounting-files.php
@@ -549,16 +549,17 @@ if (!empty($conf->multicompany->enabled) && is_object($mc))
print ' ';
$listofchoices = array(
- 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills'),
- 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills'),
- 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips'),
- 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation'),
- 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries'),
- 'selectsocialcontributions'=>array('label'=>'SocialContributions'),
- 'selectvariouspayment'=>array('label'=>'VariousPayment'),
- 'selectloanspayment'=>array('label'=>'PaymentLoan'),
+ 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => !empty($conf->facture->enabled)),
+ 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => !empty($conf->supplier_invoice->enabled)),
+ 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled)),
+ 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled)),
+ 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => !empty($conf->tax->enabled)),
+ 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => !empty($conf->salaries->enabled)),
+ 'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => !empty($conf->banque->enabled)),
+ 'selectloanspayment'=>array('label'=>'PaymentLoan', 'enabled' => !empty($conf->loan->enabled)),
);
foreach ($listofchoices as $choice => $val) {
+ if (empty($val['enabled'])) continue; // list not qualified
$checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : '');
print '
';
}
diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php
index 9ab02d8b18a..be37ec23403 100644
--- a/htdocs/compta/bank/class/api_bankaccounts.class.php
+++ b/htdocs/compta/bank/class/api_bankaccounts.class.php
@@ -81,10 +81,8 @@ class BankAccounts extends DolibarrApi
$sql .= " AND c.fk_categorie = ".$this->db->escape($category)." AND c.fk_account = t.rowid ";
}
// Add sql filters
- if ($sqlfilters)
- {
- if (!DolibarrApi::_checkFilters($sqlfilters))
- {
+ if ($sqlfilters) {
+ if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@@ -93,8 +91,7 @@ class BankAccounts extends DolibarrApi
$sql .= $this->db->order($sortfield, $sortorder);
if ($limit) {
- if ($page < 0)
- {
+ if ($page < 0) {
$page = 0;
}
$offset = $limit * $page;
@@ -222,12 +219,10 @@ class BankAccounts extends DolibarrApi
throw new RestException(404, 'The BankAccount for bankaccount_to_id provided does not exist.');
}
- if ($accountto->currency_code == $accountfrom->currency_code)
- {
+ if ($accountto->currency_code == $accountfrom->currency_code) {
$amount_to = $amount;
} else {
- if (!$amount_to || empty($amount_to))
- {
+ if (!$amount_to || empty($amount_to)) {
throw new RestException(422, 'You must provide amount_to value since bankaccount_from and bankaccount_to does not share the same currency.');
}
}
@@ -244,8 +239,7 @@ class BankAccounts extends DolibarrApi
$typefrom = 'PRE';
$typeto = 'VIR';
- if ($accountto->courant == Account::TYPE_CASH || $accountfrom->courant == Account::TYPE_CASH)
- {
+ if ($accountto->courant == Account::TYPE_CASH || $accountfrom->courant == Account::TYPE_CASH) {
// This is transfer of change
$typefrom = 'LIQ';
$typeto = 'LIQ';
@@ -291,8 +285,7 @@ class BankAccounts extends DolibarrApi
$error++;
}
- if (!$error)
- {
+ if (!$error) {
$this->db->commit();
return array(
@@ -327,12 +320,13 @@ class BankAccounts extends DolibarrApi
}
foreach ($request_data as $field => $value) {
- if ($field == 'id') continue;
+ if ($field == 'id') {
+ continue;
+ }
$account->$field = $value;
}
- if ($account->update(DolibarrApiAccess::$user) > 0)
- {
+ if ($account->update(DolibarrApiAccess::$user) > 0) {
return $this->get($id);
} else {
throw new RestException(500, $account->error);
@@ -380,8 +374,9 @@ class BankAccounts extends DolibarrApi
{
$account = array();
foreach (BankAccounts::$FIELDS as $field) {
- if (!isset($data[$field]))
+ if (!isset($data[$field])) {
throw new RestException(400, "$field field missing");
+ }
$account[$field] = $data[$field];
}
return $account;
@@ -433,10 +428,8 @@ class BankAccounts extends DolibarrApi
$sql .= " WHERE fk_account = ".$id;
// Add sql filters
- if ($sqlfilters)
- {
- if (!DolibarrApi::_checkFilters($sqlfilters))
- {
+ if ($sqlfilters) {
+ if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@@ -457,7 +450,7 @@ class BankAccounts extends DolibarrApi
}
}
} else {
- throw new RestException(503, 'Error when retrieving list of account lines: '.$accountLine->error);
+ throw new RestException(503, 'Error when retrieving list of account lines: '.$this->db->lasterror());
}
return $list;
@@ -476,8 +469,8 @@ class BankAccounts extends DolibarrApi
* @param string $cheque_writer Name of cheque writer {@from body}
* @param string $cheque_bank Bank of cheque writer {@from body}
* @param string $accountancycode Accountancy code {@from body}
- * @param int $datev Payment date value (timestamp) {@from body} {@type timestamp}
- * @param string $num_releve Bank statement numero {@from body}
+ * @param int $datev Payment date value (timestamp) {@from body} {@type timestamp}
+ * @param string $num_releve Bank statement numero {@from body}
* @return int ID of line
*
* @url POST {id}/lines
@@ -502,8 +495,11 @@ class BankAccounts extends DolibarrApi
$cheque_number,
$category,
DolibarrApiAccess::$user,
- $cheque_writer, $cheque_bank, $accountancycode,
- $datev, $num_releve
+ $cheque_writer,
+ $cheque_bank,
+ $accountancycode,
+ $datev,
+ $num_releve
);
if ($result < 0) {
throw new RestException(503, 'Error when adding line to account: '.$account->error);
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index a03fd03ffef..83393a52cb6 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -710,10 +710,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Price
print '
'.price($sign * $objp->total_ttc).'
';
- // Received or paid back
+ // Received + already paid
print '
'.price($sign * $paiement);
- if ($creditnotes) print '+'.price($creditnotes);
- if ($deposits) print '+'.price($deposits);
+ if ($creditnotes) print '+'.price($creditnotes).'';
+ if ($deposits) print '+'.price($deposits).'';
print '
';
// Remain to take or to pay back
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 3906d376243..678ed9bbbd6 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -374,8 +374,7 @@ if (empty($reshook))
$action = 'create';
}
}
- } elseif ($action == 'classin' && $user->rights->contrat->creer)
- {
+ } elseif ($action == 'classin' && $user->rights->contrat->creer) {
$object->setProject(GETPOST('projectid'));
}
diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php
index 44e2682585e..7d1c72b3036 100644
--- a/htdocs/core/boxes/box_fournisseurs.php
+++ b/htdocs/core/boxes/box_fournisseurs.php
@@ -137,10 +137,13 @@ class box_fournisseurs extends ModeleBoxes
$line++;
}
- if ($num == 0) $this->info_box_contents[$line][0] = array(
- 'td' => 'class="center opacitymedium"',
- 'text'=>$langs->trans("NoRecordedSuppliers"),
- );
+ if ($num == 0) {
+ $langs->load("suppliers");
+ $this->info_box_contents[$line][0] = array(
+ 'td' => 'class="center opacitymedium"',
+ 'text'=>$langs->trans("NoRecordedSuppliers"),
+ );
+ }
$this->db->free($result);
} else {
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index aa55ec15010..1702019b092 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -6852,6 +6852,7 @@ abstract class CommonObject
break;
}
+ // Output value of the current field
if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate')
{
$extrafields_collapse_num = '';
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index e1d64da77f1..3bf47b7da7a 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4615,7 +4615,7 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be
}
if ((int) $limit > 0 && empty($hideselectlimit))
{
- $pagesizechoices = '10:10,15:15,20:20,30:30,40:40,50:50,100:100,250:250,500:500,1000:1000,5000:5000';
+ $pagesizechoices = '10:10,15:15,20:20,30:30,40:40,50:50,100:100,250:250,500:500,1000:1000,5000:5000,25000:25000';
//$pagesizechoices.=',0:'.$langs->trans("All"); // Not yet supported
//$pagesizechoices.=',2:2';
if (!empty($conf->global->MAIN_PAGESIZE_CHOICES)) $pagesizechoices = $conf->global->MAIN_PAGESIZE_CHOICES;
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 74e624ca7cb..3c8a79a9249 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -2526,13 +2526,15 @@ function getTaskProgressBadge($task, $label = '', $tooltip = '')
if (doubleval($progressCalculated) > doubleval($task->progress * $warningRatio)) {
$badgeClass .= 'badge-danger';
- if (empty($tooltip)) $tooltip = $task->progress.'% < '.$langs->trans("Expected").' '.$progressCalculated.'%';
+ if (empty($tooltip)) {
+ $tooltip = $task->progress.'% < '.$langs->trans("TimeConsumed").' '.$progressCalculated.'%';
+ }
} elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10%
$badgeClass .= 'badge-warning';
- if (empty($tooltip)) $tooltip = $task->progress.'% < '.$langs->trans("Expected").' '.$progressCalculated.'%';
+ if (empty($tooltip)) $tooltip = $task->progress.'% < '.$langs->trans("TimeConsumed").' '.$progressCalculated.'%';
} else {
$badgeClass .= 'badge-success';
- if (empty($tooltip)) $tooltip = $task->progress.'% >= '.$langs->trans("Expected").' '.$progressCalculated.'%';
+ if (empty($tooltip)) $tooltip = $task->progress.'% >= '.$langs->trans("TimeConsumed").' '.$progressCalculated.'%';
}
}
}
diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php
index cf1d1793a88..0bb0db6afd1 100644
--- a/htdocs/core/lib/sendings.lib.php
+++ b/htdocs/core/lib/sendings.lib.php
@@ -81,7 +81,7 @@ function shipping_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
- $upload_dir = $conf->commande->dir_output."/".dol_sanitizeFileName($object->ref);
+ $upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
$nbLinks = Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/expedition/document.php?id='.$object->id;
diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php
index 7bc98d12278..293ea333682 100644
--- a/htdocs/core/tpl/object_discounts.tpl.php
+++ b/htdocs/core/tpl/object_discounts.tpl.php
@@ -62,7 +62,11 @@ if ($absolute_discount > 0) {
$text .= ' ('.$addabsolutediscount.')';
}
- print '