File size: 263 Bytes
436f02b
 
 
 
 
884071e
436f02b
884071e
436f02b
884071e
 
1
2
3
4
5
6
7
8
9
10
11
12
def classify_invoice(text):
    text = text.lower()

    if "credit note" in text:
        return "CREDIT_NOTE"
    if "tax invoice" in text and "gstin" in text:
        return "GST_PURCHASE"
    if "invoice" in text:
        return "SALES"

    return "UNKNOWN"