Environment - Vendor portal, Mailbox, etc. CorrelationProperty_Submit_Invoice Submit_the_invoice Gateway_validation_successful_question_mark Event_15y55nw Gateway_1lbghql Event_0x83ruk Event_0m3ri6v Gateway_1l4tz4i Activity_0fq1nb4 Event_1usbnt0 Event_0lhkxwc Event_1b58a3z Activity_0faln91 Event_0rwxlca Activity_07oyzdx Gateway_05ov5p5 Activity_0p88elm Gateway_1717c0p Activity_104xpp8 Activity_175j3o7 Event_176ch98 Delete_File Gateway_0dqj39f Event_1vi3um1 SubProcess_Data_validation_rules Event_invoice_validation_failed Gateway_0wk5se9 Activity_show_errors Activity_1colhao Activity_1u89kok Event_1r3yh2kx Activity_0rae8g6 Activity_1ucvkk4 Activity_1kgaqpf Waku_Message_Pending_Payment Activity_0gkpa9s Activity_0gkejaj Event_169on0z Activity_10p5t0r Activity_0twki30 Activity_1864qj2 Activity_06b32ar Activity_1t8wi0r Gateway_06i3we9 Event_09q0ym0 Activity_0cdgqi0 Gateway_1ytq6m7 Activity_11stdua Event_1lh7308 not(svc_is_invoice_submit_pass) not(isMatch) not(isInvoiceApproved) not(isInvoiceApproved) Flow_17vkjgc Flow_02moyg7 Flow_1ck27i7 Flow_1x4rtop Flow_05ffq52 Flow_02moyg7 Flow_1ck27i7 DataObjectReference_0bymrvr Flow_1avkxpe Flow_18i6dlo Flow_1d7sgm2 invoice_date_obj = datetime.strptime(invoice.dueDate, '%Y-%m-%d') local_date_time_obj = datetime.strptime(local_date_str, '%Y-%m-%d') if invoice_date_obj > local_date_time_obj: svc_is_due_date_after = True else: svc_is_due_date_after = False # Add date of invoice invoice["invoiceDate"] = local_date_str ld = str(local_date_time_obj) ido = str(invoice_date_obj) del local_date_time_obj del invoice_date_obj del datetime Flow_04odmtl {"invoice.contributorName": "Harmeet"} { "isNameNum": false, "invoice.contributorName": "Harmeet" } Flow_1avkxpe Flow_0mvmd06 svc_is_num_in_name = False for c in invoice.contributorName: if c.isdigit(): svc_is_num_in_name = True break del c Flow_0mvmd06 Flow_0wp2mcf # Check if there are more than two decimal places invoiceAmount_str = str(invoice.invoiceAmount) d = decimal.Decimal(invoiceAmount_str) d_cnt = d.as_tuple().exponent # Get number of decimal places svc_decimal_cnt = abs(d_cnt) #Delete unneeded variables del d del d_cnt del decimal Submit_Involce_Validation Flow_1d7sgm2 Flow_0tzjowk Flow_0wp2mcf Flow_18i6dlo Flow_0tzjowk Flow_04odmtl # Set Invoice Status if svc_is_invoice_submit_pass: invoice["invoiceStatus"] = "Awaiting approval" else: invoice["invoiceStatus"] = "Invoice validation failed" Process milestone should update the process metadata field “milestone reached” Flow_05ffq52 Flow_13ng1f4 Flow_1pefcgv Flow_1strwr5 Flow_17vkjgc {{ submitInvoiceValidationMessage }} **Please fix when resubmitting.** Flow_13ng1f4 Flow_18cic3h whichSubject = "Currency" addNew = False Flow_0bipj9q Flow_1wfxajw find_user = current_user["username"] isCurrentUser = True Flow_1vxagrf Flow_0bipj9q DataObjectReference_05liqvr Flow_1vxagrf Process milestone should update the process metadata field “milestone reached” Flow_04fl87d Flow_1ex5hfx Flow_1c5u447 Flow_1gohkts Flow_16bw9hx Flow_16bw9hx Flow_0kngdw4 Flow_1gohkts Flow_04ccp12 Flow_00kky3k Flow_15pzvrr Flow_18xvx8w Flow_0bfs2xe # Set Timer Check isApprovalTimer = False __________________________________________________________________________ _**Submitted by:**_ {{ invoice.contributorName }} _**Submiiter Id:**_ {{ invoice.contributorId }} _**Invoice Id:**_ {{ invoice.invoiceId }} _**Amount:**_ {{ invoice.invoiceAmount_str }} _**Submitted on:**_ {{ invoiceDate }} _**Due Date:**_ {{ invoice.dueDate}} __________________________________________________________________________ Flow_0lfqk0y Flow_09r1s5r __________________________________________________________________________ _**Submitted by:**_ {{ invoice.contributorName }} _**Submiiter Id:**_ {{ invoice.contributorId }} _**Invoice Id:**_ {{ invoice.invoiceId }} _**Amount:**_ {{ invoice.invoiceAmount_str }} _**Due Date:**_ {{ invoice.dueDate}} __________________________________________________________________________ Flow_1ds4s8o Flow_1whkgq0 Flow_1v8dszb Flow_1w4cqkv # Set Timer Check isApprovalTimer = True Flow_1w4cqkv Flow_09r1s5r Flow_1qf14hx Flow_0h96w9j Flow_053ca95 DataObjectReference_1g4gzsx Flow_1l74eab Flow_00kky3k Flow_0h96w9j Flow_1jfb24q Flow_053ca95 Flow_1fvtcqt Flow_0c0c9mw Flow_1x00zm0 Flow_15pzvrr # Store Team Lead comments elsewhere and clear form comments if isApprovalTimer: invoice["commentsProjectLead"] = "No action taken within allotted time" approvalComment = "" invoice["isProjectLeadApprove"] = False isInvoiceApproved = False # Set Invoice Status invoice["invoiceStatus"] = "Rejected" else: invoice["commentsProjectLead"] = approvalComment approvalComment = "" invoice["isProjectLeadApprove"] = isInvoiceApproved # Set Invoice Status invoice["invoiceStatus"] = "Approved" Flow_1qf14hx Flow_1x00zm0 timedelta(seconds=1) Flow_1whkgq0 Flow_02v6lr2 invoice.commentsFinance = approvalComment approvalComment = "" # Set Invoice Status if isInvoiceApproved: invoice["invoiceStatus"] = "Approved by Finance Team" else: invoice["invoiceStatus"] = "Rejected by Finance Team" Flow_02v6lr2 Flow_1l74eab timedelta(seconds=1) __________________________________________________________________________ _**Submitted by:**_ {{ invoice.contributorName }} _**Submitter Id:**_ {{ invoice.contributorId }} _**Invoice Id:**_ {{ invoice.invoiceId }} _**Amount:**_ {{ invoice.invoiceAmount_str }} _**Submitted on:**_ {{ invoice.invoiceDate }} _**Due Date:**_ {{ invoice.dueDate}} __________________________________________________________________________ Thank you for your invoice submission. Updates on the progress of your submission will.be sent to your Status app. Please click Submit below to return to your Home page. __________________________________________________________________________ Flow_06amgv2 Flow_0z51hpb Flow_14glsqd Flow_0hev3yn Flow_1s2as7o Flow_0hyvwku Flow_0o94g4u Flow_02o270g Flow_0o94g4u Flow_0a9w301 Flow_1s2as7o Flow_0hyvwku invoice_file_name = invoice.contributorName + "_" + str(invoice.invoiceId) + ".pdf" Flow_0hev3yn Flow_02o270g Flow_0dhpy0v Flow_14glsqd Flow_0a9w301 Flow_0cj1m0h del(filesAccept) Flow_0z51hpb Flow_06mfxze Flow_1xvt99y Flow_1xvt99y Flow_0dhpy0v timedelta(seconds=1) Flow_0bfs2xe Flow_0c0c9mw DataObjectReference_1wclgyx Flow_14x1v12 # Check if there are Project Lead and/or Finance comments is isMatch: len_finance_comments = len(invoice["commentsFinance"].strip()) len_project_lead_comments = 0 else: len_finance_comments = len(invoice["commentsFinance"].strip()) len_project_lead_comments = len(invoice["commentsProjectLead"].strip()) # Set which message if isApprovalTimer: task_id = "waku_no_team_lead_response" else: task_id = "waku_invoice_rejected" # Set Message should not be set isSetMessage = True # Set Time Zone time_zone = current_user_extras["time_zone"] # Set Time Format time_format = current_user_extras["time_format"] # Set Date Format time_format = current_user_extras["date_format"] Flow_14x1v12 Flow_1bnxkd6 Flow_01i59kw Flow_1bnxkd6 Flow_01i59kw Flow_0kngdw4 Flow_0lfqk0y Flow_0dvboik Flow_0y37dgj # Set who for find find_user = userKeycloak isCurrentUser = False Flow_0bv17h4 Flow_1jor3kc Flow_0re50gq Flow_0y37dgj # Set Waku message variables task_id = "waku_notify_project_lead" isSetMessage = True Flow_0cl4jmz Flow_0re50gq Flow_1jor3kc Flow_0cl4jmz # Set Project Lead Info project_lead_info = {} project_lead_info["full_name"] = userFullName project_lead_info["first_name"] = userFirstName project_lead_info["email"] = userEmail project_lead_info["time_zone"] = userTimeZone project_lead_info["time_format"] = userTimeFormat project_lead_info["date_format"] = userDateFormat project_lead_info["status_key"] = userStatusKey # Move to pre-script of Waku Message # Set Time Zone time_zone = project_lead_info["time_zone"] # Set Time Format time_format = project_lead_info["time_format"] # Set Date Format time_format = project_lead_info["date_format"] del(userFullName) del(userFirstName) del(userEmail) del(userTimeZone) del(userTimeFormat) del(userDateFormat) del(userStatusKey) Flow_0dvboik Flow_01ki4jt userBambooId_str = current_user_extras["bamboo_supervisor_api_id"] # Set who for find find_user = userKeycloak isCurrentUser = False Flow_01ki4jt Flow_0bv17h4 Flow_18xvx8w Flow_04ccp12 Flow_1ds4s8o DataObjectReference_0x2dn5o Flow_11zkgke # Set Task Id task_id = "waku_notify_finance" # Set Message should not be set isSetMessage = True isInvoiceApproved = "" Flow_0u8sn4c Flow_0n3djvs Flow_0lr2fpj Flow_0n3djvs Flow_0lr2fpj Flow_11zkgke Flow_1ale8a2 # Get Finance Group Members finance_members_start = get_group_members("Finance Team") finance_members = finance_members_start # Removed all but Sasha for demo for member in finance_members: if member != "alex": finance_members.remove(member) # Set who for find find_user = 'alex' isCurrentUser = False Flow_1ale8a2 Flow_1gfeknb Flow_1gfeknb Flow_0u8sn4c # Set Project Lead Info finance_info = {} finance_info["full_name"] = userFullName finance_info["first_name"] = userFirstName finance_info["email"] = userEmail finance_info["time_zone"] = userTimeZone finance_info["time_format"] = userTimeFormat finance_info["date_format"] = userDateFormat finance_info["status_key"] = userStatusKey # Move to pre-script of Waku Message # Set Time Zone time_zone = finance_info["time_zone"] # Set Time Format time_format = finance_info["time_format"] # Set Date Format time_format = finance_info["date_format"] del(userFullName) del(userFirstName) del(userEmail) del(userTimeZone) del(userTimeFormat) del(userDateFormat) del(userStatusKey) # Set Invoice Status to Approved and Pending Payment invoice["invoiceStatus"] = "Approved and Pending Payment" Flow_1fvtcqt Flow_1jfb24q DataObjectReference_0br9o6c Flow_1j5eznh # Check for Finance comments len_finance_comments = len(invoice["commentsFinance"].strip()) # Set Task Id and Project Lead comments length if isMatch: task_id = "waku_payment_pending_ismatch" len_project_lead_comments = 0 else: task_id = "waku_payment_pending_not_ismatch" len_project_lead_comments = len(invoice["commentsProjectLead"].strip()) # Set Message in Call Activity isSetMessage = True # Set Time Zone timezone = current_user_extras["time_zone"] Flow_1j5eznh Flow_1w7kqay Flow_1buk0a2 Flow_1w7kqay Flow_1buk0a2 Flow_0cj1m0h Flow_04fl87d DataObjectReference_1ykzuco Flow_1yktpsd Flow_17xbb2s Flow_0j4xxzp Flow_17xbb2s # Set Task List task_id = "waku_invoice_submitted" # Set Message should be generated isSetMessage = True # Set Time Zone time_zone = current_user_extras["time_zone"] # Set Time Format time_format = current_user_extras["time_format"] # Set Date Format time_format = current_user_extras["date_format"] Flow_1yktpsd Flow_0j4xxzp Flow_1ex5hfx Flow_1c5u447 Flow_1sc1v4y Invoice_Approval_Check Flow_1m8uxeg Flow_04do8x7 Flow_02g4qn2 Flow_0nxzc38 annual_salary_str = resp_BambooPayRate["amount"] annual_salary = float(annual_salary_str) Flow_0xtzqkg Flow_1m8uxeg invoice_amount = invoice.invoiceAmount Flow_04do8x7 Flow_0nxzc38 Flow_0xtzqkg Flow_1sc1v4y Flow_02g4qn2 Flow_06mfxze timedelta(seconds=1000) Flow_1v8dszb timedelta(minutes=3) curCode = invoice.invoiceCurrency curAmount = invoice.invoiceAmount isCurTest = False invoice.invoiceAmount_str = curAmount_str Flow_1x4rtop Flow_06amgv2 Flow_18cic3h Flow_1pefcgv # CLear Contributor Name if contains number if svc_is_num_in_name: invoice["contributorName"] = None # Clear Invoice Anount if more than 2 decimals if svc_decimal_cnt > 2: invoice["invoiceAmount"] = None # Clear Invocie Due Date if before Today's Date if not(svc_is_due_date_after): invoice["dueDate"] = None Flow_1wfxajw Flow_1strwr5 Flow_0pwvb62 Flow_0pwvb62 Flow_0z8ory2 Flow_0z8ory2 Flow_1hebd4s invoice = {} # no numbers in contributor name validation if " Number in contributor name" in ValidationChoices: invoice["contributorName"] = "Harmee5 Singh" else: invoice["contributorName"] = "Harmeet Singh" # Invoice amount number of decimals validation if " Too many decimals in invoice amount" in ValidationChoices: if scenarioChoices == "Correct invoice amount": invoice["invoiceAmount"] = 10000.001 else: invoice["invoiceAmount"] = 10001.001 else: if scenarioChoices == "Correct invoice amount": invoice["invoiceAmount"] = 10000.00 else: invoice["invoiceAmount"] = 10001.00 # Due date validation if " Due date before today's date" in ValidationChoices: invoice["dueDate"] = "2021-12-12" else: invoice["dueDate"] = "2022-12-12" # Set remainder of form fields invoice["contributorId"] = 12 invoice["invoiceId"] = 1234 invoice["invoiceCurrency"] = "AUD" Flow_1hebd4s topica_one topica_one { "topica_one": "Invoice successfully submitted" }