CARPRIFLD: Add specific/custom fields in the carrier price list grid

In the carrier management, the prices tab is used to enter the price list grid for each region. This price list grid is composed of two fields "Fixed amount" and "+ by class".

This entry point located in the SUBBPT process is used to add a custom/specific field in this grid that will be entered in the BPT3 mask and stored in the CARPRICE table.

Context and operating method

Transaction

During the unfolding of the CREATION action, there is a transaction in process. The GOK variable is used and tested. It is equal to 1. It can be set to 0 if the transaction should be abandoned.

Log file

There is no open log file.

Different call cases

This entry point must be called from two contexts:

- in the LIENS action, during the loading of the BPT3 mask from the CARPRICE table

- in the CREATION action, to write to the CARPRICE table from the BPT3 mask

The PE_CARPRIFLD variable is used to identify the origin of the entry point call.

If PE_CARPRIFLD="LECTAR" , the origin is LIENS

If PE_CARPRIFLD="CRETAR" , the origin is CREATION

It is imperative that these variable values are not modified: RGARE, I, J

The management of the BPT3 mask is specific because of the hidden storage of the region's complete price grid(in the right-hand grid) in the region line (left-hand grid).

The activity codes having an influence are the following:

-        BPW : number of weight ranges in the price grids (50 maximum)

-        BPY : number of regions by carrier (100 maximum)

Entry and storage of the BPT3 mask :

For a region, each price list line is entered in the TARPRI and TARADL (NBTAR grid) variables and is stored in the PRI1 to PRI51 and ADL1 to ADL51 (NBARE grid) variable as a function of the entry grid line number.

For instance: for line 20 of the price list grid

           TARPRI(19) is stored in PRI20 (hidden field in the NBARE regions grid)

           TARADL(19) is stored in ADL20 (hidden field in the NBARE regions grid)

Structure of the CARPRICE table

Each record in the table contains a price list line for a region.

The key is composed of:

Carrier (BPTNUM) + Region (BPTARE) + Rank (RANG: line number in entry table)

As an aid to clarity, it is advisable to manage this new field in exactly the same way as the two standard fields.

Example of the addition of a new field :

Take the decimal field AAA added to the CARPRICE table.

It is necessary to create the TARAAA field in the NBTAR grid and the AAA1 to AAA51 hidden fields in the NBARE grid.

NB : In a mask, the number of field references is limited to 500. Each new field defined leads to the creation of 52 references in the mask. It is necessary in this case to limit the number of price list lines (for example BPW=30) and to only create AAA1 to AAA31 etc …

In the entry point:

$ACTION

ACTION example

  When "CARPRIFLD"      : Gosub CARPRIFLD

Endcase

Return

 

$CARPRIFLD

If PE_CARPRIFLD="LECTAR"

 If evalue("dim([M:BPT3]AAA"+num$([F:CAP]RANG+")")>0 

  Assign "[M:BPT3]AAA"+num$([F:CAP]RANG)+"("+num$(RGARE-1)+")" With [F:CAP]AAA

Endif

Endif

If PE_CARPRIFLD="CRETAR"

 [F:CAP]AAA = evalue ("[M:BPT3]AAA"+num$(J+1)+"("+num$(I)+")") 

Endif

Return

Available variables and masks

The list of variables and their meaning, list of open mask classes, elements that can be modified... A table of this type can be provided:

 

Variable or mask

Definition

BPT0 [BPT0]

Carriers

BPRBPT [BPRT]

Identities

BPABPT [BPAT]

Addresses

BPT1 [BPT1]

Management

BPT2 [BPT2]

Regions

BPT3 [BPT3]

Price lists

BIDBPT [BIDT]

Bank ID(s)

CNTBPT [CNTT]

Contacts

 

 

 

Do not modify the variable values

Char PE_CARPRIFLD

Entry point call origin

Integer RGARE

Index

Integer I

Index

Integer J

Index