Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -426,7 +426,12 @@ with gr.Blocks() as demo:
|
|
| 426 |
size = part_data["Size"].values[0]
|
| 427 |
type = part_data["Type"].values[0]
|
| 428 |
description = part_data["Description"].values[0]
|
| 429 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 430 |
if action == "Consume":
|
| 431 |
message = f"Are you sure you want to consume {used_length} inches of {part_number} ({size} {type} {description}) from a {from_length} inch sheet for job number {job_number}?"
|
| 432 |
elif action == "Add":
|
|
@@ -439,6 +444,7 @@ with gr.Blocks() as demo:
|
|
| 439 |
|
| 440 |
return html_message, gr.update(visible=True)
|
| 441 |
|
|
|
|
| 442 |
submit.click(
|
| 443 |
fn=show_confirmation,
|
| 444 |
inputs=[preferred, search_by, action, part_number, size, type, from_length, job_number, used_length, new_length, count],
|
|
|
|
| 426 |
size = part_data["Size"].values[0]
|
| 427 |
type = part_data["Type"].values[0]
|
| 428 |
description = part_data["Description"].values[0]
|
| 429 |
+
elif search_by == "Size and Type" and size and type:
|
| 430 |
+
part_data = inventory[(inventory["Size"] == size) & (inventory["Type"] == type)]
|
| 431 |
+
if not part_data.empty:
|
| 432 |
+
part_number = part_data["Part Number"].values[0]
|
| 433 |
+
description = part_data["Description"].values[0]
|
| 434 |
+
|
| 435 |
if action == "Consume":
|
| 436 |
message = f"Are you sure you want to consume {used_length} inches of {part_number} ({size} {type} {description}) from a {from_length} inch sheet for job number {job_number}?"
|
| 437 |
elif action == "Add":
|
|
|
|
| 444 |
|
| 445 |
return html_message, gr.update(visible=True)
|
| 446 |
|
| 447 |
+
|
| 448 |
submit.click(
|
| 449 |
fn=show_confirmation,
|
| 450 |
inputs=[preferred, search_by, action, part_number, size, type, from_length, job_number, used_length, new_length, count],
|