Fix: Correction so that warehouse does not have to be indicated if it is a service

This commit is contained in:
Ferran Marcet 2024-03-14 16:44:07 +01:00 committed by Juanjo Menent
parent 54bdad710d
commit 9430bebbb1
2 changed files with 3 additions and 4 deletions

View File

@ -9,7 +9,7 @@
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014-2017 Francis Appels <francis.appels@yahoo.com>
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* Copyright (C) 2016-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016-2024 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Lenin Rivas <lenin@leninrivas.com>
@ -920,7 +920,7 @@ class Expedition extends CommonObject
if (isModEnabled('stock') && !empty($orderline->fk_product)) {
$fk_product = $orderline->fk_product;
if (!($entrepot_id > 0) && !getDolGlobalString('STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS')) {
if (!($entrepot_id > 0) && !getDolGlobalString('STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS') && !(getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES') && $line->product_type == Product::TYPE_SERVICE)) {
$langs->load("errors");
$this->error = $langs->trans("ErrorWarehouseRequiredIntoShipmentLine");
return -1;

View File

@ -3,7 +3,6 @@
* Copyright (C) 2018 Andreu Bisquerra <jove@bisquerra.com>
* Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2022-2023 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2024 Ferran Marcet <fmarcet@2byte.es>
*
* 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
@ -924,7 +923,7 @@ if (empty($reshook)) {
if ($action=="setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set batch='".$db->escape($batch)."', fk_warehouse=".getDolGlobalString($constantforkey)." where rowid=".((int) $idoflineadded);
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set batch=".$db->escape($batch).", fk_warehouse=".getDolGlobalString($constantforkey)." where rowid=".((int) $idoflineadded);
$db->query($sql);
}