Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -163,6 +163,12 @@ class InvoiceProcessingApp:
|
|
| 163 |
|
| 164 |
files = self.get_available_files()
|
| 165 |
chosen = st.sidebar.multiselect("Select invoices to process", files)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
|
| 167 |
st.session_state.selected_files = chosen
|
| 168 |
|
|
@@ -199,6 +205,16 @@ class InvoiceProcessingApp:
|
|
| 199 |
]
|
| 200 |
return sorted(files)
|
| 201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
# WORKFLOW EXECUTION
|
| 203 |
# def _get_stages_for_workflow(self, workflow_type: str) -> list[str]:
|
| 204 |
# """Return dynamic stage flow for given workflow type."""
|
|
|
|
| 163 |
|
| 164 |
files = self.get_available_files()
|
| 165 |
chosen = st.sidebar.multiselect("Select invoices to process", files)
|
| 166 |
+
|
| 167 |
+
st.sidebar.markdown("---")
|
| 168 |
+
st.sidebar.markdown("## 🧾 Purchase Order Details")
|
| 169 |
+
|
| 170 |
+
POs = self.get_available_PO()
|
| 171 |
+
PO = st.sidebar.multiselect("Select PO to process", POs)
|
| 172 |
|
| 173 |
st.session_state.selected_files = chosen
|
| 174 |
|
|
|
|
| 205 |
]
|
| 206 |
return sorted(files)
|
| 207 |
|
| 208 |
+
def get_available_PO(self) -> List[str]:
|
| 209 |
+
po_dir = "data"
|
| 210 |
+
os.makedirs(po_dir, exist_ok=True)
|
| 211 |
+
files = [
|
| 212 |
+
os.path.join(po_dir, f)
|
| 213 |
+
for f in os.listdir(po_dir)
|
| 214 |
+
if f.lower().endswith(".csv")
|
| 215 |
+
]
|
| 216 |
+
return sorted(files)
|
| 217 |
+
|
| 218 |
# WORKFLOW EXECUTION
|
| 219 |
# def _get_stages_for_workflow(self, workflow_type: str) -> list[str]:
|
| 220 |
# """Return dynamic stage flow for given workflow type."""
|