Получение со склада через карточку инструмента
This commit is contained in:
+11
-4
@@ -49,14 +49,20 @@ async def post_requests(
|
||||
action = request_data.get("body").get("action").get("operation")
|
||||
logger.info(f"Получение запроса на перемещение ({action}) инструмента")
|
||||
userId = request_data.get("body").get("userData").get("id")
|
||||
sourceTollboxId = (
|
||||
sourceTollboxId = int(
|
||||
request_data.get("body").get("action").get("selectedItem").get("toolboxId")
|
||||
)
|
||||
toolkitId = request_data.get("body").get("action").get("selectedItem").get("id")
|
||||
toolkitId = int(
|
||||
request_data.get("body").get("action").get("selectedItem").get("id")
|
||||
)
|
||||
quantity = request_data.get("body").get("action").get("quantity")
|
||||
price = round(
|
||||
request_data.get("body").get("action").get("selectedItem").get("totalCost")
|
||||
/ request_data.get("body").get("action").get("selectedItem").get("available"),
|
||||
float(
|
||||
request_data.get("body").get("action").get("selectedItem").get("totalCost")
|
||||
)
|
||||
/ int(
|
||||
request_data.get("body").get("action").get("selectedItem").get("available")
|
||||
),
|
||||
2,
|
||||
)
|
||||
reason = request_data.get("body").get("action").get("comment")
|
||||
@@ -78,6 +84,7 @@ async def post_requests(
|
||||
if result:
|
||||
resonse["status"] = "ok"
|
||||
case "get":
|
||||
logger.info(f"Получение инструмента {toolkitId} из ящика {sourceTollboxId}")
|
||||
targetTollboxId = await ToolboxHandler.getIdByOwner(userId)
|
||||
result = await StocksActions.takeToolkit(
|
||||
sourceTollboxId,
|
||||
|
||||
Reference in New Issue
Block a user