# Mincost

## Program ID

MetraPipeline.MTMinCostPlugin.1

## Description

Calculates the minimum charge for a session.

The algorithm for determining the minimum charge is:

if MinUOM == "USD", mincost = mincharge
else if MinUOM == "min.", mincost = (rate + rateintl) * mincharge

If the MinUOM property is "min.", then Mincost is (rate + rateintl) * mincharge. In this scenario, rate or rateintl could be 0. However, it is unlikely. The bottom line is that rate and ratintl are used as a component for calculating mincost.

The intended functionality is to provide either a flat minimum or one based on a rate multiplied by a minimum number of minutes.

## Required Input Properties

Tag name | Value type | Description
MinCharge | String | Determines how the minimum charge is calculated. Can be either "USD" or "min."
MinUOM | decimal | IF MinCharge is "USD", the minimum charge is MinUOM
Rate | decimal | Domestic Rate for minimum charge
RateIntl | decimal | International charge for minimum rate

## Required Output Properties

Tag name | Value type | Description
MinCost | decimal | The minimum charge

## Additional Configuration Tags

None.

## Configuration Example

<configdata>
<MinCharge>MinCharge</MinCharge>
<MinUOM>MinUOM</MinUOM>
<Rate>Rate</Rate>
<RateIntl>RateIntl</RateIntl>
<MinCost>MinCost</MinCost>
</configdata>

## Remarks

The plug-in does not determine if the minimum charge should be applied to the final amount for the session.

If MinCharge is neither "USD" or "min." MinCost will not be set in the session.