If you prefer watching videos over reading blogs, here is a video tutorial about creating this BOT script from our ERPAG ACADEMY YouTube channel: https://youtu.be/MpteglmF1PM

Creating a Recurring Utility Bill Process

This document outlines the process for setting up a recurring utility bill using bot scripts. It involves creating custom fields, configuring utility bill items, adding suppliers, and setting up automation scripts to facilitate the process efficiently. Follow the steps below to successfully complete the setup.

Step 1

Initiate the process by creating two new custom fields under the Utility Bill category.

erpag home page

Step 2

Select the Utility Bill category and proceed to create the new custom fields in this section.

custom fields

Step 3

Create a field named “Recurring Bill Master.” Set its type to List, with options “No” and “MTS” to serve as the template for the Utility Bill. Set the default value to “No” and ensure the status is set to Active.

custom fields

Step 4

Add another field named “Recurring Bill Clone.” This should also be a List with the same options.

custom fields options list

Step 5

Ensure the default value is “No” and the status is set to Read Only. Save the changes, then navigate to the Inventory and Products section to create two items.

add new bill item

Step 6

Under the Bill Item category, create the first item named “Monthly Subscription Fee.”

add new bill item

Step 7

In the Expense Account section, select “Utilities.” Create another Bill Item with a similar setup.

add new bill item

Step 8

Name the second item “Monthly Phone Payment.” Assign it to the “Utilities” category for uniformity in this demonstration.

add new bill item

Step 9

Save your progress.

product list

Step 10

Proceed to the Suppliers section, add a new supplier named “MTS,” and assign them the items “Monthly Phone Payment” and “Monthly Subscription Fee” that you just created.

create new supplier

Step 11

Set the price for “Monthly Phone Payment” to thirty and for “Monthly Subscription Fee” to fifty. Save these details.

create new supplier

Step 12

Navigate to the Purchasing Utility Bills section to create a Master Utility Bill.

create new utility bill

Step 13

Select the Supplier “MTS” and input the rates.

create new utility bill

Step 14

Set rates for “Monthly Phone Payment” as four and “Monthly Subscription Fee” as three. In the Custom Fields section, select the template for the “Recurring Bill Master” field. This field is read-only.

create new utility bill

Step 15

Save your progress. Verify the Supplier details, rates, and ensure “Recurring Bill Master” is set to “No” while “Recurring Bill Clone” is set to “MTS.”

create new utility bill

Step 16

Create a bot script under the Automation, Customization section. Name it “Recurring Bill MTS.”

create bot script

Step 17

Save the bot script. Initialize the first variable under the name “Utility Bill Template Name.”

create variable

Step 18

This variable will store the selected template names. Before proceeding, import the Utility Bills database and select “Recurring Bill Master” from Utility Bills.

bot script

Step 19

This is our custom field, and select the “MTS” template. Subsequently, create a variable named “Master Utility Bill ID” in your bot script.

create variable

Step 20

Utilize this variable to find the first Utility Bill according to the specified criteria.

bot script

Step 21

Continue to refine the criterion.

bot script

Step 22

Complete the setup.

bot script

Step 23

Ensure the “Recurring Bill Master” Custom Field matches the “Utility Bill Template Name” variable, finalizing the setup of the bot script.

bot script

Master Utility Bill Process

This document outlines the process of handling a master utility bill. It covers steps from checking the master utility bill ID to creating necessary date variables for the utility bill. Each step is designed to ensure accurate processing and tracking of the utility bill lifecycle.

Step 1

Verify whether the master utility bill ID is present in your bot script.

bot script

Step 2

Log the master utility bill ID for record-keeping.

bot script

Step 3

Once the master utility bill ID is confirmed, create a conditional block to verify its existence.

bot script

Step 4

If the master utility bill ID is not empty, proceed with execution of the bot script. Otherwise, a message indicating the absence of the master bill will be sent. Within this conditional block, prepare the necessary variables.

bot script

Step 5

Begin by setting the specified dates. Create a variable for the creation date, which captures the date on which the master utility bill was initially generated.

bot script

Step 6

Determine the creation date by selecting the corresponding date entry.

bot script

Step 7

Locate the master utility bill ID.

bot script

Step 8

Identify the last day of the month in which the master utility bill was created.

bot script

Step 9

Define a variable for the month-end date of the creation date.

bot script

Step 10

To achieve this, extract the year and month from the creation date. Then, add one month to the creation date.

bot script

Step 11

Add one month to the creation date to identify the month start date. The next variable required is the beginning of the month.

bot script

Step 12

Similarly, create a variable for the month-end date by applying the same principle used for determining the last day of the month at creation.

bot script

Step 13

Adjust the month start variable by adding one month and subtracting one day. Create a variable for the clone utility bill ID.

create new variable

Step 14

Locate the clone utility bill ID similarly to the master, with the difference being that it should not be a recurring bill master, but a recurring bill clone.

bot script

Step 15

Ensure the template name remains consistent and incorporate a condition that the creation date falls between the month start and month end.

bot script

Creating and Managing Utility Bills by using BOT script

This document provides a step-by-step process for creating and managing utility bills through conditional checks and data manipulation. The process involves verifying certain conditions, creating new utility bills, and transferring data from a master utility bill to a newly created one. Each step is crucial to ensure the accuracy and efficiency of the bill management process.

Step 1

Begin by creating an additional conditional block.

bot script

Step 2

Check the following conditions: use the ‘and’ logical operator to verify if both the month and the creation date are earlier than the current date.

bot script

Step 3

Additionally, confirm the existence of a clone ID or utility bill ID.

bot script

Step 4

If both conditions are satisfied, proceed to create a new utility bill. Initialize variables to store data from the master utility bill.

bot script

Step 5

Generate a variable description list by utilizing the block list of descriptions from items, ensuring the Utility Bill ID matches the Master ID.

bot script

Step 6

Next, establish the SKU list.

bot script

Step 7

Follow the same approach as the previous step.

bot script

Step 8

Subsequently, set up the Quantity List.

bot script

Step 9

And then, configure the Price List.

bot script

Step 10

Determine the Purchase Price.

bot script

Step 11

Once all data is organized, initiate the creation of a new Utility Bill document.

bot script

Step 12

Configure several parameters, beginning with locating the mandatory key linked to the supplier. Identify the initial key associated with the supplier, specifically the key supplier.

bot script

Step 13

Ensure there is an ID for the Master Bill ID or Master Utility Bill ID.

bot script

Step 14

Additionally, set up another custom field form.

bot script

Step 15

Designate the bill clone with the same name as the master. Proceed to input data into the rows of the newly created Utility Bill.

bot script

Step 16

Utilize the count block within this Utility Bill context.

bot script

Step 17

Iterate with a counter variable starting from one to the length of the lists created. Use the Length Of block to select the SKU list.

bot script

Step 18

Finally, employ the Add Row Items block to incorporate individual items into the list.

bot script

Creating and Managing Utility Bills

This document provides detailed instructions on how to save, validate, and manage utility bills using specific programming blocks. It explains the process of handling errors, sending confirmation messages, and managing duplicate entries in an efficient manner.

Step 1

Initiate the process by saving the newly created utility bill. This action will be conducted using a save block. Additionally, implement an if block to verify the presence of any errors.

bot script

Step 2

Execute the saving process using a designated save block.

bot script

Step 3

Upon successful completion, dispatch a notification confirming the creation of a new utility bill.

bot script

Step 4

Continue utilizing the save block for the operation.

bot script

Step 5

Upon success, send a confirmation message for the new utility bill creation. Within the conditional block that checks parameters, include an else clause to notify if an existing utility bill is detected for that month.

bot script

Step 6

Upon successful verification, transmit a confirmation message for the utility bill creation. Repeat this step for consistency. Attempt saving and executing the script to finalize.

bot script

Step 7

Receive a notification indicating the utility bill’s creation, acknowledging the existence of a master bill for the current month. Adjust the creation date to reflect the previous month’s data.

bot script

Step 8

Confirm the notification of the utility bill creation. Navigate to the Bills section to verify the creation of a new utility bill and select an additional field as needed.

add more columns

Step 9

Observe that the first entry is marked as a master, and the subsequent one is a clone. Verify the supplier information for both. Note that the custom field ‘master’ is marked as no, while the clone custom field is labeled as mts.

utility bill

Automating Utility Bill Template Creation

This document outlines the process of automating the creation of a utility bill template using a script. It describes how to schedule the script execution and assign user permissions to ensure the task runs smoothly on the specified schedule.

Step 1

Execute the script. You should receive a message indicating that the utility bill template has already been created, and no new build will be generated.

utility bill

Step 2

Set all required parameters in both scripts. Proceed to schedule the script execution by saving, running the script, and clicking the ‘Schedule Execution’ button.

blockly message

Step 3

You will be prompted to assign a user who can execute these scripts. Navigate to Administration, select Users, and then click on ‘Add New API’. Enter the name ‘Test Api2’ and save the changes.

add new API user

Step 4

Return to the script’s scheduling section. Here, select the time and days for the script execution, ensuring all days are selected.

schedule execution

Step 5

Assign the user ‘Test Api’ for the scheduled execution. The script will execute daily at seven o’clock.

bot script

Step 6

The utility bill will only be created when the specified conditions are met. This concludes the process.

bot script

Read More

Related Posts

💬 Start Chat