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:
- organizationID = organization.get("organization_id");
- querymap = Map();
- invoices = zoho.books.getRecords("invoices",organizationID,querymap,"zbooks");
- invoice_list = invoices.get("invoices");
- //info invoices;
- for each invoice in invoice_list
- {
- invoice_id = invoice.get("invoice_id");
- status = invoice.get("status");
- lateFee = invoice.get("cf_subject_to_late_fees");
- //date1 = invoice.get("date");
- if(lateFee == "Yes" && status == "overdue")
- {
- //&& date1 > "15/04/2023")
- flowparams = Map();
- flowparams.put("invoice_Id",invoice_id);
- flowresp = invokeurl
- [
- url :"https://flow.zoho.com/729751030/flow/webhook/incoming?zapikey=1001.f684ff72f0ef991d348af2717d04f2d5.9726c16ed8ff914b2b6bb517ddabfa14&isdebug=false"
- type :POST
- parameters:flowparams
- ];
- info flowresp;
- }
- }