File size: 1,091 Bytes
fa469cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8e3f8d2
fa469cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8e3f8d2
fa469cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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"
    }