previous

Spanish Police Export Data Definition (ES_POLICE_EXPORT & ES_POLICE_EXPORT_DAY)

The Police Export for Spain (ES_POLICE_EXPORT and ES_POLICE_EXPORT_DAY) is required by Spanish law and is to be provided by all hotels on a daily basis. The export is available when the Exports>Country Exports application parameter is set to Y and the Country Mode = ES. The export contains guest information for all individual reservations that arrived on the date of the export, along with information for all their accompanying guests. Specifically, the following conditions determine which reservation/guest information is to be included in the export:

Functionality also exists to print a report from the selected data so that the information can be verified and corrected prior to creating the export and uploading it to the designated police website. (See Spain Police Report for details.)

Each export consists of the following record types, described in Export File Details, below:

The ES_POLICE_EXPORT export may be run automatically by the End of Day procedures. The ES_POLICE_EXPORT_DAY export can be run manually for any date up to and including the current business date by selecting the Miscellaneous>File Export>Country menu option or the Configuration>External>Country Export menu option.

spain_police_export_file_details.jpg

The OPERA Export Definition screen is to be used by the property to define the unique police code. The template will create an export definition record with code HOTELCODE for each of the two exports (ES_POLICE_EXPORT and ES_POLICE_EXPORT_DAY). The property will select the Export Definitions button from the Export File Details screen, select the HOTELCODE column and enter the correct police code to be used.

spain_police_export_hotelcode.jpg

Views Used by This Export

EXP_ACCOMPANYING_RESV_VIEW

Pre Export Procedure

The pre-export procedure populates a temp table with the export data and retrieves the next sequence number for file naming. The pre-export procedure is:

export_data_p.set_cached_num('EXP_SEQ_NO',opera_seq.get_nextCountryExportSeqNo('ES'))

Post Export Procedure

The post-export procedure exp_create_data.delete_report_table cleans up the data added to the temp table by the pre-export procedure.

File Name Format

The naming standard for this export will be a unique code specified by the police (10 bytes), followed by a dot (.), followed by a 3-digit sequence number. For example:

28391AAH01.001

Note: Regardless of whether the export is run automatically by End of Day processing (ES_POLICE_EXPORT) or manually (ES_POLICE_EXPORT_DAY), OPERA will assign a new 3-digit sequence number to every data generation of the export.

Sequence Number

The export sequence number will be generated using the OPERA sequence for EXPORT_1ES. This will generate a new sequence for every data generation of the export.

The sequence number will start with 001 and shall increase by 1 up to 999. At this point, the sequence numbering will start again with 001. The sequence number is navigable on export creation so that in the event the export fails and needs to be redone, the next available export number from the police website can be entered manually. If an export fails and must be redone, OPERA provides a utility for manually entering the proper sequence number (available only when the Country Mode = ES and the Exports>Country Exports application parameter is set to Y).

To access the utility, select Miscellaneous>File Export>Modify Sequence.

Note: This menu option is dependent on the user permission General>Change Export Sequence. The permission will only be visible when application parameter Exports>Country Exports application parameter is set to Y and the Country Mode = ES.

On selecting this menu option, the user is presented with a screen that displays the last sequence number for the OPERA sequence EXPORT_1ES.

spain_police_export_modify_sequence.jpg

Enter a new sequence and select Save. Upon update, the SEQ_VALUE in the CONTROL_SEQ_INFO table will be changed to the value set by the user. This value will be the sequence number that is applied to the next export.

Note: Any exports using the EXPORT_1ES sequence will be affected by this change.

File Extension

'TXT'

File Format

The export is in ASCII format, 8 bits per character. No file compression is used.

Field Format

Alphabetic values are in full caps. Trailing spaces are removed.

Record fields are pipe-delimited (|). Empty fields will continue to be pipe-delimited. The record's last field will end with the pipe. Records are separated by a carriage return and a line break (0D0A character), except for the last line of the export.

Note: Hyphenated surnames are separated by a single blank space, with no special characters.

Parameter Form

The EXP_FOR_DATE parameter form is used to specify the past date for which the manual export will be generated.

Export File Details

Record Type 1 - Hotel Establishment and Control Information

Description

Length

Type

Observations

OPERA Field

Content

Record type

1

N

It shall have a value of 1.

 

 

Hotel establishment code

10

A

Assigned by the Spanish National Police.

Export Definition Code 'HOTELCODE'

Resort Code

Establishment name

40

A

In all capital letters.

RESORT_NAME

Hotel Name

File creation date

8

N

In YYYYMMDD format.

System date of export generation

 

File creation time

4

N

In HHMM format.

Time of export generation

 

Number of type 2 records contained in the file.

5

N

For hotel groups, it refers to the total type 2 records transmitted by each associated hotel.

Total number of type 2 records in the file (i.e., the number of persons included in the export.)

 

Type 2 - Guest Information

Description

Length

Type

Observations

OPERA Field

Content

Record Type

1

N

It shall have a value of 2.

 

 

Spanish National ID Number

11

A

It shall be completed for Spanish citizens. The following are admitted: Spanish National ID Card, passport,, and driver's license.

ID_NUMBER

Filter: ID_TYPE='D'

Passport number or number of a different foreign ID

14

A

It shall be completed for foreigners. The following are admitted:

Foreign passport.

National identity card or document (for citizens of the European Union, Andorra, Iceland, Switzerland, Norway, Malta, Monaco and San Marino).

Spanish residence permit in force for foreigners residing in Spain.

Residence permit issued by another European Union Member State.

 

Filter: ID_TYPE<>D'

ID Type

1

A

It shall be:

D for DNI (National ID).

P for Passport.

C for Driver's License.

I for national identity card or Document.

N for Spanish residence permit.

X for residence permit for another European Union Member State.

ID_TYPE

‘D’ – DN

‘P’-Passport

‘C’- Drivers Lic

‘I’- ID Document(not DNI)

‘N’- Spanish Permission of residence

‘X’- EU Permission of residence

ID date of issue

8

N

In YYYYMMDD format.

ID_DATE

ID DATE of the ID Number, Format YYYMMDD

Paternal surname

30

A

They shall be written as they appear
on the ID card, in capital letters.

GUEST_NAME

Guest Last Name, spaces have to be taken out in the export

Maternal surname

30

A

They shall be written as they appear
on the ID card, in capital letters.

 

This field is left blank as it is a place holder for a second lastname

Name

30

A

They shall be written as they appear
on the ID card, in capital letters.

GUEST_FIRST_NAME

Guest First Name, Capital Letters

Sex

1

A

It shall be:

F for female.

M for male.

GENDER

Guest Gender

Date of birth

8

N

In YYYYMMDD format.

At least the date of birth shall be compulsory. The month and day, if unknown, shall be written as 0000.

BIRTH_DATE

Date of Birth of Guest, Format YYYYMMDD

Country of citizenship

21

 

A

Name of country of citizenship in ALL CAPITAL LETTERS.

NATIONALITY

Nationality Description of the Guest in CAPITAL Letters

Entry date

8

 

N

In YYYYMMDD format.

ARRIVAL

Arrival Date, Format YYYYMMDD

Assumptions and Limitations

These exports are based on the following assumptions and limitations.

1. The Birth date field on the Profile will be completed for all guests, including Accompanying guests. If the Birth Date field is null, the current date is assumed and the guest record will not appear in the export.

2. Only alphanumeric values will be sent in the export. All alpha values will be in upper case. If a non-alpha character appears in a name (e.g., a hyphen) it will be replaced by a blank space.

3. The maximum value for each field length is as specified in the Export File Details. Data cannot be more than the maximum specified. Trailing spaces are removed.

See Also