Set Invoice status to sent via Deluge
Hello,
I try to generate an invoice from Creator with Delug. After generating the invoice the user should be redirekted to the invoice url. This works fine, but the invoice is generated with status draft. So the invoice url will not work.
Here is my test Code:
- itemsList = list();
- for each record in Products
- {
- item = map();
- item.put("name", record.Item_Name );
- item.put("rate", record.Rate);
- item.put("quantity", record.Quantity);
- itemsList.add(item);
- }
- values = Map();
- values.put("customer_id","2587XXXXXXXXXXXX");
- values.put("invoice_number",input.Inv_number);
- values.put("date",zoho.currentdate);
- values.put("line_items", itemsList);
- values.put("status", "sent");
- RGNR = zoho.books.createRecord("Invoices","200XXXXXXXX",values);
- info RGNR;
- //customer_id = resp.getJSON("contact").toJSONList().getJSON("contact_id");
- inv = RGNR.getJSON("invoice").toJSONList();
- inv_url = inv.getJSON("invoice_url");
- openUrl(inv_url, "same window");
Can you tell me whats wrong?