File Coverage

blib/lib/CBI/Wrapper/RecordMapping.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             ##############################################################################
2             #
3             # Copyright (C) 2012 Agile Business Group sagl ()
4             # Copyright (C) 2012 Domsense srl ()
5             # Copyright (C) 2012 Associazione OpenERP Italia
6             # ().
7             # Copyright (C) 2022 Res Binaria Di Paolo Capaldo ()
8             # All Rights Reserved
9             #
10             # This program is free software: you can redistribute it and/or modify
11             # it under the terms of the GNU Affero General Public License as published
12             # by the Free Software Foundation, either version 3 of the License, or
13             # (at your option) any later version.
14             #
15             # This program is distributed in the hope that it will be useful,
16             # but WITHOUT ANY WARRANTY; without even the implied warranty of
17             # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18             # GNU Affero General Public License for more details.
19             #
20             # You should have received a copy of the GNU Affero General Public License
21             # along with this program. If not, see .
22             #
23             ##############################################################################
24              
25             package CBI::Wrapper::RecordMapping;
26              
27 1     1   6 use strict;
  1         1  
  1         25  
28 1     1   3 use warnings;
  1         2  
  1         2385  
29              
30             # Cfg file.
31              
32             our $FLOW_TYPE = 'OUTPUT_RECORD_MAPPING'; # default value
33              
34             # Header 'IB'
35             my $IB = [
36             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
37             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
38             {from => 4, to => 8, name => 'mittente', type => 'an', truncate => 'no'},
39             {from => 9, to => 13, name => 'ricevente', type => 'n', truncate => 'no'},
40             {from => 14, to => 19, name => 'data_creazione', type => 'n', truncate => 'no'},
41             {from => 20, to => 39, name => 'nome_supporto', type => 'an', truncate => 'no'},
42             {from => 40, to => 45, name => 'campo_a_disposizione', type => 'an', truncate => 'no'},
43             {from => 46, to => 104, name => 'filler2', type => 'an', truncate => 'no'},
44             {from => 105, to => 105, name => 'tipo_flusso', type => 'an', truncate => 'no'},
45             {from => 106, to => 106, name => 'qualificatore_flusso', type => 'an', truncate => 'no'},
46             {from => 107, to => 111, name => 'soggetto_veicolatore', type => 'n', truncate => 'no'},
47             {from => 112, to => 113, name => 'filler3', type => 'an', truncate => 'no'},
48             {from => 114, to => 114, name => 'codice_divisa', type => 'an', truncate => 'no'},
49             {from => 115, to => 115, name => 'filler4', type => 'an', truncate => 'no'},
50             {from => 116, to => 120, name => 'campo_non_disponibile', type => 'an', truncate => 'no'},
51             ];
52              
53              
54             # Header 'IM'
55             my $IM = [
56             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
57             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
58             {from => 4, to => 8, name => 'mittente', type => 'an', truncate => 'no'},
59             {from => 9, to => 13, name => 'ricevente', type => 'an', truncate => 'no'},
60             {from => 14, to => 19, name => 'data_creazione', type => 'an', truncate => 'no'},
61             {from => 20, to => 39, name => 'nome_supporto', type => 'an', truncate => 'no'},
62             {from => 40, to => 45, name => 'campo_a_disposizione', type => 'an', truncate => 'no'},
63             {from => 46, to => 104, name => 'filler2', type => 'an', truncate => 'no'},
64             {from => 105, to => 105, name => 'tipo_flusso', type => 'an', truncate => 'no'},
65             {from => 106, to => 106, name => 'qualificatore_flusso', type => 'an', truncate => 'no'},
66             {from => 107, to => 111, name => 'soggetto_veicolatore', type => 'an', truncate => 'no'},
67             {from => 112, to => 113, name => 'filler3', type => 'an', truncate => 'no'},
68             {from => 114, to => 114, name => 'codice_divisa', type => 'an', truncate => 'no'},
69             {from => 115, to => 115, name => 'filler4', type => 'an', truncate => 'no'},
70             {from => 116, to => 120, name => 'campo_non_disponibile', type => 'an', truncate => 'no'},
71             ];
72              
73             # Header 'PC'
74             my $PC = [
75             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
76             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
77             {from => 4, to => 8, name => 'mittente', type => 'an', truncate => 'no'},
78             {from => 9, to => 13, name => 'ricevente', type => 'an', truncate => 'no'},
79             {from => 14, to => 19, name => 'data_creazione', type => 'an', truncate => 'no'},
80             {from => 20, to => 39, name => 'nome_supporto', type => 'an', truncate => 'no'},
81             {from => 40, to => 45, name => 'campo_a_disposizione', type => 'an', truncate => 'no'},
82             {from => 46, to => 104, name => 'filler2', type => 'an', truncate => 'no'},
83             {from => 105, to => 105, name => 'tipo_flusso', type => 'an', truncate => 'no'},
84             {from => 106, to => 106, name => 'qualificatore_flusso', type => 'an', truncate => 'no'},
85             {from => 107, to => 111, name => 'soggetto_veicolatore', type => 'an', truncate => 'no'},
86             {from => 112, to => 112, name => 'filler3', type => 'an', truncate => 'no'},
87             {from => 113, to => 113, name => 'flag_priorita_trattamento_bonifico', type => 'an', truncate => 'no'},
88             {from => 114, to => 114, name => 'codice_divisa', type => 'an', truncate => 'no'},
89             {from => 115, to => 115, name => 'filler4', type => 'an', truncate => 'no'},
90             {from => 116, to => 120, name => 'campo_non_disponibile', type => 'an', truncate => 'no'},
91             ];
92              
93             # Header 'PE'
94             my $PE = [
95             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
96             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
97             {from => 4, to => 8, name => 'mittente', type => 'an', truncate => 'no'},
98             {from => 9, to => 13, name => 'ricevente', type => 'an', truncate => 'no'},
99             {from => 14, to => 19, name => 'data_creazione', type => 'an', truncate => 'no'},
100             {from => 20, to => 39, name => 'nome_supporto', type => 'an', truncate => 'no'},
101             {from => 40, to => 45, name => 'campo_a_disposizione', type => 'an', truncate => 'no'},
102             {from => 46, to => 104, name => 'filler2', type => 'an', truncate => 'no'},
103             {from => 105, to => 105, name => 'tipo_flusso', type => 'an', truncate => 'no'},
104             {from => 106, to => 106, name => 'qualificatore_flusso', type => 'an', truncate => 'no'},
105             {from => 107, to => 111, name => 'soggetto_veicolatore', type => 'an', truncate => 'no'},
106             {from => 112, to => 115, name => 'filler3', type => 'an', truncate => 'no'},
107             {from => 116, to => 120, name => 'campo_non_disponibile', type => 'an', truncate => 'no'},
108             ];
109              
110             # Footer 'EF'
111             my $EF = [
112             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
113             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
114             {from => 4, to => 8, name => 'mittente', type => 'an', truncate => 'no'},
115             {from => 9, to => 13, name => 'ricevente', type => 'n', truncate => 'no'},
116             {from => 14, to => 19, name => 'data_creazione', type => 'n', truncate => 'no'},
117             {from => 20, to => 39, name => 'nome_supporto', type => 'an', truncate => 'no'},
118             {from => 40, to => 45, name => 'campo_a_disposizione', type => 'an', truncate => 'no'},
119             {from => 46, to => 52, name => 'numero_disposizioni', type => 'n', truncate => 'no'},
120             {from => 53, to => 67, name => 'tot_importi_negativi', type => 'n', truncate => 'no'},
121             {from => 68, to => 82, name => 'tot_importi_positivi', type => 'n', truncate => 'no'},
122             {from => 83, to => 89, name => 'numero_record', type => 'n', truncate => 'no'},
123             {from => 90, to => 113, name => 'filler2', type => 'an', truncate => 'no'},
124             {from => 114, to => 114, name => 'codice_divisa', type => 'an', truncate => 'no'},
125             {from => 115, to => 120, name => 'campo_non_disponibile', type => 'an', truncate => 'no'},
126             ];
127              
128             # Footer 'EF' - bonifici
129             my $EF_BON = [
130             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
131             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
132             {from => 4, to => 8, name => 'mittente', type => 'an', truncate => 'no'},
133             {from => 9, to => 13, name => 'ricevente', type => 'an', truncate => 'no'},
134             {from => 14, to => 19, name => 'data_creazione', type => 'an', truncate => 'no'},
135             {from => 20, to => 39, name => 'nome_supporto', type => 'an', truncate => 'no'},
136             {from => 40, to => 45, name => 'campo_a_disposizione', type => 'an', truncate => 'no'},
137             {from => 46, to => 52, name => 'numero_disposizioni', type => 'an', truncate => 'no'},
138             {from => 53, to => 67, name => 'tot_importi_negativi', type => 'an', truncate => 'no'},
139             {from => 68, to => 82, name => 'tot_importi_positivi', type => 'an', truncate => 'no'},
140             {from => 83, to => 89, name => 'numero_record', type => 'an', truncate => 'no'},
141             {from => 90, to => 112, name => 'filler2', type => 'an', truncate => 'no'},
142             {from => 113, to => 113, name => 'flag_priorita_trattamento_bonifico', type => 'an', truncate => 'no'},
143             {from => 114, to => 114, name => 'codice_divisa', type => 'an', truncate => 'no'},
144             {from => 115, to => 120, name => 'campo_non_disponibile', type => 'an', truncate => 'no'},
145             ];
146              
147             # Footer 'EF' - bonifici esteri
148             my $EF_BON_ES = [
149             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
150             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
151             {from => 4, to => 8, name => 'mittente', type => 'an', truncate => 'no'},
152             {from => 9, to => 13, name => 'ricevente', type => 'an', truncate => 'no'},
153             {from => 14, to => 19, name => 'data_creazione', type => 'an', truncate => 'no'},
154             {from => 20, to => 39, name => 'nome_supporto', type => 'an', truncate => 'no'},
155             {from => 40, to => 45, name => 'campo_a_disposizione', type => 'an', truncate => 'no'},
156             {from => 46, to => 52, name => 'numero_disposizioni', type => 'an', truncate => 'no'},
157             {from => 53, to => 64, name => 'filler2', type => 'an', truncate => 'no'},
158             {from => 65, to => 82, name => 'totale_importi', type => 'an', truncate => 'no'},
159             {from => 83, to => 89, name => 'numero_record', type => 'an', truncate => 'no'},
160             {from => 90, to => 114, name => 'filler3', type => 'an', truncate => 'no'},
161             {from => 115, to => 120, name => 'campo_non_disponibile', type => 'an', truncate => 'no'},
162             ];
163              
164             # Record “10”
165             my $X = [
166             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
167             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
168             {from => 4, to => 10, name => 'numero_progressivo', type => 'an', truncate => 'no'},
169             {from => 11, to => 16, name => 'filler2', type => 'an', truncate => 'no'},
170             {from => 17, to => 22, name => 'data_esecuzione_disposizione', type => 'an', truncate => 'no'},
171             {from => 23, to => 28, name => 'data_valuta_banca_beneficiario', type => 'an', truncate => 'no'},
172             {from => 29, to => 33, name => 'causale', type => 'an', truncate => 'no'},
173             {from => 34, to => 46, name => 'importo', type => 'an', truncate => 'no'},
174             {from => 47, to => 47, name => 'segno', type => 'an', truncate => 'no'},
175             {from => 48, to => 52, name => 'codice_abi_banca_ordinante', type => 'an', truncate => 'no'},
176             {from => 53, to => 57, name => 'codice_cab_banca_ordinante', type => 'an', truncate => 'no'},
177             {from => 58, to => 69, name => 'conto_ordinante', type => 'an', truncate => 'no'},
178             {from => 70, to => 74, name => 'codice_abi_banca_destinataria', type => 'an', truncate => 'no'},
179             {from => 75, to => 79, name => 'codice_cab_banca_destinataria', type => 'an', truncate => 'no'},
180             {from => 80, to => 91, name => 'conto_destinatario', type => 'an', truncate => 'no'},
181             {from => 92, to => 96, name => 'codice_azienda', type => 'an', truncate => 'no'},
182             {from => 97, to => 97, name => 'tipo_codice', type => 'an', truncate => 'no'},
183             {from => 98, to => 113, name => 'codice_cliente_beneficiario', type => 'an', truncate => 'no'},
184             {from => 114, to => 114, name => 'modalita_di_pagamento', type => 'an', truncate => 'no'},
185             {from => 115, to => 118, name => 'filler4', type => 'an', truncate => 'no'},
186             {from => 119, to => 119, name => 'flag_priorita_trattamento_bonifico', type => 'an', truncate => 'no'},
187             {from => 120, to => 120, name => 'codice_divisa', type => 'an', truncate => 'no'},
188             ];
189              
190             # Record “14”
191             my $XIV = [
192             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
193             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
194             {from => 4, to => 10, name => 'numero_progressivo', type => 'n', truncate => 'no'},
195             {from => 11, to => 22, name => 'filler2', type => 'an', truncate => 'no'},
196             {from => 23, to => 28, name => 'data_pagamento', type => 'n', truncate => 'no'},
197             {from => 29, to => 33, name => 'causale', type => 'n', truncate => 'no'},
198             {from => 34, to => 46, name => 'importo', type => 'n', truncate => 'no'},
199             {from => 47, to => 47, name => 'segno', type => 'an', truncate => 'no'},
200             {from => 48, to => 52, name => 'codice_abi_banca_assuntrice', type => 'n', truncate => 'no'},
201             {from => 53, to => 57, name => 'cab_banca_assuntrice', type => 'n', truncate => 'no'},
202             {from => 58, to => 69, name => 'conto', type => 'an', truncate => 'no'},
203             {from => 70, to => 74, name => 'codice_abi_banca_domiciliataria', type => 'n', truncate => 'no'},
204             {from => 75, to => 79, name => 'cab_banca_domiciliataria', type => 'n', truncate => 'no'},
205             {from => 80, to => 91, name => 'filler3', type => 'an', truncate => 'no'},
206             {from => 92, to => 96, name => 'codice_azienda', type => 'an', truncate => 'no'},
207             {from => 97, to => 97, name => 'tipo_codice', type => 'n', truncate => 'no'},
208             {from => 98, to => 113, name => 'codice_cliente_debitore', type => 'an', truncate => 'no'},
209             {from => 114, to => 114, name => 'flag_tipo_debitore', type => 'an', truncate => 'no'},
210             {from => 115, to => 119, name => 'filler4', type => 'an', truncate => 'no'},
211             {from => 120, to => 120, name => 'codice_divisa', type => 'an', truncate => 'no'},
212             ];
213              
214             # Record 16 [coordinate ordinante]
215             my $XVI = [
216             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
217             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
218             {from => 4, to => 10, name => 'numero_progressivo', type => 'an', truncate => 'no'},
219             {from => 11, to => 12, name => 'codice_paese', type => 'an', truncate => 'no'},
220             {from => 13, to => 14, name => 'check_digit', type => 'an', truncate => 'no'},
221             {from => 15, to => 15, name => 'cin', type => 'an', truncate => 'no'},
222             {from => 16, to => 20, name => 'codice_abi', type => 'an', truncate => 'no'},
223             {from => 21, to => 25, name => 'codice_cab', type => 'an', truncate => 'no'},
224             {from => 26, to => 37, name => 'numero_conto', type => 'an', truncate => 'no'},
225             {from => 38, to => 44, name => 'filler2', type => 'an', truncate => 'no'},
226             {from => 45, to => 120, name => 'filler3', type => 'an', truncate => 'no'},
227             ];
228              
229             # Record “17” [coordinate beneficiario]
230             my $XVII = [
231             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
232             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
233             {from => 4, to => 10, name => 'numero_progressivo', type => 'an', truncate => 'no'},
234             {from => 11, to => 12, name => 'codice_paese', type => 'an', truncate => 'no'},
235             {from => 13, to => 14, name => 'check_digit', type => 'an', truncate => 'no'},
236             {from => 15, to => 15, name => 'cin', type => 'an', truncate => 'no'},
237             {from => 16, to => 20, name => 'codice_abi', type => 'an', truncate => 'no'},
238             {from => 21, to => 25, name => 'codice_cab', type => 'an', truncate => 'no'},
239             {from => 26, to => 37, name => 'numero_conto', type => 'an', truncate => 'no'},
240             {from => 38, to => 44, name => 'filler2', type => 'an', truncate => 'no'},
241             {from => 45, to => 120, name => 'filler3', type => 'an', truncate => 'no'},
242             ];
243              
244             # Record “20”
245             my $XX = [
246             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
247             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
248             {from => 4, to => 10, name => 'numero_progressivo', type => 'n', truncate => 'no'},
249             {from => 11, to => 34, name => '1_segmento', type => 'an', truncate => 'yes'},
250             {from => 35, to => 58, name => '2_segmento', type => 'an', truncate => 'yes'},
251             {from => 59, to => 82, name => '3_segmento', type => 'an', truncate => 'yes'},
252             {from => 83, to => 106, name => '4_segmento', type => 'an', truncate => 'yes'},
253             {from => 107, to => 120, name => 'filler2', type => 'an', truncate => 'no'},
254             ];
255              
256             # Record “20” - bonifici
257             my $XX_BON = [
258             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
259             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
260             {from => 4, to => 10, name => 'numero_progressivo', type => 'an', truncate => 'no'},
261             {from => 11, to => 40, name => 'denominazione_azienda', type => 'an', truncate => 'no'},
262             {from => 41, to => 70, name => 'indirizzo', type => 'an', truncate => 'no'},
263             {from => 71, to => 100, name => 'localita', type => 'an', truncate => 'no'},
264             {from => 101, to => 116, name => 'codifica_fiscale', type => 'an', truncate => 'no'},
265             {from => 117, to => 120, name => 'filler2', type => 'an', truncate => 'no'},
266             ];
267              
268             # Record “30”
269             my $XXX = [
270             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
271             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
272             {from => 4, to => 10, name => 'numero_progressivo', type => 'n', truncate => 'no'},
273             {from => 11, to => 40, name => '1_segmento', type => 'an', truncate => 'yes'},
274             {from => 41, to => 70, name => '2_segmento', type => 'an', truncate => 'yes'},
275             {from => 71, to => 86, name => 'codice_fiscale_cliente', type => 'an', truncate => 'no'},
276             {from => 87, to => 120, name => 'filler2', type => 'an', truncate => 'no'},
277             ];
278              
279             # Record “30” - bonifici
280             my $XXX_BON = [
281             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
282             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
283             {from => 4, to => 10, name => 'numero_progressivo', type => 'an', truncate => 'no'},
284             {from => 11, to => 40, name => '1_segmento', type => 'an', truncate => 'no'},
285             {from => 41, to => 70, name => '2_segmento', type => 'an', truncate => 'no'},
286             {from => 71, to => 100, name => '3_segmento', type => 'an', truncate => 'no'},
287             {from => 101, to => 116, name => 'codice_fiscale_cliente', type => 'an', truncate => 'no'},
288             {from => 117, to => 120, name => 'filler2', type => 'an', truncate => 'no'},
289             ];
290              
291             # Record “40”
292             my $XL = [
293             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
294             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
295             {from => 4, to => 10, name => 'numero_progressivo', type => 'n', truncate => 'no'},
296             {from => 11, to => 40, name => 'indirizzo', type => 'an', truncate => 'yes'},
297             {from => 41, to => 45, name => 'cap', type => 'n', truncate => 'no'},
298             {from => 46, to => 70, name => 'comune_e_sigla_provincia', type => 'an', truncate => 'yes'},
299             {from => 71, to => 120, name => 'completamento_indirizzo', type => 'an', truncate => 'yes'}, # Eventuale denominazione in chiaro della banca/sportello
300             # domiciliataria/o.
301             ];
302              
303             # Record “40” - bonifici
304             my $XL_BON = [
305             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
306             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
307             {from => 4, to => 10, name => 'numero_progressivo', type => 'an', truncate => 'no'},
308             {from => 11, to => 40, name => 'indirizzo', type => 'an', truncate => 'no'},
309             {from => 41, to => 45, name => 'cap', type => 'an', truncate => 'no'},
310             {from => 46, to => 70, name => 'comune_e_sigla_provincia', type => 'an', truncate => 'no'},
311             {from => 71, to => 120, name => 'banca_sportello_beneficiario', type => 'an', truncate => 'no'},
312              
313             ];
314              
315             # Record “50” - bonifici
316             my $L_BON = [
317             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
318             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
319             {from => 4, to => 10, name => 'numero_progressivo', type => 'an', truncate => 'no'},
320             {from => 11, to => 40, name => '1_segmento', type => 'an', truncate => 'no'},
321             {from => 41, to => 70, name => '2_segmento', type => 'an', truncate => 'no'},
322             {from => 71, to => 100, name => '3_segmento', type => 'an', truncate => 'no'},
323             {from => 101, to => 120, name => 'filler2', type => 'an', truncate => 'no'},
324             ];
325              
326             # Record “50”
327             my $L = [
328             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
329             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
330             {from => 4, to => 10, name => 'numero_progressivo', type => 'n', truncate => 'no'},
331             {from => 11, to => 50, name => '1_segmento', type => 'an', truncate => 'yes'},
332             {from => 51, to => 90, name => '2_segmento', type => 'an', truncate => 'yes'},
333             {from => 91, to => 100, name => 'filler2', type => 'an', truncate => 'no'},
334             {from => 101, to => 116, name => 'codifica_fiscale_creditore', type => 'an', truncate => 'no'},
335             {from => 117, to => 120, name => 'filler3', type => 'an', truncate => 'no'},
336             ];
337              
338             # Record “51”
339             my $LI = [
340             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
341             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
342             {from => 4, to => 10, name => 'numero_progressivo', type => 'n', truncate => 'no'},
343             {from => 11, to => 20, name => 'numero_ricevuta', type => 'n', truncate => 'no'},
344             {from => 21, to => 40, name => 'denominazione_creditore', type => 'an', truncate => 'yes'},
345             {from => 41, to => 55, name => 'provincia_bollo', type => 'an', truncate => 'no'},
346             {from => 56, to => 65, name => 'numero_autorizzazione', type => 'an', truncate => 'no'},
347             {from => 66, to => 71, name => 'data_autorizzazione', type => 'an', truncate => 'no'},
348             {from => 72, to => 120, name => 'filler2', type => 'an', truncate => 'no'},
349             ];
350              
351             # Record “59”
352             my $LIX = [
353             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
354             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
355             {from => 4, to => 10, name => 'numero_progressivo', type => 'an', truncate => 'no'},
356             {from => 11, to => 65, name => '1_segmento', type => 'an', truncate => 'no'},
357             {from => 66, to => 120, name => '2_segmento', type => 'an', truncate => 'no'},
358             ];
359              
360             # Record “60”
361             my $LX = [
362             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
363             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
364             {from => 4, to => 10, name => 'numero_progressivo', type => 'an', truncate => 'no'},
365             {from => 11, to => 40, name => '1_segmento', type => 'an', truncate => 'no'},
366             {from => 41, to => 70, name => '2_segmento', type => 'an', truncate => 'no'},
367             {from => 71, to => 100, name => '3_segmento', type => 'an', truncate => 'no'},
368             {from => 101, to => 120, name => 'filler2', type => 'an', truncate => 'no'},
369             ];
370              
371             # Record “70”
372             my $LXX = [
373             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
374             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
375             {from => 4, to => 10, name => 'numero_progressivo', type => 'n', truncate => 'no'},
376             {from => 11, to => 88, name => 'filler2', type => 'an', truncate => 'no'},
377             {from => 89, to => 100, name => 'indicatori_di_circuito', type => 'an', truncate => 'no'},
378             {from => 101, to => 103, name => 'indicatore_richiesta_incasso', type => 'n', truncate => 'no'},
379             {from => 104, to => 120, name => 'chiavi_di_controllo', type => 'an', truncate => 'no'},
380             ];
381              
382             # Record “70” - bonifici
383             my $LXX_BON = [
384             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
385             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
386             {from => 4, to => 10, name => 'numero_progressivo', type => 'an', truncate => 'no'},
387             {from => 11, to => 25, name => 'filler2', type => 'an', truncate => 'no'},
388             {from => 26, to => 30, name => 'campo_non_disponibile', type => 'an', truncate => 'no'},
389             {from => 31, to => 31, name => 'tipo_flusso', type => 'an', truncate => 'no'},
390             {from => 32, to => 32, name => 'qualificatore_flusso', type => 'an', truncate => 'no'},
391             {from => 33, to => 37, name => 'soggetto_veicolatore', type => 'an', truncate => 'no'},
392             {from => 38, to => 42, name => 'codice_mp', type => 'an', truncate => 'no'},
393             {from => 43, to => 69, name => 'filler3', type => 'an', truncate => 'no'},
394             {from => 70, to => 70, name => 'flag_richiesta', type => 'an', truncate => 'no'},
395             {from => 71, to => 100, name => 'codice_univoco', type => 'an', truncate => 'no'},
396             {from => 101, to => 110, name => 'filler4', type => 'an', truncate => 'no'},
397             {from => 111, to => 111, name => 'cin_coordinate_bancaria', type => 'an', truncate => 'no'},
398             {from => 112, to => 112, name => 'filler5', type => 'an', truncate => 'no'},
399             {from => 113, to => 120, name => 'chiavi_di_controllo', type => 'an', truncate => 'no'},
400             ];
401              
402              
403             # Record “14” - flusso di ritorno
404             my $XIV_IN = [
405             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
406             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
407             {from => 4, to => 10, name => 'numero_progressivo', type => 'an', truncate => 'no'},
408             {from => 11, to => 22, name => 'filler2', type => 'an', truncate => 'no'},
409             {from => 23, to => 28, name => 'data_pagamento', type => 'an', truncate => 'no'},
410             {from => 29, to => 33, name => 'causale', type => 'an', truncate => 'no'},
411             {from => 34, to => 46, name => 'importo', type => 'an', truncate => 'no'},
412             {from => 47, to => 47, name => 'segno', type => 'an', truncate => 'no'},
413             {from => 48, to => 52, name => 'codice_abi_esattrice', type => 'an', truncate => 'no'},
414             {from => 53, to => 57, name => 'cab_esattrice', type => 'an', truncate => 'no'},
415             {from => 58, to => 69, name => 'filler3', type => 'an', truncate => 'no'},
416             {from => 70, to => 74, name => 'codice_abi_assuntrice', type => 'an', truncate => 'no'},
417             {from => 75, to => 79, name => 'cab_assuntrice', type => 'an', truncate => 'no'},
418             {from => 80, to => 91, name => 'conto', type => 'an', truncate => 'no'},
419             {from => 92, to => 96, name => 'codice_azienda', type => 'an', truncate => 'no'},
420             {from => 97, to => 97, name => 'tipo_codice', type => 'an', truncate => 'no'},
421             {from => 98, to => 113, name => 'codice_cliente_debitore', type => 'an', truncate => 'no'},
422             {from => 114, to => 119, name => 'filler4', type => 'an', truncate => 'no'},
423             {from => 120, to => 120, name => 'codice_divisa', type => 'an', truncate => 'no'},
424             ];
425              
426             # Record “51” - flusso di ritorno
427             my $LI_IN = [
428             {from => 1, to => 1, name => 'filler1', type => 'an', truncate => 'no'},
429             {from => 2, to => 3, name => 'tipo_record', type => 'an', truncate => 'no'},
430             {from => 4, to => 10, name => 'numero_progressivo', type => 'an', truncate => 'no'},
431             {from => 11, to => 20, name => 'numero_disposizione', type => 'an', truncate => 'no'},
432             {from => 21, to => 74, name => 'filler2', type => 'an', truncate => 'no'},
433             {from => 75, to => 86, name => 'codice_identificativo_univoco', type => 'an', truncate => 'no'},
434             {from => 87, to => 120, name => 'filler3', type => 'an', truncate => 'no'},
435             ];
436              
437             our $OUTPUT_RECORD_MAPPING = {
438             'IM' => $IM,
439             'EF' => $EF,
440             'PC' => $PC,
441             '10' => $X,
442             '14' => $XIV,
443             '16' => $XVI,
444             '17' => $XVII,
445             '20' => $XX,
446             '30' => $XXX,
447             '40' => $XL,
448             '50' => $L,
449             '51' => $LI,
450             '59' => $LIX,
451             '70' => $LXX,
452             'IB' => $IB,
453             };
454              
455             our $INPUT_RECORD_MAPPING = {
456             'IM' => $IM,
457             'EF' => $EF,
458             '14' => $XIV_IN,
459             '20' => $XX,
460             '30' => $XXX,
461             '40' => $XL,
462             '50' => $L,
463             '51' => $LI_IN,
464             '59' => $LIX,
465             '70' => $LXX,
466             'IB' => $IB,
467             };
468              
469             our $RICEVUTE_BANCARIE = {
470             'IB' => $IB,
471             'EF' => $EF,
472             '14' => $XIV,
473             '20' => $XX,
474             '30' => $XXX,
475             '40' => $XL,
476             '50' => $L,
477             '51' => $LI,
478             '70' => $LXX,
479             };
480              
481             our $MAV = {
482             'IM' => $IM,
483             'EF' => $EF,
484             '14' => $XIV_IN,
485             '20' => $XX,
486             '30' => $XXX,
487             '40' => $XL,
488             '50' => $L,
489             '51' => $LI_IN,
490             '59' => $LIX,
491             '70' => $LXX,
492             'IB' => $IB,
493             };
494              
495             our $BONIFICI = {
496             'PC' => $PC, # testa
497             '10' => $X,
498             '16' => $XVI,
499             '17' => $XVII,
500             '20' => $XX_BON,
501             '30' => $XXX_BON,
502             '40' => $XL_BON,
503             '50' => $L_BON,
504             '60' => $LX,
505             '70' => $LXX_BON,
506             'EF' => $EF_BON, # coda
507             };
508              
509             our $BONIFICI_ESTERI = {
510             'PE' => $PE, #testa
511             # ...
512             'EF' => $EF_BON_ES, #coda
513             };
514              
515             our $RECORD_MAPPING = {
516             IM => $IM,
517             PC => $PC,
518             PE => $PE,
519             EF => $EF,
520             EF_BON => $EF_BON,
521             EF_BON_ES => $EF_BON_ES,
522             X => $X,
523             XIV => $XIV,
524             XVI => $XVI,
525             XVII => $XVII,
526             XX => $XX,
527             XX_BON => $XX_BON,
528             XXX => $XXX,
529             XXX_BON => $XXX_BON,
530             XL => $XL,
531             XL_BON => $XL_BON,
532             L_BON => $L_BON,
533             L => $L,
534             LI => $LI,
535             LIX => $LIX,
536             LX => $LX,
537             LXX => $LXX,
538             LXX_BON => $LXX_BON,
539             IB => $IB,
540             XIV_IN => $XIV_IN,
541             LI_IN => $LI_IN,
542             OUTPUT_RECORD_MAPPING => $OUTPUT_RECORD_MAPPING,
543             INPUT_RECORD_MAPPING => $INPUT_RECORD_MAPPING,
544             MAV => $MAV,
545             BONIFICI => $BONIFICI,
546             BONIFICI_ESTERI => $BONIFICI_ESTERI,
547             RICEVUTE_BANCARIE => $RICEVUTE_BANCARIE,
548             };
549              
550             1;