Ansicht
Dokumentation

_ISUCSIN_000007 - Information for online rate calculator

_ISUCSIN_000007 - Information for online rate calculator

RFUMSV00 - Advance Return for Tax on Sales/Purchases   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

You can include the online rate calculator on your web page. Your customers can then enter their annual consumption in an online form and have the system evaulate their consumption. The system displays the rates of the utility company, and determines and displays the gross amounts to be paid based on the consumption and rates.

The rate calculator is composed of several JavaScript library files. You must integrate these files into your web site in order to use the calculator. You do this by specifying the path of the JavaScript library file in the src attribute of the HTML script tag.

In the file tarif_create_rates_customer.js, you maintain the rates. Each rate that you want the online rate calculator to use must first be generated. Depending on the rate type, this is done as follows:

  • Basic/standard rate
tarif = basic_rate("name of rate", "string for preselection (optional, default: "") ", "net basic price", "net energy price");
  • Best price rate
tarif = best_rate("name of rate", "string for preselection (optional, default: "")", subrate1, subrate2, ..., subrate10);
  • Zone rate
tarif = zone_rate("name of rate", "string for preselection (optional, default: "")", Subrate1, interval limit1, subrate2, interval limit2, ..., subrate10, interval limit10);
  • Block rate
tarif = block_rate("name of rate", "string for preselection (optional, default: "")", subrate1, interval limit1, subrate2, interval limit2, ..., subrate10, interval limit10);

Explanation of the individual terms:

  • tarif
You can use any term to describe the rate. It does not have to be the actual name of the rate.
  • subrate
The rate models best price, zone, and block rate are based on previously defined rates. The parentheses must only contain the variable name of the rate (without quotation marks)- not the rate name. You can have a maximum of ten subrates.
  • interval limit
The rate models zone and blocks rate both require interval limits. These specify the maximum consumption at which a rate can be valid. The zone rate uses interval limits to define consumption zones.
  • String for preselection
The number of rate that can be preselected is filtered before output. For each rate, the system defines a string containing information on the preselection.
In this release, the string contains the names of the distributors that you do not want the system to display. If you want to display more than one distributor, then use a comma to separate them (see above example for standard rate). If you choose one of these distributors then it does not appear in the display.

All the rates that you have generated and want to output, are enhanced in the general_array line. Do not execute any rates in this line that you have only generated to use as subrates.

Preselection/filter

You can adjust the preselection to meet your requirements by editing thefile tarif_preselection_customer.js. In the check_distlist() function, you can adjust processing to the distributor you have chosen. You do this by entering any special conditions for the distributor after the "for-loop".

Other parameter maintenance

In the tarif_create_rates.js file you can also maintain parameters. These include the electricity tax, value-added tax, and currency fields, as well as a number of field message texts. If you want to make changes to these parameters, you can find their entries in this file.

Adjusting the results table

To define the output table, edit the tarif_functions_table_customer.js table. You can use the Funktion print_table(cons, value3) function to adjust the table to correspond to standard values. For each default value, the system outputs the rate name, gross amount and monthly budget billing amounts.

Integrating the rate calculator in a HTML page

To use the rate calculator in an existing HTML web page, use the print_result(value1,value2) function im conjunction with am event handler on the HTML form, for example, by declaring a button. This links the event onclick() with the function print_result(value1,value2). The value of the text fields entered here (value1, if necessary value2 for a second text field) is copied as a transfer parameter.

If you want to integrate the preselection described above then enhance the parameter list to include value3. The system transfers the object to a HTML list.

Both the second consumption value and the preselection are optional.

The tarif_functions_customer.js file contains the declaration of the rate objects and their methods. Every rate type contains a calculate() method, which calcualtes the gross amount. These methods differ according to the rate type. All the calculate() methods of the rate objects are ultimately based on the calculate() method of the object basic_rate (see the above section on basic_rate). In this object, the basic functions used for calculating the gross amount are maintained. If you want to change the algorhythm of the gross amount calcualation, you can find the relevant forms in the calculate() method of the correponding rate objects.

  • Integratethe rate calculator in an HTML page
  • Integrate the rate calculator using the second consumption value and the preseletion.
  • Generate a standard rate
Classic1 = new basic_rate("ClassicTarif1","ABC,DEF","5.0","0.2858");
  • Generate a best value rate
PrivatPro1 = new basic_rate("PrivatPro1","","6.0","0.485");
PrivatPro2 = new basic_rate("PrivatPro2","","12.0","0.265");
PrivatPro3 = new basic_rate("PrivatPro3","","8.0","0.395");
PrivatBest = new best_rate("PrivatBest","",PrivatPro1,PrivatPro2,PrivatPro3);
Rates PrivatPro1-3 are previously defined subrates
  • Generate a zonal rate
Familysmall = new basic_rate("small Family","12.0","0.65");
Familymiddle = new basic_rate("middle Family","8.0","0.85");
Family = new zone_rate("Family",Familysmall,1000,Familymiddle,2000,border_max);
The rates Familysmall, Familymiddle are previously defined subrates
  • Generate a block rate
Classic1 = new basic_rate("ClassicTarif1","5.0","0.2858");
Classic2 = new basic_rate("ClassicTarif2","15.0","0.2358");
Classic = new block_rate("ClassicTarif",Classic1,2400,Classic2, border_max);
The rates Classic1, Classic2 are previously defined subrates
  • Generate in general_array
general_array=[Classic1,Classic2,Classic,Valuerate,Valuerate2000];






SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 8619 Date: 20240523 Time: 161331     sap01-206 ( 140 ms )