diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index 5f027960ee8..948bb42337a 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -693,6 +693,16 @@ if ($object->id > 0) {
$resteapayer = price2num($object->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT');
+ // Hook to change amount for other reasons, e.g. apply cash discount for payment before agreed date
+ $parameters = array('remaintopay' => $resteapayer);
+ $reshook = $hookmanager->executeHooks('finalizeAmountOfSupplierInvoice', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
+ if ($reshook > 0) {
+ print $hookmanager->resPrint;
+ if (!empty($remaintopay = $hookmanager->resArray['remaintopay'])) {
+ $resteapayer = $remaintopay;
+ }
+ }
+
// TODO Replace this by an include with same code to show already done payment visible in invoice card
print '
'.$langs->trans('RemainderToPay').' '.price($resteapayer, 1, '', 1, - 1, - 1, $conf->currency).' ';
diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php
index c1b6ba6c86e..d62dbd94ab2 100644
--- a/htdocs/core/modules/printing/printgcp.modules.php
+++ b/htdocs/core/modules/printing/printgcp.modules.php
@@ -121,7 +121,7 @@ class printing_printgcp extends PrintingDriver
$this->google_id = getDolGlobalString('OAUTH_GOOGLE_ID');
$this->google_secret = getDolGlobalString('OAUTH_GOOGLE_SECRET');
// Token storage
- $storage = new DoliStorage($this->db, $this->conf, $keyforprovider);
+ $storage = new DoliStorage($this->db, $conf, $keyforprovider);
//$storage->clearToken($this->OAUTH_SERVICENAME_GOOGLE);
// Setup the credentials for the requests
$credentials = new Credentials(
@@ -255,12 +255,13 @@ class printing_printgcp extends PrintingDriver
*/
public function getlistAvailablePrinters()
{
+ global $conf;
$ret = array();
$keyforprovider = ''; // @FIXME
// Token storage
- $storage = new DoliStorage($this->db, $this->conf, $keyforprovider);
+ $storage = new DoliStorage($this->db, $conf, $keyforprovider);
// Setup the credentials for the requests
$credentials = new Credentials(
$this->google_id,
@@ -377,6 +378,7 @@ class printing_printgcp extends PrintingDriver
*/
public function sendPrintToPrinter($printerid, $printjobtitle, $filepath, $contenttype)
{
+ global $conf;
// Check if printer id
if (empty($printerid)) {
return array('status' =>0, 'errorcode' =>'', 'errormessage'=>'No provided printer ID');
@@ -401,7 +403,7 @@ class printing_printgcp extends PrintingDriver
$keyforprovider = ''; // @FIXME
// Dolibarr Token storage
- $storage = new DoliStorage($this->db, $this->conf, $keyforprovider);
+ $storage = new DoliStorage($this->db, $conf, $keyforprovider);
// Setup the credentials for the requests
$credentials = new Credentials(
$this->google_id,
@@ -453,7 +455,7 @@ class printing_printgcp extends PrintingDriver
$keyforprovider = ''; // @FIXME
// Token storage
- $storage = new DoliStorage($this->db, $this->conf, $keyforprovider);
+ $storage = new DoliStorage($this->db, $conf, $keyforprovider);
// Setup the credentials for the requests
$credentials = new Credentials(
$this->google_id,
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index dfd90b4dc0f..124c61dc737 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -893,7 +893,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print ' ';
print $ldap_lastname;
} else {
- print ' ';
+ print ' ';
}
print '';
@@ -904,7 +904,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print ' ';
print $ldap_firstname;
} else {
- print ' ';
+ print ' ';
}
print '';
@@ -918,10 +918,28 @@ if ($action == 'create' || $action == 'adduserldap') {
print ' ';
print $ldap_loginsmb;
} else {
- print ' ';
+ print ' ';
}
print '';
+ if (!empty($conf->use_javascript_ajax)) {
+ print '';
+ }
+
$generated_password = '';
if (empty($ldap_sid)) { // ldap_sid is for activedirectory
$generated_password = getRandomPassword(false);