Invoice_Eway_bill_Details_Update (BOOKS)
Tue Jan 07 2025 15:16:47 GMT+0000 (Coordinated Universal Time)
Saved by
@Pooja
void Invoice.Invoice_Eway_bill_Details_Update()
{
books_access = thisapp.Books.Get_Books_Access();
conn_tok = books_access.get("connection");
org_id = books_access.get("organisation_id");
invoicedata = Invoice[Zoho_Books_ID != null && E_Way_Bill_No == ""] sort by Added_Time desc range from 1 to 20;
// invoicedata = Invoice[Zoho_Books_ID != null && E_Way_Bill_No == "" && Sale_Order_No == null] sort by ID desc range from 21 to 30;
//invoicedata = Invoice[Zoho_Books_ID != null && E_Way_Bill_No == "" && Sale_Order_No != null];
//invoicedata = Invoice[Zoho_Books_ID == "917835000036874439" && E_Way_Bill_No == ""];
info invoicedata.count();
i = 0;
for each recxx in invoicedata
{
zbid = recxx.Zoho_Books_ID;
invoice_resp = zoho.books.getRecordsByID("invoices",org_id,zbid.tostring(),conn_tok);
//info "invoice resp code " + invoice_resp.get("code") + "---" + zbid;
ewaybill = invoice_resp.get("invoice").toMap().get("eway_bill_details");
info ewaybill;
if(!isempty(ewaybill))
{
bno = ewaybill.get("eway_bill_number");
if(!isnull(bno))
{
recxx.E_Way_Bill_No=ewaybill.get("eway_bill_number");
}
if(!isnull(ewaybill.get("eway_bill_date")))
{
recxx.E_Way_Bill_Date=ewaybill.get("eway_bill_date").toString("dd-MMM-yyyy");
}
i = i + 1;
}
else if(!isnull(ewaybill))
{
bno = ewaybill.get("eway_bill_number");
if(!isnull(bno))
{
recxx.E_Way_Bill_No=ewaybill.get("eway_bill_number");
}
if(!isnull(ewaybill.get("eway_bill_date")))
{
recxx.E_Way_Bill_Date=ewaybill.get("eway_bill_date").toString("dd-MMM-yyyy");
}
i = i + 1;
}
}
info i;
}
content_copyCOPY
Comments