Calendar-based Service Ratios


Originally from


The Services Ratio support introduced in OpenVPMS 1.8 allows product types to be assigned a service ratio per Practice Location. This ratio is used to calculate a new product price from its existing price, when it is used in a charge or estimate.

This facility is designed to enable different Locations (such as those used for over-night emergency or house-call operations) to charge more for products of certain types.

It will be extended to associate a calendar with the Service Ratio, to determine the dates and times that the ratio applies.
Note that the ratio is fixed; the calendar will only determine if the service ratio applies or not. It cannot be used to set a different service ratio at different times.

It will remove the need for supporting different charges via:

  • a separate practice location to handle out-of-hours or weekend services

  • different products for the same service

  • different fixed prices


1. Out of hours surgery

To charge surgery services at 150% outside of 7am and 7pm, and on weekends, at Clinic A:

  • add a Service Ratio of 1.5 between the surgery Product Type(s) and Clinic A

  • attach a calendar with the following repeating slots:

    • Start Time: 00:00, End Time: 07:00, Repeats: Daily, 365 times

    • Start Time: 19:00, End Time: 00:00, Repeats: Daily, 365 times

    • Start Time: 00:00, End Time: 00:00, Repeats: Every Saturday and Sunday, 52 times

2. Regular promotions

Promotions are typically handled via product discounts, but if you wish to promote a product or service on a particular day or time, a service ratio might be simpler.

E.g. to charge grooming services at 50% on Wednesdays between 10am and 2pm in August at Clinic A:

  • add a Service Ratio of 0.5 between the grooming Product Type(s) and Clinic A

  • attach a calendar with the following repeating slots:

    • Start Time: 02/08/17 10:00, End Time: 02/08/17 14:00, Repeats: Every Wednesday, until 01/09/17

Estimates and Charges

Calendar-based service ratios will apply to individual line items in both estimates and charges, and will be applied at the creation time of the estimate or charge item.

If a product attracts a 150% charge after 7pm, charging it at 3pm will attact the normal price, whereas charging it at 9pm will attract the higher price. An invoice can therefore have two line items for the same product, at different prices.

Apply Service Ratio

To allow users to control if a ratio should be applied, an Apply Service Ratio flag will be displayed for estimate and charge items. This will:

  • be selected, if a ratio has been applied

  • revert to the normal price if deselected

  • be disabled if there is no service ratio

The Apply Service Ratio flag will only be displayed at locations that have service ratios configured.

Invoicing Estimates

When invoicing estimates, the invoice inherits the prices from the estimate.

If an estimate contains items where the service ratios are different between when the item was created and the current time, a confirmation will be displayed:

Selecting 'Charge items at the estimate price' is the default, and will invoice items as per existing behaviour.

Selecting 'Charge items at the current price' will determine the prices based on the current time.

Once invoiced, the Apply Service Ratio flag on each line item can also be toggled to further customise how a product is charged.



Service Ratio Calendars will be configured in Administration - Types.

The Calendar will display dates as columns, and times as rows. 24 hours will be displayed in 30 minute slots.

A Block button will be provided to create a new block indicating when the service ratio applies. It will have the same options as blocks in Workflow - Scheduling.

Service Ratios

Service ratios will still be configured via the Practice Location. However they will feature an option to select the appropriate Service Ratio Calendar by name.



There is no requirement to restrict which users can toggle the Apply Service Ratio flag.


There is no requirement to indicate that an estimate or charge is subject to a service ratio i.e. this does not need to be displayed in printed estimates or invoices.




Tim Anderson


Tim Anderson




Fix versions