Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +6 -2
src/streamlit_app.py
CHANGED
|
@@ -532,8 +532,7 @@ Extract the data into this exact JSON structure:
|
|
| 532 |
"quantity": "Quantity of items",
|
| 533 |
"unit_price": "Price per unit",
|
| 534 |
"amount": "Total amount for this line item",
|
| 535 |
-
"
|
| 536 |
-
"tax": "amount*t_rate/100",
|
| 537 |
"Line_total": "Total amount including tax for this line"
|
| 538 |
}
|
| 539 |
],
|
|
@@ -552,6 +551,11 @@ IMPORTANT GUIDELINES:
|
|
| 552 |
Example:
|
| 553 |
Invoice currency = USD → extract the USD bank account.
|
| 554 |
Invoice currency = GBP → extract the GBP bank account.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 555 |
- Preserve original number formatting (including commas, decimals), Do not include currency symbol for amount field.
|
| 556 |
- If multiple line items exist, include all of them in the items array
|
| 557 |
- Use empty string "" for any field that is not present or cannot be clearly identified
|
|
|
|
| 532 |
"quantity": "Quantity of items",
|
| 533 |
"unit_price": "Price per unit",
|
| 534 |
"amount": "Total amount for this line item",
|
| 535 |
+
"tax": "Tax for this item",
|
|
|
|
| 536 |
"Line_total": "Total amount including tax for this line"
|
| 537 |
}
|
| 538 |
],
|
|
|
|
| 551 |
Example:
|
| 552 |
Invoice currency = USD → extract the USD bank account.
|
| 553 |
Invoice currency = GBP → extract the GBP bank account.
|
| 554 |
+
- REQUIRED: Always populate "bank_acc_name". RULES:
|
| 555 |
+
1) If a field explicitly labeled as bank account (examples: "Account name", "Account holder", "Beneficiary", "Beneficiary name", "Account:", "Account Name:", "Bank acc name:") exists, set bank_acc_name to that exact text.
|
| 556 |
+
2) Otherwise set bank_acc_name = sender_name (the value extracted from explicit sender/company fields).
|
| 557 |
+
3) Always also extract sender_name separately from sender/company sections.
|
| 558 |
+
4) Never leave bank_acc_name empty unless both bank and sender/company are absent — then set bank_acc_name = ""
|
| 559 |
- Preserve original number formatting (including commas, decimals), Do not include currency symbol for amount field.
|
| 560 |
- If multiple line items exist, include all of them in the items array
|
| 561 |
- Use empty string "" for any field that is not present or cannot be clearly identified
|