Please enable JavaScript to view this site.

CWT Software Configuration Handbook 4.40

Container        Path: <cwt><TARIFFPACKAGE><valueButtons>
Element        Path: <cwt><TARIFFPACKAGE><valueButtons><valueButton>

The tariff value button type is used in situations where there are only predefined steps to choose from for a tariff and extrapolation of values between steps are not allowed.

The button type needs two declarations to be functional. One part is in the tariff package and the second part is in the user interface. The values of the tariff buttons will be copied to the value of the user interface buttons  when an article with this type of tariff is selected for purchase.

There must be a valueButtons section with a valueButton for each step in the tariff. The tariff interval step must be a unit rate with values that match the value button. Linear or flat rates are not useful for this kind of set up.

If there are more buttons declared in the tariff than can be showed in the user interface, the button types Right and Left are used to scroll between sets of tariff buttons. The maxVisibleButtons property is then used as a threshold value for the Right button to be showed.

NOTE:
The value button only works in the PrePay_Code_Step_Panel1

See the CWT User Interface Design Handbook for an example and styles to use:
UiTariffValueButtonVisualStyle

valueButtons

attributes

maxVisibleButtons

Description:The maxVisibleButtons property must match the number of declared visible value buttons in the user interface. This number is used when copying values from the tariff’s value buttons to the user interface’s value button so if maxVisibleButtons=10, tariff step 1 to 10 is copied to the user interface value button ids 1 to 10.

Example:

<TARIFFPACKAGE name="Visitor" tariffPackageId="11">
  <ticket ticketType="PrePayCode" ticketId="2"/>
  <valueButtons maxVisibleButtons="10">
     <valueButton id="1" duration="10" amount="0" durationText="0h10" amountText="FREE"/>
     <valueButton id="2" duration="20" amount="0" durationText="0h20" amountText="FREE"/>
     <valueButton id="3" duration="30" amount="0" durationText="0h30" amountText="FREE"/>
     <valueButton id="4" duration="60" amount="100" durationText="1h00" amountText="1.00"/>
     <valueButton id="5" durat on="120" amount="200" durationText="2h00" amountText="2.00"/>
     <valueButton id="6" durat on="180" amount="300" durationText="3h00" amountText="3.00"/>
     <valueButton id="7" durat on="240" amount="500" durationText="4h00" amountText="5.00"/>
     <valueButton id="8" durat on="300" amount="700" durationText="5h00" amountText="7.00"/>
     <valueButton id="9" durat on="360" amount="900" durationText="6h00" amountText="9.00"/>
     <valueButton id="10" durat on="420" amount="1100" durationText="7h00" amountText="11.00"/>
     <valueButton id="11" durat on="600" amount="5000" durationText="10h00" amountText="50.00"/>
  </valueButtons>
  <tariff>
     PACKAGE "Visitor";
     max units = 1440;
     min ticks = 0;
     INTERVAL "Mon-Sat";
     timepredicate = "(($daytype=0)  and ($hour in [09 to 18[)) or (($daytype=1) and ($hour in[09 to 15[))";
        tariffrate = unit 0 per 10: tariffStep 1 duration 10;
        tariffrate = unit 0 per 10: tariffStep 2 duration 10;
        tariffrate = unit 0 per 10: tariffStep 3 duration 10;
        tariffrate = unit 100 per 30: tariffStep 4 duration 30;
        tariffrate = unit 100 per 60: tariffStep 5 duration 60;
        tariffrate = unit 100 per 60: tariffStep 6 duration 60;
        tariffrate = unit 200 per 60: tariffStep 7 duration 60;
        tariffrate = unit 200 per 60: tariffStep 8 duration 60;
        tariffrate = unit 200 per 60: tariffStep 9 duration 60;
        tariffrate = unit 200 per 60: tariffStep 10 duration 60;
        tariffrate = unit 3900 per 180: tariffStep 11 duration 180;
     INTERVAL "Free" : priority 0;
        tariffrate = flat 0 until end of interval;
  </tariff>
</TARIFFPACKAGE>