Scenario
The total unbilled amount which can be seen in the Amount field on the Vendor record is based on the items' total quantity multiplied by their respective amounts. Some use cases permits users to change the rate of each item on the Vendor Bill record which will sometime exceed the total Purchase Order amount set in the Purchase Order record.
Solution
The following code can be useful for approval processes if the user wants to flag vendor bills exceeding the total Purchase Order amount for approval. Run this code in the PageInit function of a Client Script deployed to the Vendor Bill record: