Project

General

Profile

« Previous | Next » 

Revision 9b58dc83

Added by Jérôme Schneider over 9 years ago

dossiers: update transport cerfa to the last version

Closes #5473

View differences:

calebasse/dossiers/transport_template.py
13 13
class TransportTemplate(object):
14 14
    fields = {
15 15
            'NOM_BENEFICIAIRE': {
16
                'pos': (302, 186),
16
                'pos': (302, 172),
17 17
            },
18 18
            'PRENOM_BENEFICIAIRE': {
19
                'pos': (136, 200),
19
                'pos': (136, 186),
20 20
            },
21 21
            'DATE': {
22
                'pos': (532, 597),
23
                'size': 8,
22
                'pos': (530, 582),
23
                'size': 7,
24 24
            },
25 25
            'LIEU': {
26
                'pos': (596, 597),
26
                'pos': (591, 583),
27
                'size': 7,
27 28
            },
28 29
            'IDENTIFICATION_ETABLISSEMENT': {
29 30
                'type': 'multiline',
30
                'pos': (510, 652),
31
                'pos': (510, 638),
31 32
            },
32 33
            'NIR_ASSURE': {
33
                'pos': (325, 800),
34
                'pos': (325, 781),
34 35
                'size': 10,
35 36
            },
36 37
            'NIR_KEY_ASSURE': {
37
                'pos': (527, 800),
38
                'pos': (527, 781),
38 39
                'size': 10,
39 40
            },
40 41
            'NOM_ASSURE': {
41
                'pos': (492, 825),
42
                'pos': (492, 805),
42 43
            },
43 44
            'CODE_ORGANISME_1': {
44
                'pos': (328, 850),
45
                'pos': (328, 832),
45 46
                'size': 10,
46 47
            },
47 48
            'CODE_ORGANISME_2': {
48
                'pos': (357, 850),
49
                'pos': (357, 832),
49 50
                'size': 10,
50 51
            },
51 52
            'CODE_ORGANISME_3': {
52
                'pos': (401, 850),
53
                'pos': (401, 832),
53 54
                'size': 10,
54 55
            },
55 56
            'ADRESSE_BENEFICIAIRE': {
56
                'pos': (92, 891),
57
                'pos': (94, 873),
57 58
            },
58 59
            'SITUATION_CHOICE_1': {
59
                'pos': (393, 264),
60
                'pos': (386, 241),
60 61
                'type': 'bool',
61 62
            },
62 63
            'SITUATION_CHOICE_2': {
63
                'pos': (393, 280),
64
                'pos': (386, 262),
64 65
                'type': 'bool',
65 66
            },
66 67
            'SITUATION_CHOICE_3': {
67
                'pos': (719, 264),
68
                'pos': (711, 240),
68 69
                'type': 'bool',
69 70
            },
70 71
            'SITUATION_CHOICE_4': {
71
                'pos': (719, 280),
72
                'pos': (711, 259),
72 73
                'type': 'bool',
73 74
            },
74 75
            'SITUATION_DATE': {
75
                'pos': (610, 299),
76
                'pos': (606, 280),
76 77
                'size': 8,
77 78
            },
78 79
            'TRAJET_TEXT': {
79
                'pos': (84, 340),
80
                'pos': (84, 320),
80 81
                'size': 8,
81 82
            },
82 83
            'TRAJET_CHOICE_1': {
83
                'pos': (201, 396),
84
                'pos': (193, 375),
84 85
                'type': 'bool',
85 86
            },
86 87
            'TRAJET_CHOICE_2': {
87
                'pos': (454, 396),
88
                'pos': (441, 375),
88 89
                'type': 'bool',
89 90
            },
90 91
            'TRAJET_CHOICE_3': {
91
                'pos': (719, 396),
92
                'type': 'bool',
93
            },
94
            'TRAJET_CHOICE_4': {
95
                'pos': (201, 419),
92
                'pos': (711, 376),
96 93
                'type': 'bool',
97 94
            },
98 95
            'TRAJET_NUMBER': {
99
                'pos': (305, 409),
96
                'pos': (308, 383),
100 97
                'size': 8,
101 98
            },
102 99
            'PC_CHOICE_1': {
103
                'pos': (567, 435),
100
                'pos': (564, 410),
104 101
                'type': 'bool',
105 102
            },
106 103
            'PC_CHOICE_2': {
107
                'pos': (642, 435),
104
                'pos': (638, 410),
108 105
                'type': 'bool',
109 106
            },
110 107
            'MODE_CHOICE_1': {
111
                'pos': (321, 484),
108
                'pos': (320, 473),
112 109
                'type': 'bool',
113 110
            },
114 111
            'MODE_CHOICE_2': {
115
                'pos': (321, 499),
112
                'pos': (320, 488),
116 113
                'type': 'bool',
117 114
            },
118 115
            'MODE_CHOICE_3': {
119
                'pos': (321, 515),
116
                'pos': (320, 504),
120 117
                'type': 'bool',
121 118
            },
122 119
            'MODE_CHOICE_4': {
123
                'pos': (568, 528),
120
                'pos': (564, 517),
124 121
                'type': 'bool',
125 122
            },
126 123
            'MODE_CHOICE_5': {
127
                'pos': (642, 528),
124
                'pos': (638, 517),
128 125
                'type': 'bool',
129 126
            },
130 127
            'MODE_CHOICE_6': {
131
                'pos': (321, 546),
128
                'pos': (320, 536),
132 129
                'type': 'bool',
133 130
            },
134 131
            'CDTS_CHOICE_1': {
135
                'pos': (404, 565),
132
                'pos': (400, 552),
136 133
                'type': 'bool',
137 134
            },
138 135
            'CDTS_CHOICE_2': {
139
                'pos': (567, 563),
136
                'pos': (661, 552),
140 137
                'type': 'bool',
141 138
            },
142 139
    }
......
195 192
            for row in value:
196 193
                for x, v in zip(field['cols'], row):
197 194
                    sub = {
198
                            'pos': (offset + x, y),
199 195
                            'size': size,
200 196
                    }
201 197
                    self.draw_field(ctx, sub, v, 7)
202 198
                y += field['lineheight']
203 199

  
200
    def draw_grid(self, ctx):
201
        ctx.set_source_rgb(0, 0, 0)
202
        for i in range(0, 827, 100):
203
            ctx.move_to(i, 5)
204
            ctx.show_text(str(i // 100));
205
            ctx.move_to(i, 0)
206
            ctx.line_to(i, 1169)
207
            ctx.stroke()
208
        for i in range(0, 1169, 100):
209
            ctx.move_to(0, i-5)
210
            ctx.show_text(str(i // 100))
211
            ctx.move_to(0, i)
212
            ctx.line_to(827, i)
213
            ctx.stroke()
214

  
204 215
    def generate(self, content, delete=True):
205 216
        width, height = 827, 1169
206 217
        with tempfile.NamedTemporaryFile(prefix=self.prefix,

Also available in: Unified diff