u
This commit is contained in:
@@ -18,4 +18,20 @@ inline int resolve_outgoing_warehouse(OdbcPool::Connection* c) {
|
||||
return std::stoi(rs[0][0].str);
|
||||
}
|
||||
|
||||
inline int resolve_warehouse_place(OdbcPool::Connection* c, int kWarenLager) {
|
||||
int configured = config::get_int("JTL_KWARENLAGERPLATZ", 0);
|
||||
if (configured > 0) return configured;
|
||||
|
||||
std::vector<Param> ps = {{ParamType::Int, "", kWarenLager}};
|
||||
ResultSet rs;
|
||||
if (!get_pool().execute(c,
|
||||
"SELECT TOP 1 kWarenLagerPlatz FROM dbo.tWarenLagerPlatz "
|
||||
"WHERE kWarenLager = ? AND ISNULL(nGesperrt, 0) = 0 "
|
||||
"ORDER BY nPrio, kWarenLagerPlatz", ps, rs) || rs.empty() || rs[0].empty()) {
|
||||
throw std::runtime_error("No warehouse place found for kWarenLager="
|
||||
+ std::to_string(kWarenLager) + "; set JTL_KWARENLAGERPLATZ explicitly.");
|
||||
}
|
||||
return std::stoi(rs[0][0].str);
|
||||
}
|
||||
|
||||
} // namespace delivery
|
||||
|
||||
Reference in New Issue
Block a user