Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0

Conflicts:
	htdocs/api/index.php
	htdocs/langs/en_US/productbatch.lang
	htdocs/langs/fr_FR/productbatch.lang
	htdocs/ticket/list.php
This commit is contained in:
Laurent Destailleur 2022-02-16 20:31:55 +01:00
commit 2a18bce2f3
8 changed files with 22 additions and 10 deletions

View File

@ -77,7 +77,6 @@ if (preg_match('/\/api\/index\.php/', $_SERVER["PHP_SELF"])) {
header('Access-Control-Allow-Headers: Content-Type, Authorization, api_key, DOLAPIKEY'); header('Access-Control-Allow-Headers: Content-Type, Authorization, api_key, DOLAPIKEY');
} }
$res = 0; $res = 0;
if (!$res && file_exists("../main.inc.php")) { if (!$res && file_exists("../main.inc.php")) {
$res = include '../main.inc.php'; $res = include '../main.inc.php';

View File

@ -192,6 +192,7 @@ $limit = 5;
$sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut"; $sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " WHERE p.type = 'bank-transfer'"; $sql .= " WHERE p.type = 'bank-transfer'";
$sql .= " AND p.entity IN (".getEntity('invoice').")";
$sql .= " ORDER BY datec DESC"; $sql .= " ORDER BY datec DESC";
$sql .= $db->plimit($limit); $sql .= $db->plimit($limit);

View File

@ -262,12 +262,20 @@ if ($id) {
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf";
if ($type == 'bank-transfer') {
$sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f";
} else {
$sql .= " , ".MAIN_DB_PREFIX."facture as f"; $sql .= " , ".MAIN_DB_PREFIX."facture as f";
}
$sql .= " , ".MAIN_DB_PREFIX."societe as s"; $sql .= " , ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE pf.fk_prelevement_lignes = pl.rowid"; $sql .= " WHERE pf.fk_prelevement_lignes = pl.rowid";
$sql .= " AND pl.fk_prelevement_bons = p.rowid"; $sql .= " AND pl.fk_prelevement_bons = p.rowid";
$sql .= " AND f.fk_soc = s.rowid"; $sql .= " AND f.fk_soc = s.rowid";
if ($type == 'bank-transfer') {
$sql .= " AND pf.fk_facture_fourn = f.rowid";
} else {
$sql .= " AND pf.fk_facture = f.rowid"; $sql .= " AND pf.fk_facture = f.rowid";
}
$sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= " AND f.entity IN (".getEntity('invoice').")";
$sql .= " AND pl.rowid = ".((int) $id); $sql .= " AND pl.rowid = ".((int) $id);
if ($socid) { if ($socid) {

View File

@ -43,3 +43,4 @@ HideLots=Hide lots
OutOfOrder=Out of order OutOfOrder=Out of order
InWorkingOrder=In working order InWorkingOrder=In working order
ToReplace=Replace ToReplace=Replace
CantMoveNonExistantSerial=Error. You ask a move on a record for a serial that does not exists anymore. May be you take the same serial on same warehouse several times in same shipment or it was used by another shipment. Remove this shipment and prepare another one.

View File

@ -43,3 +43,4 @@ HideLots=Masquer les lots
OutOfOrder=Hors d'usage OutOfOrder=Hors d'usage
InWorkingOrder=En état de marche InWorkingOrder=En état de marche
ToReplace=Remplacer ToReplace=Remplacer
CantMoveNonExistantSerial=Erreur : Vous avez demandé un mouvement sur un numéro de série qui n’existe plus. Peut-être avez-vous requis le même numéro de série plusieurs fois dans une même expédition, ou il a déjà servi dans une autre expédition. Supprimez cette expédition et préparez-en une autre.

View File

@ -959,7 +959,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') {
$delallowed = $usercancreate; $delallowed = $usercancreate;
$modulepart = 'stock'; $modulepart = 'stock';
print $formfile->showdocuments($modulepart, $object->ref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object); print $formfile->showdocuments($modulepart, $objectref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object);
$somethingshown = $formfile->numoffiles; $somethingshown = $formfile->numoffiles;
print '</div><div class="fichehalfright">'; print '</div><div class="fichehalfright">';

View File

@ -851,7 +851,9 @@ class MouvementStock extends CommonObject
*/ */
private function createBatch($dluo, $qty) private function createBatch($dluo, $qty)
{ {
global $user; global $user, $langs;
$langs->load('productbatch');
$pdluo = new Productbatch($this->db); $pdluo = new Productbatch($this->db);
@ -862,7 +864,7 @@ class MouvementStock extends CommonObject
$result = $pdluo->fetch($dluo); $result = $pdluo->fetch($dluo);
if (empty($pdluo->id)) { if (empty($pdluo->id)) {
// We didn't find the line. May be it was deleted before by a previous move in same transaction. // We didn't find the line. May be it was deleted before by a previous move in same transaction.
$this->error = 'Error. You ask a move on a record for a serial that does not exists anymore. May be you take the same serial on same warehouse several times in same shipment or it was used by another shipment. Remove this shipment and prepare another one.'; $this->error = $langs->trans('CantMoveNonExistantSerial');
$this->errors[] = $this->error; $this->errors[] = $this->error;
$result = -2; $result = -2;
} }

View File

@ -621,10 +621,10 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit); $param .= '&limit='.urlencode($limit);
} }
foreach ($search as $key => $val) { foreach ($search as $key => $val) {
if (is_array($search[$key]) && count($search[$key])) { if (is_array($val) && count($val)) {
foreach ($search[$key] as $skey) { foreach ($val as $skey) {
if ($skey != '') { if ($skey != '') {
$param .= '&search_'.$key.'[]='.urlencode($skey); $param .= (!empty($val)) ? '&search_'.$key.'[]='.urlencode($skey) : "";
} }
} }
} elseif ($search[$key] != '') { } elseif ($search[$key] != '') {