diff --git a/ChangeLog b/ChangeLog
index 1d6e2e39b45..2527864a862 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,7 +3,7 @@ English Dolibarr ChangeLog
--------------------------------------------------------------
-***** ChangeLog for 12.0 compared to 11.0 *****
+***** ChangeLog for 12.0.0 compared to 11.0.0 *****
For users:
NEW: Module MO (Manufacturing Order) is available as stable module.
@@ -230,6 +230,16 @@ Following changes may create regressions for some external modules, but were nec
- remove input field in form '';'
- add parameter $pagenavastextinput to value 1 when calling print_barre_liste()
+WARNING FOR DOLIWAMP USERS ONLY:
+
+Only people that installed Dolibarr using the all-in-one autoinstaller for Windows called "DoliWAMP" are concerned by the following warnings:
+
+* DoliWAMP autoinstaller for Windows is not more available on 32bits systems. Use standard package if you need to use such architecture.
+* It is not possible to migrate from an installation done with the old DoliWAMP autoinstaller for Windows by using this new one. You must make a backup
+ of your database, make a fresh installation using the new installer and reload.
+* Don't forget that DoliWAMP is a good solution to make a quick test of Dolibarr on your local computer but was never recommanded as a production
+ solution on a local desktop since a desktop computer has not a backup and security policy as good as on a server (when there is one).
+ DoliWAMP remains a solution for fast test or demo purposes.
***** ChangeLog for 11.0.4 compared to 11.0.3 *****
diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss
index 9705cc198da..1b79648279c 100644
--- a/build/exe/doliwamp/doliwamp.iss
+++ b/build/exe/doliwamp/doliwamp.iss
@@ -41,7 +41,7 @@ Compression=lzma
SolidCompression=yes
WizardImageFile=build\exe\doliwamp\doliwamp.bmp
WizardSmallImageFile=build\exe\doliwamp\doliwampsmall.bmp
-SetupIconFile=doc\images\dolibarr.ico
+SetupIconFile=doc\images\dolibarr_favicon.ico
;To say the installer must be ran as admin
PrivilegesRequired=admin
DisableProgramGroupPage=yes
@@ -104,7 +104,7 @@ Source: "build\exe\doliwamp\UsedPort.exe"; DestDir: "{app}\"; Flags: ignoreversi
; Value OK: apache 2.2.6, php 5.2.5 (5.2.11, 5.3.0 and 5.3.1 fails if php_exif, php_pgsql, php_zip is on), mysql 5.0.45
; Value OK: apache 2.2.11, php 5.3.0 (if no php_exif, php_pgsql, php_zip), mysql 5.0.45
; Value OK: apache 2.4.9, php 5.5.12, mysql 5.0.45 instead of 5.6.17 (wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe)
-; Value To test: apache 2.4.41, php 7.3.12, mysql 5.0.45 instead of 5.6.17 (wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe)
+; Value To test: apache 2.4.41, php 7.3.12, mariadb10.4.10 (wampserver3.2.0_x64.exe)
Source: "C:\Program Files\Wamp\apps\phpmyadmin4.1.14\*.*"; DestDir: "{app}\apps\phpmyadmin4.1.14"; Flags: ignoreversion recursesubdirs; Excludes: "config.inc.php,wampserver.conf,*.log,*_log,darkblue_orange"
;Source: "C:\Program Files\Wamp\bin\apache\apache2.4.9\*.*"; DestDir: "{app}\bin\apache\apache2.4.9"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log"
Source: "C:\wamp64\bin\apache\apache2.4.41\*.*"; DestDir: "{app}\bin\apache\apache2.4.41"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log"
diff --git a/build/exe/doliwamp/php.ini.install b/build/exe/doliwamp/php.ini.install
index a2576c7652d..78903a8a53a 100644
--- a/build/exe/doliwamp/php.ini.install
+++ b/build/exe/doliwamp/php.ini.install
@@ -304,7 +304,7 @@ expose_php = On
max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
;max_input_nesting_level = 64 ; Maximum input variable nesting level
-memory_limit = 64M ; Maximum amount of memory a script may consume (128MB)
+memory_limit = 256M ; Maximum amount of memory a script may consume (128MB)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec
index 110eae0a3a2..115edcef397 100755
--- a/build/rpm/dolibarr_fedora.spec
+++ b/build/rpm/dolibarr_fedora.spec
@@ -90,7 +90,7 @@ cui hai bisogno ed essere facile da usare.
%{__install} -m 644 build/rpm/install.forced.php.fedora $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/install.forced.php
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
-%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
+%{__install} -m 644 doc/images/appicon_64.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications
#desktop-file-install --delete-original --dir=$RPM_BUILD_ROOT%{_datadir}/applications build/rpm/%{name}.desktop
%{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec
index ba5c426ea3f..64293ff6580 100755
--- a/build/rpm/dolibarr_generic.spec
+++ b/build/rpm/dolibarr_generic.spec
@@ -150,7 +150,7 @@ cui hai bisogno ed essere facile da usare.
%endif
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
-%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
+%{__install} -m 644 doc/images/appicon_64.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications
%{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} || 0%{?suse_version}
diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec
index 073ef0389ce..28b58a4da96 100755
--- a/build/rpm/dolibarr_mandriva.spec
+++ b/build/rpm/dolibarr_mandriva.spec
@@ -89,7 +89,7 @@ cui hai bisogno ed essere facile da usare.
%{__install} -m 644 build/rpm/install.forced.php.mandriva $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/install.forced.php
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
-%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
+%{__install} -m 644 doc/images/appicon_64.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications
#desktop-file-install --delete-original --dir=$RPM_BUILD_ROOT%{_datadir}/applications build/rpm/%{name}.desktop
%{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec
index be61853e165..8b4ccf37808 100755
--- a/build/rpm/dolibarr_opensuse.spec
+++ b/build/rpm/dolibarr_opensuse.spec
@@ -90,7 +90,7 @@ cui hai bisogno ed essere facile da usare.
%{__install} -m 644 build/rpm/install.forced.php.opensuse $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/install.forced.php
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
-%{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
+%{__install} -m 644 doc/images/appicon_64.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications
#desktop-file-install --delete-original --dir=$RPM_BUILD_ROOT%{_datadir}/applications build/rpm/%{name}.desktop
%{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
diff --git a/dev/translation/txpull.sh b/dev/translation/txpull.sh
index 65d5af3689b..1b0ce7614c5 100755
--- a/dev/translation/txpull.sh
+++ b/dev/translation/txpull.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#------------------------------------------------------
# Script to pull language files to Transifex
#
diff --git a/dev/translation/txpush.sh b/dev/translation/txpush.sh
index 428f7b8cbc2..ef8da74dde9 100755
--- a/dev/translation/txpush.sh
+++ b/dev/translation/txpush.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#------------------------------------------------------
# Script to push language files to Transifex
#
diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index f8fa0774400..ba4c7260519 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -41,7 +41,7 @@ $action = GETPOST('action', 'aZ09');
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$id = GETPOST('id', 'int'); // id of record
-$mode = GETPOST('mode', 'aZ09'); // '' or 'tmp'
+$mode = GETPOST('mode', 'aZ09'); // '' or '_tmp'
$piece_num = GETPOST("piece_num", 'int'); // id of transaction (several lines share the same transaction id)
// Security check
diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php
index 3bf41e6326f..e52e4251ee7 100644
--- a/htdocs/accountancy/class/accountancyexport.class.php
+++ b/htdocs/accountancy/class/accountancyexport.class.php
@@ -1085,7 +1085,7 @@ class AccountancyExport
print $racine_subledger_account.$separator; // deprecated CPTG & CPTA use instead
// MONT
- print price(abs($line->montant), 0, '', 1, 2).$separator;
+ print price(abs($line->montant), 0, '', 1, 2, 2).$separator;
// CODC
print $line->sens.$separator;
// CPTG
diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index 0162a98394e..a700ebecb1b 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -1127,7 +1127,7 @@ class BookKeeping extends CommonObject
*
* @param User $user User that modifies
* @param bool $notrigger false=launch triggers after, true=disable triggers
- * @param string $mode Mode
+ * @param string $mode Mode ('' or _tmp')
* @return int <0 if KO, >0 if OK
*/
public function update(User $user, $notrigger = false, $mode = '')
@@ -1254,12 +1254,12 @@ class BookKeeping extends CommonObject
}
/**
- * Update movement
+ * Update accounting movement
*
* @param string $piece_num Piece num
* @param string $field Field
* @param string $value Value
- * @param string $mode Mode
+ * @param string $mode Mode ('' or _tmp')
* @return number <0 if KO, >0 if OK
*/
public function updateByMvt($piece_num = '', $field = '', $value = '', $mode = '')
@@ -1268,9 +1268,9 @@ class BookKeeping extends CommonObject
$this->db->begin();
- $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element.$mode." as ab";
- $sql .= ' SET ab.'.$field.'='.(is_numeric($value) ? $value : "'".$this->db->escape($value)."'");
- $sql .= ' WHERE ab.piece_num='.$piece_num;
+ $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element.$mode;
+ $sql .= ' SET '.$field.'='.(is_numeric($value) ? $value : "'".$this->db->escape($value)."'");
+ $sql .= " WHERE piece_num = '".$this->db->escape($piece_num)."'";
$resql = $this->db->query($sql);
if (!$resql) {
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index e52243a65be..15472558125 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -996,7 +996,8 @@ else
print '';
// EMail
- print '
';
-
- dol_fiche_end();
}
// End of page
diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php
index a6f48df1026..ce734aadeb5 100644
--- a/htdocs/api/class/api_documents.class.php
+++ b/htdocs/api/class/api_documents.class.php
@@ -608,6 +608,12 @@ class Documents extends DolibarrApi
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$object = new ExpenseReport($this->db);
}
+ elseif ($modulepart == 'adherent' || $modulepart == 'member')
+ {
+ $modulepart = 'adherent';
+ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
+ $object = new Adherent($this->db);
+ }
// TODO Implement additional moduleparts
else
{
@@ -652,6 +658,7 @@ class Documents extends DolibarrApi
else
{
if ($modulepart == 'invoice') $modulepart = 'facture';
+ if ($modulepart == 'member') $modulepart = 'adherent';
$relativefile = $subdir;
diff --git a/htdocs/api/index.php b/htdocs/api/index.php
index c5edbc74d66..112eb58059f 100644
--- a/htdocs/api/index.php
+++ b/htdocs/api/index.php
@@ -32,6 +32,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
+if (!defined("NOSESSION")) define("NOSESSION", '1');
// Force entity if a value is provided into HTTP header. Otherwise, will use the entity of user of token used.
@@ -72,7 +73,8 @@ if (empty($conf->global->MAIN_MODULE_API))
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
print $langs->trans("WarningModuleNotActive", 'Api').'.
';
print $langs->trans("ToActivateModule");
- exit;
+ //session_destroy();
+ exit(0);
}
// Test if explorer is not disabled
@@ -81,7 +83,8 @@ if (preg_match('/api\/index\.php\/explorer/', $url) && !empty($conf->global->API
$langs->load("admin");
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
print $langs->trans("WarningAPIExplorerDisabled").'.
';
- exit;
+ //session_destroy();
+ exit(0);
}
@@ -138,7 +141,7 @@ if (!empty($conf->global->API_RESTRICT_ON_IP))
dol_syslog('Remote ip is '.$ipremote.', not into list '.$conf->global->API_RESTRICT_ON_IP);
print 'APIs are not allowed from the IP '.$ipremote;
header('HTTP/1.1 503 API not allowed from your IP '.$ipremote);
- //print $conf->global->API_RESTRICT_ON_IP;
+ //session_destroy();
exit(0);
}
}
@@ -235,19 +238,19 @@ if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $
$regbis = array();
if (!empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' && $reg[2] != '/resources.json' && preg_match('/^\/(swagger|resources)\.json\/(.+)$/', $reg[2], $regbis) && $regbis[2] != 'root')))
{
- $module = $reg[1];
- if ($module == 'explorer') // If we call page to explore details of a service
+ $moduleobject = $reg[1];
+ if ($moduleobject == 'explorer') // If we call page to explore details of a service
{
- $module = $regbis[2];
+ $moduleobject = $regbis[2];
}
- $module = strtolower($module);
- $moduledirforclass = getModuleDirForApiClass($module);
+ $moduleobject = strtolower($moduleobject);
+ $moduledirforclass = getModuleDirForApiClass($moduleobject);
// Load a dedicated API file
- dol_syslog("Load a dedicated API file module=".$module." moduledirforclass=".$moduledirforclass);
+ dol_syslog("Load a dedicated API file moduleobject=".$moduleobject." moduledirforclass=".$moduledirforclass);
- $tmpmodule = $module;
+ $tmpmodule = $moduleobject;
if ($tmpmodule != 'api')
$tmpmodule = preg_replace('/api$/i', '', $tmpmodule);
$classfile = str_replace('_', '', $tmpmodule);
@@ -264,7 +267,7 @@ if (!empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' &&
$dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php', 0, 2);
- $classname = ucwords($module);
+ $classname = ucwords($moduleobject);
dol_syslog('Search api file /'.$moduledirforclass.'/class/api_'.$classfile.'.class.php => dir_part_file='.$dir_part_file.' classname='.$classname);
@@ -275,6 +278,7 @@ if (!empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' &&
dol_syslog('Failed to make include_once '.$dir_part_file, LOG_WARNING);
print 'API not found (failed to include API file)';
header('HTTP/1.1 501 API not found (failed to include API file)');
+ //session_destroy();
exit(0);
}
@@ -282,9 +286,16 @@ if (!empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' &&
$api->r->addAPIClass($classname);
}
+
//var_dump($api->r->apiVersionMap);
//exit;
// Call API (we suppose we found it).
// The handle will use the file api/temp/routes.php to get data to run the API. If the file exists and the entry for API is not found, it will return 404.
+
+//Luracast\Restler\Defaults::$returnResponse = true;
+//print $api->r->handle();
+
$api->r->handle();
+
+//session_destroy();
diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php
index 1bfb1836a39..a75aaa5543d 100644
--- a/htdocs/barcode/codeinit.php
+++ b/htdocs/barcode/codeinit.php
@@ -193,7 +193,7 @@ llxHeader('', $langs->trans("MassBarcodeInit"));
print load_fiche_titre($langs->trans("MassBarcodeInit"), '', 'title_setup.png');
print ' ';
-print $langs->trans("MassBarcodeInitDesc").' ';
+print ''.$langs->trans("MassBarcodeInitDesc").' ';
print ' ';
//print img_picto('','puce').' '.$langs->trans("PrintsheetForOneBarCode").' ';
@@ -317,6 +317,12 @@ if ($conf->product->enabled || $conf->product->service)
}
+print load_fiche_titre($langs->trans("BarCodePrintsheet"), '', 'generic');
+print ' '."\n";
+print $langs->trans("ClickHereToGoTo").' : '.$langs->trans("BarCodePrintsheet").'';
+
+
+
print '';
print ' ';
diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php
index 5cd988a5bed..cf74a46bb2a 100644
--- a/htdocs/barcode/printsheet.php
+++ b/htdocs/barcode/printsheet.php
@@ -267,7 +267,7 @@ llxHeader('', $langs->trans("BarCodePrintsheet"));
print load_fiche_titre($langs->trans("BarCodePrintsheet"), '', 'barcode');
print ' ';
-print $langs->trans("PageToGenerateBarCodeSheets", $langs->transnoentitiesnoconv("BuildPageToPrint")).' ';
+print ''.$langs->trans("PageToGenerateBarCodeSheets", $langs->transnoentitiesnoconv("BuildPageToPrint")).' ';
print ' ';
dol_htmloutput_errors($mesg);
diff --git a/htdocs/bom/class/api_boms.class.php b/htdocs/bom/class/api_boms.class.php
index d21d82b5ca9..806b75cb9eb 100644
--- a/htdocs/bom/class/api_boms.class.php
+++ b/htdocs/bom/class/api_boms.class.php
@@ -24,11 +24,11 @@ require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
/**
* \file bom/class/api_boms.class.php
* \ingroup bom
- * \brief File for API management of bom.
+ * \brief File for API management of BOM.
*/
/**
- * API class for bom
+ * API class for BOM
*
* @access protected
* @class DolibarrApiAccess {@requires user,external}
@@ -120,7 +120,7 @@ class Boms extends DolibarrApi
//if ($mode == 1) $sql.= " AND s.client IN (1, 3)";
//if ($mode == 2) $sql.= " AND s.client IN (2, 3)";
- if ($tmpobject->ismultientitymanaged) $sql .= ' AND t.entity IN ('.getEntity('bom').')';
+ if ($tmpobject->ismultientitymanaged) $sql .= ' AND t.entity IN ('.getEntity($tmpobject->element).')';
if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= " AND t.fk_soc = sc.fk_soc";
if ($restrictonsocid && $socid) $sql .= " AND t.fk_soc = ".$socid;
if ($restrictonsocid && $search_sale > 0) $sql .= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php
index a8cb6b5de8f..e09bc905b96 100644
--- a/htdocs/comm/action/class/api_agendaevents.class.php
+++ b/htdocs/comm/action/class/api_agendaevents.class.php
@@ -248,7 +248,7 @@ class AgendaEvents extends DolibarrApi
throw new RestException(404, 'actioncomm not found');
}
- if (!DolibarrApi::_checkAccessToResource('actioncomm', $this->actioncomm->id)) {
+ if (!DolibarrApi::_checkAccessToResource('actioncomm', $this->actioncomm->id, 'actioncomm', '', 'fk_soc', 'id')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
foreach ($request_data as $field => $value) {
@@ -290,7 +290,7 @@ class AgendaEvents extends DolibarrApi
throw new RestException(404, 'Agenda Event not found');
}
- if (!DolibarrApi::_checkAccessToResource('actioncomm', $this->actioncomm->id)) {
+ if (!DolibarrApi::_checkAccessToResource('actioncomm', $this->actioncomm->id, 'actioncomm', '', 'fk_soc', 'id')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
index b9782515735..06962600edf 100644
--- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
+++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
@@ -341,74 +341,6 @@ class FormAdvTargetEmailing extends Form
return $return;
}
- /**
- * Return combo list with customer categories
- *
- * @param string $htmlname Name of categorie
- * @param array $selected_array value selected
- * @return string HTML combo
- */
- public function multiselectCustomerCategories($htmlname = 'cust_cat', $selected_array = array())
- {
- return $this->multiselectCategories($htmlname, $selected_array, 2);
- }
-
- /**
- * Return combo list with customer contact
- *
- * @param string $htmlname Name of categorie
- * @param array $selected_array value selected
- * @return string HTML combo
- */
- public function multiselectContactCategories($htmlname = 'contact_cat', $selected_array = array())
- {
- return $this->multiselectCategories($htmlname, $selected_array, 4);
- }
-
- /**
- * Return combo list of categories
- *
- * @param string $htmlname Name of categorie
- * @param array $selected_array Value selected
- * @param int $type Type
- * @return string HTML combo
- */
- public function multiselectCategories($htmlname = '', $selected_array = array(), $type = 0)
- {
- global $conf, $langs, $user;
- $langs->load("dict");
-
- $options_array = array();
-
- $sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."categorie";
- $sql .= " WHERE type=".$type;
-
- dol_syslog(__METHOD__, LOG_DEBUG);
- $resql = $this->db->query($sql);
- if ($resql)
- {
- $num = $this->db->num_rows($resql);
- $i = 0;
- if ($num)
- {
- while ($i < $num)
- {
- $obj = $this->db->fetch_object($resql);
-
- $options_array[$obj->rowid] = $obj->label;
-
- $i++;
- }
- }
- }
- else
- {
- dol_print_error($this->db);
- }
-
- return $this->advMultiselectarray($htmlname, $options_array, $selected_array);
- }
-
/**
* Return a combo list to select emailing target selector
*
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 67d9f523f05..3270c3a9663 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -323,15 +323,23 @@ if (empty($reshook))
if (($tmp_total_ht < 0 || $tmp_total_ht_devise < 0) && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
{
- $langs->load("errors");
if ($object->type == $object::TYPE_DEPOSIT) {
+ $langs->load("errors");
// Using negative lines on deposit lead to headach and blocking problems when you want to consume them.
setEventMessages($langs->trans("ErrorLinesCantBeNegativeOnDeposits"), null, 'errors');
+ $error++;
+ $action = '';
} else {
- setEventMessages($langs->trans("ErrorLinesCantBeNegativeForOneVATRate"), null, 'errors');
+ $tmpvatratetoshow = explode('_', $vatrate);
+ $tmpvatratetoshow[0] = round($tmpvatratetoshow[0], 2);
+
+ if ($tmpvatratetoshow[0] != 0) {
+ $langs->load("errors");
+ setEventMessages($langs->trans("ErrorLinesCantBeNegativeForOneVATRate", $tmpvatratetoshow[0]), null, 'errors');
+ $error++;
+ $action = '';
+ }
}
- $error++;
- $action = '';
}
}
}
@@ -3536,10 +3544,19 @@ if ($action == 'create')
}
// Other attributes
- $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="2"', 'cols' => '2');
+ $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="2"', 'cols' => '2', 'socid'=>$socid);
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook)) {
+ if (!empty($conf->global->THIRDPARTY_PROPAGATE_EXTRAFIELDS_TO_INVOICE)) {
+ // copy from thirdparty
+ $tpExtrafields = new Extrafields($db);
+ $tpExtrafieldLabels = $tpExtrafields->fetch_name_optionals_label($soc->table_element);
+ if ($soc->fetch_optionals() > 0) {
+ $object->array_options = array_merge($object->array_options, $soc->array_options);
+ }
+ };
+
print $object->showOptionals($extrafields, 'edit', $parameters);
}
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index b09f7f00ffe..6bb3e0cc5ca 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -455,6 +455,7 @@ if (!$sall) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.f
if ($sall || $search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as pd ON f.rowid=pd.fk_facture';
if ($search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet";
+$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid';
// We'll need this table joined to the select in order to filter by sale
if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if ($search_user > 0)
@@ -462,7 +463,7 @@ if ($search_user > 0)
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
}
-$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid';
+
$sql .= ' WHERE f.fk_soc = s.rowid';
$sql .= ' AND f.entity IN ('.getEntity('invoice').')';
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 9b0ee645fc7..7a759dde543 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -68,9 +68,11 @@ class Paiement extends CommonObject
*/
public $montant;
- public $amount; // Total amount of payment
- public $amounts = array(); // Array of amounts
- public $multicurrency_amounts = array(); // Array of amounts
+ public $amount; // Total amount of payment (in the main currency)
+ public $multicurrency_amount; // Total amount of payment (in the currency of the bank account)
+ public $amounts = array(); // array: invoice ID => amount for that invoice (in the main currency)>
+ public $multicurrency_amounts = array(); // array: invoice ID => amount for that invoice (in the invoice's currency)>
+
public $author;
public $paiementid; // Type of payment. Id saved into fields fk_paiement on llx_paiement
public $paiementcode; // Code of payment.
@@ -159,7 +161,7 @@ class Paiement extends CommonObject
*/
public function fetch($id, $ref = '', $fk_bank = '')
{
- $sql = 'SELECT p.rowid, p.ref, p.datep as dp, p.amount, p.statut, p.ext_payment_id, p.ext_payment_site, p.fk_bank,';
+ $sql = 'SELECT p.rowid, p.ref, p.datep as dp, p.amount, p.statut, p.ext_payment_id, p.ext_payment_site, p.fk_bank, p.multicurrency_amount,';
$sql .= ' c.code as type_code, c.libelle as type_label,';
$sql .= ' p.num_paiement as num_payment, p.note,';
$sql .= ' b.fk_account';
@@ -179,6 +181,7 @@ class Paiement extends CommonObject
if ($this->db->num_rows($resql))
{
$obj = $this->db->fetch_object($resql);
+
$this->id = $obj->rowid;
$this->ref = $obj->ref ? $obj->ref : $obj->rowid;
$this->date = $this->db->jdate($obj->dp);
@@ -187,6 +190,7 @@ class Paiement extends CommonObject
$this->num_payment = $obj->num_payment;
$this->montant = $obj->amount; // deprecated
$this->amount = $obj->amount;
+ $this->multicurrency_amount = $obj->multicurrency_amount;
$this->note = $obj->note;
$this->type_label = $obj->type_label;
$this->type_code = $obj->type_code;
@@ -513,8 +517,10 @@ class Paiement extends CommonObject
{
$accline = new AccountLine($this->db);
- $result = $accline->fetch($bank_line_id);
- if ($result == 0) $accline->rowid = $bank_line_id; // If not found, we set artificially rowid to allow delete of llx_bank_url
+ $result=$accline->fetch($bank_line_id);
+ if ($result == 0) {
+ $accline->id = $accline->rowid = $bank_line_id; // If not found, we set artificially rowid to allow delete of llx_bank_url
+ }
// Delete bank account url lines linked to payment
$result = $accline->delete_urls($user);
diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php
index cefb55f2f42..6172b3f1284 100644
--- a/htdocs/compta/paymentbybanktransfer/index.php
+++ b/htdocs/compta/paymentbybanktransfer/index.php
@@ -78,13 +78,13 @@ print '
';
if ($objp->fk_soc > 0)
{
@@ -2242,7 +2243,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
{
if (!in_array('prospectionstatus', $hiddenfields)) {
- print '
';
+ print '
';
// Because color of prospection status has no meaning yet, it is used if hidden constant is set
if (empty($conf->global->USE_COLOR_FOR_PROSPECTION_STATUS)) {
$oppStatusCode = dol_getIdFromCode($db, $objp->opp_status, 'c_lead_status', 'rowid', 'code');
@@ -2269,14 +2270,12 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
}
print '