An example is provided in the documentation of the function Early discount/late charge. It describes the rule applied to determine the rate used according to the variance between the expected and actual payment dates corresponding to the open item.