Schedule function only takes into account invoice's from current month?

Schedule function only takes into account invoice's from current month?

Hi, 

I'm working on a function that applies late fees to Invoices that are overdue in my system. I've set it up with a schedule in Zoho Books that filters for all invoices where the status is overdue and the field ''subject to late fees'' is set to Yes. Then it sends a webhook to Zoho flow where I generate a new invoice for a late fee % of the outstanding balance.

I've executed the function and it only seems to work for Invoices that have been created this month... Is there a reason for that?

See function:


  1. organizationID = organization.get("organization_id");
  2. querymap = Map();
  3. invoices = zoho.books.getRecords("invoices",organizationID,querymap,"zbooks");
  4. invoice_list = invoices.get("invoices");
  5. //info invoices;
  6. for each  invoice in invoice_list
  7. {
  8. invoice_id = invoice.get("invoice_id");
  9. status = invoice.get("status");
  10. lateFee = invoice.get("cf_subject_to_late_fees");
  11. //date1 = invoice.get("date");
  12. if(lateFee == "Yes" && status == "overdue")
  13. {
  14. //&& date1 > "15/04/2023")
  15. flowparams = Map();
  16. flowparams.put("invoice_Id",invoice_id);
  17. flowresp = invokeurl
  18. [
  19. url :"https://flow.zoho.com/729751030/flow/webhook/incoming?zapikey=1001.f684ff72f0ef991d348af2717d04f2d5.9726c16ed8ff914b2b6bb517ddabfa14&isdebug=false"
  20. type :POST
  21. parameters:flowparams
  22. ];
  23. info flowresp;
  24. }
  25. }