Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
be42c745a5
5 changed files with 65 additions and 13 deletions
|
|
@ -676,7 +676,6 @@ RECUR
|
|||
RSS
|
||||
RateIndirect
|
||||
Re-Open
|
||||
Rechercher
|
||||
ReconciledBy
|
||||
RecordNotFound
|
||||
RecruitmentJobPosition
|
||||
|
|
@ -808,8 +807,6 @@ SupplierMissingRef
|
|||
Synchronize
|
||||
Syslog
|
||||
TLS/STARTTLS
|
||||
TLSv1
|
||||
TLSv1.2
|
||||
TYPE_
|
||||
Tabs
|
||||
Tag
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2021-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1347,7 +1347,7 @@ if ($mode == 'marketplace') {
|
|||
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo dol_escape_htmltag($options['search']) ?>">
|
||||
</div>
|
||||
<div class="divsearchfield">
|
||||
<input class="button buttongen reposition" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
|
||||
<input class="button buttongen reposition" value="<?php echo $langs->trans('Search') ?>" type="submit">
|
||||
<a class="buttonreset reposition" href="<?php echo $_SERVER["PHP_SELF"].'?mode=marketplace'; ?>"><?php echo $langs->trans('Reset') ?></a>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -817,6 +817,8 @@ class FormSetupItem
|
|||
$val_const = GETPOST($this->confKey, 'restricthtml');
|
||||
} elseif ($this->type == 'email') {
|
||||
$val_const = GETPOST($this->confKey, 'alphawithlgt');
|
||||
} elseif ($this->type == 'number') {
|
||||
$val_const = GETPOSTINT($this->confKey);
|
||||
} else {
|
||||
$val_const = GETPOST($this->confKey, 'alphanohtml');
|
||||
}
|
||||
|
|
@ -1411,6 +1413,31 @@ class FormSetupItem
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set type of input as number
|
||||
* @param int $min minimum value for input number
|
||||
* @param int $max maximum value for input number
|
||||
* @param int $step legal number intervals
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setAsNumber($min = null, $max = null, $step = null)
|
||||
{
|
||||
$this->type = 'number'; //for GETPOSTINT
|
||||
$this->fieldAttr['type'] = 'number'; //generic thanks to generateAttributesStringFromArray
|
||||
if (!is_null($min)) {
|
||||
$this->fieldAttr['min'] = $min;
|
||||
}
|
||||
if (!is_null($max)) {
|
||||
$this->fieldAttr['max'] = $max;
|
||||
}
|
||||
if (!is_null($step)) {
|
||||
$this->fieldAttr['step'] = $step;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set type of input as string
|
||||
*
|
||||
|
|
|
|||
|
|
@ -406,14 +406,40 @@ if (empty($reshook)) {
|
|||
if (!empty($listofbills)) {
|
||||
$nbwithdrawrequestok = 0;
|
||||
foreach ($listofbills as $aBill) {
|
||||
$db->begin();
|
||||
$result = $aBill->demande_prelevement($user, $aBill->resteapayer, 'bank-transfer', 'supplier_invoice');
|
||||
if ($result > 0) {
|
||||
$db->commit();
|
||||
$nbwithdrawrequestok++;
|
||||
} else {
|
||||
$db->rollback();
|
||||
$pendingAmount = 0;
|
||||
$sqlPending = "SELECT SUM(pfd.amount) as amount";
|
||||
$sqlPending .= " FROM ".$db->prefix()."prelevement_demande as pfd";
|
||||
$sqlPending .= " LEFT JOIN ".$db->prefix()."prelevement_lignes as pl ON pfd.fk_prelevement_bons = pl.fk_prelevement_bons";
|
||||
$sqlPending .= " WHERE fk_facture_fourn = ".((int) $aBill->id);
|
||||
$sqlPending .= " AND (pl.statut IS NULL OR pl.statut = 0)";
|
||||
$sqlPending .= " AND pfd.type = 'ban'";
|
||||
$resPending = $db->query($sqlPending);
|
||||
if (!$resPending) {
|
||||
$aBill->error = $db->lasterror();
|
||||
$aBill->errors[] = $aBill->error;
|
||||
setEventMessages($aBill->error, $aBill->errors, 'errors');
|
||||
} else {
|
||||
if ($objPending = $db->fetch_object($resPending)) {
|
||||
$pendingAmount = (float) $objPending->amount;
|
||||
}
|
||||
$db->free($resPending);
|
||||
|
||||
$requestAmount = $aBill->resteapayer - $pendingAmount;
|
||||
if ($requestAmount > 0) {
|
||||
$db->begin();
|
||||
$result = $aBill->demande_prelevement($user, $requestAmount, 'bank-transfer', 'supplier_invoice');
|
||||
if ($result > 0) {
|
||||
$db->commit();
|
||||
$nbwithdrawrequestok++;
|
||||
} else {
|
||||
$db->rollback();
|
||||
setEventMessages($aBill->error, $aBill->errors, 'errors');
|
||||
}
|
||||
} else {
|
||||
$aBill->error = 'WithdrawRequestErrorNilAmount';
|
||||
$aBill->errors[] = $aBill->error;
|
||||
setEventMessages($aBill->error, $aBill->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($nbwithdrawrequestok > 0) {
|
||||
|
|
|
|||
|
|
@ -374,3 +374,5 @@ RephraseStyleProfessional=Professional style
|
|||
RephraseStyleHumouristic=Humouristic style
|
||||
TextRephraser=Text style rephraser
|
||||
AIEnhancements=AI Enhancements
|
||||
TLSv1=TLSv1
|
||||
TLSv1.2=TLSv1.2
|
||||
|
|
|
|||
Loading…
Reference in a new issue