server: fix update stock
This commit is contained in:
parent
cd601ede89
commit
3395d36c3c
|
@ -311,6 +311,8 @@ def add_part(part)
|
|||
field = "location"
|
||||
part[field] = nil if part[field] and 0 == part[field].length
|
||||
if part[field] then
|
||||
delete = @db.prepare("DELETE FROM inventory WHERE part = ?")
|
||||
delete.execute(part["id"])
|
||||
statement = @db.prepare("SELECT id FROM #{field} WHERE LOWER(name) = ?")
|
||||
ref = statement.execute(part[field].downcase).to_a[0]
|
||||
unless ref then
|
||||
|
|
Loading…
Reference in New Issue