Spaces:
Runtime error
Runtime error
Download src/formatter.py from jayanth-2005/output: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/jayanth-2005/output/resolve/main/src/formatter.py
- Command line
-
hf download hf://spaces/jayanth-2005/output/src/formatter.py
-
curl -L -o formatter.py https://huggingface.co/spaces/jayanth-2005/output/resolve/main/src/formatter.py
1.09 kB
| def format_for_ca(data, invoice_type): | |
| if invoice_type == "GST_PURCHASE": | |
| voucher = "Purchase" | |
| debit = "Purchase A/c" | |
| credit = data["Vendor"] | |
| elif invoice_type == "SALES": | |
| voucher = "Sales" | |
| debit = data["Vendor"] | |
| credit = "Sales A/c" | |
| elif invoice_type == "CREDIT_NOTE": | |
| voucher = "Credit Note" | |
| debit = data["Vendor"] | |
| credit = "Purchase Return A/c" | |
| else: | |
| voucher = "Journal" | |
| debit = "Unknown" | |
| credit = "Unknown" | |
| narration = f"Being transaction with {data['Vendor']} vide inv {data['Invoice No']}" | |
| return { | |
| "Date": data["Date"], | |
| "Voucher Type": voucher, | |
| "Vendor": data["Vendor"], | |
| "GSTIN": data["GSTIN"], | |
| "Invoice No": data["Invoice No"], | |
| "Taxable": data["Taxable"], | |
| "CGST": data["CGST"], | |
| "SGST": data["SGST"], | |
| "IGST": data["IGST"], | |
| "Total": data["Total"], | |
| "Debit Ledger": debit, | |
| "Credit Ledger": credit, | |
| "Narration": narration, | |
| "Confidence": "Pending" | |
| } | |