diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 420338f2a9d..d5bc7e273e2 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -77,7 +77,6 @@ if (preg_match('/\/api\/index\.php/', $_SERVER["PHP_SELF"])) { header('Access-Control-Allow-Headers: Content-Type, Authorization, api_key, DOLAPIKEY'); } - $res = 0; if (!$res && file_exists("../main.inc.php")) { $res = include '../main.inc.php'; diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index 63cd091652a..b8675b3a7e5 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -192,6 +192,7 @@ $limit = 5; $sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " WHERE p.type = 'bank-transfer'"; +$sql .= " AND p.entity IN (".getEntity('invoice').")"; $sql .= " ORDER BY datec DESC"; $sql .= $db->plimit($limit); diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 38ea2fb1d52..65ba71a0d2f 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -262,12 +262,20 @@ if ($id) { $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf"; - $sql .= " , ".MAIN_DB_PREFIX."facture as f"; + if ($type == 'bank-transfer') { + $sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f"; + } else { + $sql .= " , ".MAIN_DB_PREFIX."facture as f"; + } $sql .= " , ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE pf.fk_prelevement_lignes = pl.rowid"; $sql .= " AND pl.fk_prelevement_bons = p.rowid"; $sql .= " AND f.fk_soc = s.rowid"; - $sql .= " AND pf.fk_facture = f.rowid"; + if ($type == 'bank-transfer') { + $sql .= " AND pf.fk_facture_fourn = f.rowid"; + } else { + $sql .= " AND pf.fk_facture = f.rowid"; + } $sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= " AND pl.rowid = ".((int) $id); if ($socid) { diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index dd1e0ea4027..4bd64f44577 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -42,4 +42,5 @@ HideLots=Hide lots #Traceability - qc status OutOfOrder=Out of order InWorkingOrder=In working order -ToReplace=Replace \ No newline at end of file +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. diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index e1883f5bba0..68b5e928084 100644 --- a/htdocs/langs/fr_FR/productbatch.lang +++ b/htdocs/langs/fr_FR/productbatch.lang @@ -43,3 +43,4 @@ HideLots=Masquer les lots OutOfOrder=Hors d'usage InWorkingOrder=En état de marche 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. diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 18a394559a3..8389d63e843 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -959,7 +959,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') { $delallowed = $usercancreate; $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; print '