issue with deluge script

issue with deluge script

i used chat gpt to build this script and I am getting 2 errors which I cannot figure out how to fix: 

void monthly_sales_order_generation()
{
    try
    {
        // ---------------- CONFIG -------------------

        salesorder_module = "SalesOrders";
        so_status_pending = "Pending Billing Review";

        // Products IDs
        prod_99492 = "5868377000023099069";
        prod_99493 = "5868377000023266001";
        prod_99494 = "5868377000023266006";
        prod_G2214 = "5868377000023266011";

        // Account CPT rate fields
        rateField_99492 = "field1";
        rateField_99493 = "field";
        rateField_99494 = "field2";
        rateField_G2214 = "G2214";

        // Analytics report columns
        visit_cpt_field = "CPT_Code";
        visit_date_field = "Visit_Date";
        account_field = "Account_ID";

        // ---------------- FETCH VISITS -------------------
        resp1 = invokeurl
        [
            url : analytics_url_1
            type : GET
            connection : "YOUR_ANALYTICS_CONNECTION"
        ];
        visits1 = resp1;

        resp2 = invokeurl
        [
            url : analytics_url_2
            type : GET
            connection : "YOUR_ANALYTICS_CONNECTION"
        ];
        visits2 = resp2;

        all_visits = list();
        all_visits.addAll(visits1);
        all_visits.addAll(visits2);

        // ---------------- DEFINE PREVIOUS MONTH -------------------
        todayDate = zoho.currentdate;
        first_of_this_month = todayDate.withDayOfMonth(1);
        prev_month_end = first_of_this_month.addDay(-1);
        prev_month_start = prev_month_end.withDayOfMonth(1);

        // ---------------- GROUP VISITS BY ACCOUNT -------------------
        grouped = map();

        for each v in all_visits
        {
            acc = v.get(account_field);
            cpt = v.get(visit_cpt_field);
            vdate_str = v.get(visit_date_field);

            if(acc != null && cpt != null && vdate_str != null)
            {
                vdate = vdate_str.toDate();
                if(vdate >= prev_month_start && vdate <= prev_month_end)
                {
                    if(!grouped.containsKey(acc))
                    {
                        grouped.put(acc, map());
                        grouped.get(acc).put("visitsList", list());
                    }

                    accMap = grouped.get(acc);
                    if(!accMap.containsKey(cpt))
                    {
                        accMap.put(cpt, list());
                    }

                    accMap.get(cpt).add(v);
                    accMap.get("visitsList").add(v);
                    grouped.put(acc, accMap);
                }
            }
        }

        // ---------------- CREATE SALES ORDERS -------------------
        for each accId in grouped.keys()
        {
            accAgg = grouped.get(accId);
            product_details = list();

            accResp = zoho.crm.getRecordById("Accounts", accId);
            if(accResp != null && accResp.size() > 0)
            {
                accRec = accResp;

                qty_99492 = accAgg.containsKey("99492") ? accAgg.get("99492").size() : 0;
                qty_99493 = accAgg.containsKey("99493") ? accAgg.get("99493").size() : 0;
                qty_99494 = accAgg.containsKey("99494") ? accAgg.get("99494").size() : 0;
                qty_G2214 = accAgg.containsKey("G2214") ? accAgg.get("G2214").size() : 0;

                price_99492 = accRec.get(rateField_99492) != null ? accRec.get(rateField_99492).toDecimal() : 0;
                price_99493 = accRec.get(rateField_99493) != null ? accRec.get(rateField_99493).toDecimal() : 0;
                price_99494 = accRec.get(rateField_99494) != null ? accRec.get(rateField_99494).toDecimal() : 0;
                price_G2214 = accRec.get(rateField_G2214) != null ? accRec.get(rateField_G2214).toDecimal() : 0;

                if(qty_99492 > 0)
                {
                    line = map();
                    line.put("product", {"id": prod_99492});
                    line.put("quantity", qty_99492);
                    line.put("list_price", price_99492);
                    line.put("CPT_Code", "99492");
                    product_details.add(line);
                }

                if(qty_99493 > 0)
                {
                    line = map();
                    line.put("product", {"id": prod_99493});
                    line.put("quantity", qty_99493);
                    line.put("list_price", price_99493);
                    line.put("CPT_Code", "99493");
                    product_details.add(line);
                }

                if(qty_99494 > 0)
                {
                    line = map();
                    line.put("product", {"id": prod_99494});
                    line.put("quantity", qty_99494);
                    line.put("list_price", price_99494);
                    line.put("CPT_Code", "99494");
                    product_details.add(line);
                }

                if(qty_G2214 > 0)
                {
                    line = map();
                    line.put("product", {"id": prod_G2214});
                    line.put("quantity", qty_G2214);
                    line.put("list_price", price_G2214);
                    line.put("CPT_Code", "G2214");
                    product_details.add(line);
                }

                if(product_details.size() > 0)
                {
                    soMap = map();
                    soMap.put("Account_Name", {"id": accId});
                    soMap.put("Subject", "Monthly CPT Billing - " + prev_month_start.toString("MMMM yyyy"));
                    soMap.put("Status", so_status_pending);
                    soMap.put("Product_Details", product_details);
                    soMap.put("Billing_Month", prev_month_start.toString("yyyy-MM-dd"));

                    createResp = zoho.crm.createRecord(salesorder_module, soMap);
                    if(createResp.get("id") != null)
                    {
                        info "Created Sales Order " + createResp.get("id") + " for Account " + accId;
                    }
                    else
                    {
                        info "Failed to create Sales Order for Account " + accId + ": " + createResp.toString();
                    }
                }
            }
        }
    }
    catch (e)
    {
        info e;
    }
}



 Syntax error. Expecting ';'. Found '.'. (Line : 73)
 Improper code format Correct format : <return_type> <category>.<function_name>(<type> <arg1>, <type> <arg1>,...<type> <arg50>){ <code> }