bill to invoice script (error)
below code is giving erro :
"Invalid values are given for creation"
response2 = invokeurl
[
url :"https://www.zohoapis.com/books/v3/bills/" + bill_id + "?organization_id=660450801"
type :GET
connection:"zoho_books1"
];
bill_info = response2.get("bill");
info "bill---" + bill;
for each line_item in bill_info.get("line_items")
{
Mymap = Map();
Mymap.put("rate",line_item.get("item_total"));
Mymap.put("bill_id",bill_info.get("bill_id"));
Mymap.put("name",line_item.get("account_name"));
Mymap.put("description",line_item.get("description"));
Mymap.put("quantity",line_item.get("quantity"));
// info line_item.get("line_item_taxes");
if(line_item.get("line_item_taxes").isEmpty() == false)
{
Mymap.put("tax_id",line_item.get("line_item_taxes").get(0).get("tax_id"));
}
Addlist2.add(Mymap);
FieldMap = Map();
FieldMap.put("customer_id",CustomerID);
FieldMap.put("line_items",Addlist2);
info FieldMap;
CreateInvocie = zoho.books.updateRecord("invoices",660450801,"1123024000013235007",FieldMap,"zoho_books1");