nexabase-report 0.5.13 → 0.5.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,276 +1,312 @@
1
1
  {
2
2
  "metadata": {
3
3
  "version": "1.0",
4
- "name": "Factura con Tabla",
5
- "description": "Factura comercial con tabla de items, subtotal, IVA y total",
6
- "author": "Demo",
7
- "createdAt": "2024-01-15T10:00:00.000Z"
4
+ "name": "Factura Estándar",
5
+ "description": "Factura comercial con tabla de items, subtotal y total",
6
+ "author": "Antigravity",
7
+ "createdAt": "2026-07-11T00:00:00.000Z"
8
8
  },
9
9
  "layout": {
10
10
  "page": {
11
11
  "format": "A4",
12
12
  "orientation": "portrait",
13
- "margins": { "top": 25, "right": 25, "bottom": 25, "left": 25 }
13
+ "margins": {
14
+ "top": 1.5,
15
+ "right": 1.5,
16
+ "bottom": 1.5,
17
+ "left": 1.5
18
+ }
14
19
  },
15
20
  "bands": [
16
21
  {
17
- "id": "band_header",
18
- "type": "ReportHeader",
22
+ "id": "band_invoice_header",
23
+ "type": "GroupHeader",
19
24
  "height": 180,
25
+ "dataSource": "main",
26
+ "groupExpression": "folio",
20
27
  "elements": [
21
28
  {
22
- "id": "el_logo_rect",
23
- "type": "Rectangle",
24
- "x": 30,
29
+ "id": "el_logo",
30
+ "type": "Image",
31
+ "x": 0,
25
32
  "y": 10,
26
- "width": 180,
33
+ "width": 140,
27
34
  "height": 60,
28
- "shapeType": "Rectangle",
29
- "options": { "lineColor": "#3b82f6", "strokeWidth": 2 }
30
- },
31
- {
32
- "id": "el_company",
33
- "type": "Text",
34
- "x": 40,
35
- "y": 20,
36
- "width": 160,
37
- "height": 20,
38
- "content": "MI EMPRESA S.A.",
39
- "style": { "fontSize": "14px", "fontWeight": "bold", "color": "#3b82f6" }
40
- },
41
- {
42
- "id": "el_company_sub",
43
- "type": "Text",
44
- "x": 40,
45
- "y": 42,
46
- "width": 160,
47
- "height": 16,
48
- "content": "RUT: 76.123.456-7",
49
- "style": { "fontSize": "10px", "color": "#64748b" }
35
+ "style": {
36
+ "objectFit": "contain"
37
+ },
38
+ "options": {
39
+ "imageSource": "url",
40
+ "imageUrl": "https://nexabase.online/logo.png"
41
+ }
50
42
  },
51
43
  {
52
44
  "id": "el_invoice_title",
53
45
  "type": "Text",
54
- "x": 400,
55
- "y": 15,
46
+ "x": 420,
47
+ "y": 10,
56
48
  "width": 300,
57
49
  "height": 30,
58
- "content": "FACTURA ELECTRÓNICA",
59
- "style": { "fontSize": "18px", "fontWeight": "bold", "color": "#1e293b", "textAlign": "right" }
50
+ "content": "FACTURA DE VENTA",
51
+ "style": {
52
+ "fontSize": "20px",
53
+ "fontWeight": "bold",
54
+ "color": "#0f172a",
55
+ "textAlign": "right"
56
+ }
60
57
  },
61
58
  {
62
59
  "id": "el_invoice_num",
63
60
  "type": "Text",
64
- "x": 400,
65
- "y": 50,
61
+ "x": 420,
62
+ "y": 40,
66
63
  "width": 300,
67
64
  "height": 16,
68
65
  "content": "Nº {{folio}}",
69
- "style": { "fontSize": "12px", "color": "#64748b", "textAlign": "right" }
66
+ "style": {
67
+ "fontSize": "14px",
68
+ "color": "#64748b",
69
+ "textAlign": "right",
70
+ "fontWeight": "bold"
71
+ }
70
72
  },
71
73
  {
72
74
  "id": "el_invoice_date",
73
75
  "type": "Text",
74
- "x": 400,
75
- "y": 68,
76
+ "x": 420,
77
+ "y": 60,
76
78
  "width": 300,
77
79
  "height": 16,
78
80
  "content": "Fecha: {{fecha_emision}}",
79
- "style": { "fontSize": "11px", "color": "#64748b", "textAlign": "right" }
81
+ "style": {
82
+ "fontSize": "12px",
83
+ "color": "#64748b",
84
+ "textAlign": "right"
85
+ }
86
+ },
87
+ {
88
+ "id": "el_barcode",
89
+ "type": "Barcode",
90
+ "x": 540,
91
+ "y": 80,
92
+ "width": 180,
93
+ "height": 40,
94
+ "binding": "folio",
95
+ "options": {
96
+ "barcodeFormat": "CODE128",
97
+ "displayValue": false
98
+ }
99
+ },
100
+ {
101
+ "id": "box_client",
102
+ "type": "Rectangle",
103
+ "x": 0,
104
+ "y": 85,
105
+ "width": 350,
106
+ "height": 80,
107
+ "shapeType": "Rectangle",
108
+ "options": {
109
+ "lineColor": "#e2e8f0",
110
+ "strokeWidth": 1,
111
+ "backgroundColor": "#f8fafc"
112
+ },
113
+ "style": {
114
+ "borderRadius": "6px"
115
+ }
80
116
  },
81
117
  {
82
118
  "id": "el_client_label",
83
119
  "type": "Text",
84
- "x": 30,
85
- "y": 90,
120
+ "x": 10,
121
+ "y": 95,
86
122
  "width": 100,
87
123
  "height": 16,
88
- "content": "Cliente:",
89
- "style": { "fontSize": "10px", "fontWeight": "bold", "color": "#64748b" }
124
+ "content": "CLIENTE:",
125
+ "style": {
126
+ "fontSize": "10px",
127
+ "fontWeight": "bold",
128
+ "color": "#64748b"
129
+ }
90
130
  },
91
131
  {
92
132
  "id": "el_client_name",
93
133
  "type": "Text",
94
- "x": 130,
95
- "y": 90,
96
- "width": 350,
134
+ "x": 10,
135
+ "y": 112,
136
+ "width": 330,
97
137
  "height": 16,
98
- "binding": "cliente_nombre",
99
138
  "content": "{{cliente_nombre}}",
100
- "style": { "fontSize": "12px", "color": "#1e293b" }
139
+ "style": {
140
+ "fontSize": "13px",
141
+ "color": "#1e293b",
142
+ "fontWeight": "bold"
143
+ }
101
144
  },
102
145
  {
103
146
  "id": "el_client_rut",
104
147
  "type": "Text",
105
- "x": 130,
106
- "y": 108,
107
- "width": 200,
148
+ "x": 10,
149
+ "y": 130,
150
+ "width": 330,
108
151
  "height": 14,
109
- "binding": "cliente_rut",
110
152
  "content": "RUT: {{cliente_rut}}",
111
- "style": { "fontSize": "10px", "color": "#64748b" }
153
+ "style": {
154
+ "fontSize": "11px",
155
+ "color": "#475569"
156
+ }
112
157
  },
113
158
  {
114
159
  "id": "el_client_addr",
115
160
  "type": "Text",
116
- "x": 130,
117
- "y": 124,
118
- "width": 350,
161
+ "x": 10,
162
+ "y": 146,
163
+ "width": 330,
119
164
  "height": 14,
120
- "binding": "cliente_direccion",
121
- "content": "{{cliente_direccion}}",
122
- "style": { "fontSize": "10px", "color": "#64748b" }
123
- },
124
- {
125
- "id": "el_barcode",
126
- "type": "Barcode",
127
- "x": 550,
128
- "y": 95,
129
- "width": 180,
130
- "height": 50,
131
- "binding": "folio",
132
- "options": { "barcodeFormat": "CODE128", "displayValue": true }
133
- },
134
- {
135
- "id": "el_header_line",
136
- "type": "Line",
137
- "x": 30,
138
- "y": 165,
139
- "width": 700,
140
- "height": 2,
141
- "shapeType": "Line",
142
- "options": { "lineColor": "#3b82f6", "strokeWidth": 2 }
143
- },
144
- {
145
- "id": "el_items_label",
146
- "type": "Text",
147
- "x": 30,
148
- "y": 155,
149
- "width": 200,
150
- "height": 16,
151
- "content": "Detalle de Items",
152
- "style": { "fontSize": "12px", "fontWeight": "bold", "color": "#1e293b" }
165
+ "content": "Dirección: {{cliente_direccion}}",
166
+ "style": {
167
+ "fontSize": "11px",
168
+ "color": "#475569"
169
+ }
153
170
  }
154
171
  ]
155
172
  },
156
173
  {
157
- "id": "band_items_table",
174
+ "id": "band_items",
158
175
  "type": "DataBand",
159
- "height": 120,
176
+ "height": 600,
160
177
  "dataSource": "main",
161
178
  "elements": [
162
179
  {
163
- "id": "el_items_table",
180
+ "id": "tbl_items",
164
181
  "type": "Table",
165
- "x": 30,
166
- "y": 5,
167
- "width": 700,
168
- "height": 100,
182
+ "x": 0,
183
+ "y": 10,
184
+ "width": 720,
185
+ "height": 580,
186
+ "style": {
187
+ "fontSize": "11px"
188
+ },
169
189
  "tableColumns": [
170
- { "id": "col1", "title": "Código", "width": 80, "binding": "codigo" },
171
- { "id": "col2", "title": "Descripción", "width": 280, "binding": "descripcion" },
172
- { "id": "col3", "title": "Cantidad", "width": 80, "binding": "cantidad" },
173
- { "id": "col4", "title": "P. Unitario", "width": 120, "binding": "precio_unitario" },
174
- { "id": "col5", "title": "Total", "width": 120, "binding": "total_linea" }
190
+ {
191
+ "id": "c1",
192
+ "title": "Cód.",
193
+ "width": 60,
194
+ "binding": "codigo"
195
+ },
196
+ {
197
+ "id": "c2",
198
+ "title": "Descripción",
199
+ "width": 320,
200
+ "binding": "descripcion"
201
+ },
202
+ {
203
+ "id": "c3",
204
+ "title": "Cant.",
205
+ "width": 80,
206
+ "binding": "cantidad"
207
+ },
208
+ {
209
+ "id": "c4",
210
+ "title": "Precio U.",
211
+ "width": 130,
212
+ "binding": "precio_unitario"
213
+ },
214
+ {
215
+ "id": "c5",
216
+ "title": "Total",
217
+ "width": 130,
218
+ "binding": "total_linea"
219
+ }
175
220
  ],
176
- "style": { "fontSize": "11px" }
221
+ "conditionalFormats": []
177
222
  }
178
223
  ]
179
224
  },
180
225
  {
181
226
  "id": "band_totals",
182
- "type": "ReportFooter",
183
- "height": 140,
227
+ "type": "GroupFooter",
228
+ "height": 100,
229
+ "dataSource": "main",
184
230
  "elements": [
185
231
  {
186
- "id": "el_sep_totals",
187
- "type": "Line",
188
- "x": 400,
232
+ "id": "box_totals",
233
+ "type": "Rectangle",
234
+ "x": 480,
189
235
  "y": 10,
190
- "width": 330,
191
- "height": 1,
192
- "shapeType": "Line",
193
- "options": { "lineColor": "#94a3b8", "strokeWidth": 1 }
236
+ "width": 240,
237
+ "height": 50,
238
+ "shapeType": "Rectangle",
239
+ "options": {
240
+ "lineColor": "#e2e8f0",
241
+ "strokeWidth": 1,
242
+ "backgroundColor": "#f1f5f9"
243
+ },
244
+ "style": {
245
+ "borderRadius": "6px"
246
+ }
194
247
  },
195
248
  {
196
- "id": "el_subtotal_label",
249
+ "id": "el_total_label",
197
250
  "type": "Text",
198
- "x": 410,
199
- "y": 20,
200
- "width": 150,
201
- "height": 18,
202
- "content": "Subtotal:",
203
- "style": { "fontSize": "11px", "color": "#64748b", "textAlign": "right" }
251
+ "x": 490,
252
+ "y": 25,
253
+ "width": 100,
254
+ "height": 20,
255
+ "content": "TOTAL A PAGAR:",
256
+ "style": {
257
+ "fontSize": "12px",
258
+ "fontWeight": "bold",
259
+ "color": "#334155"
260
+ }
204
261
  },
205
262
  {
206
- "id": "el_subtotal_val",
263
+ "id": "el_total_val",
207
264
  "type": "Text",
208
- "x": 570,
265
+ "x": 590,
209
266
  "y": 20,
210
- "width": 150,
211
- "height": 18,
212
- "content": "${[sum(total_linea)]}",
213
- "style": { "fontSize": "12px", "color": "#1e293b", "textAlign": "right" }
214
- },
215
- {
216
- "id": "el_iva_label",
217
- "type": "Text",
218
- "x": 410,
219
- "y": 42,
220
- "width": 150,
221
- "height": 18,
222
- "content": "IVA (19%):",
223
- "style": { "fontSize": "11px", "color": "#64748b", "textAlign": "right" }
224
- },
225
- {
226
- "id": "el_iva_val",
227
- "type": "Text",
228
- "x": 570,
229
- "y": 42,
230
- "width": 150,
231
- "height": 18,
232
- "content": "${[sum(total_linea) * 0.19]}",
233
- "style": { "fontSize": "12px", "color": "#1e293b", "textAlign": "right" }
234
- },
267
+ "width": 120,
268
+ "height": 25,
269
+ "content": "{{[sum(total_linea)]}}",
270
+ "style": {
271
+ "fontSize": "18px",
272
+ "fontWeight": "bold",
273
+ "color": "#0f172a",
274
+ "textAlign": "right"
275
+ }
276
+ }
277
+ ]
278
+ },
279
+ {
280
+ "id": "band_page_footer",
281
+ "type": "PageFooter",
282
+ "height": 30,
283
+ "elements": [
235
284
  {
236
- "id": "el_total_line",
285
+ "id": "el_footer_line",
237
286
  "type": "Line",
238
- "x": 410,
239
- "y": 65,
240
- "width": 310,
241
- "height": 2,
287
+ "x": 0,
288
+ "y": 5,
289
+ "width": 720,
290
+ "height": 1,
242
291
  "shapeType": "Line",
243
- "options": { "lineColor": "#3b82f6", "strokeWidth": 2 }
244
- },
245
- {
246
- "id": "el_total_label",
247
- "type": "Text",
248
- "x": 410,
249
- "y": 72,
250
- "width": 150,
251
- "height": 22,
252
- "content": "TOTAL:",
253
- "style": { "fontSize": "14px", "fontWeight": "bold", "color": "#1e293b", "textAlign": "right" }
292
+ "options": {
293
+ "lineColor": "#cbd5e1",
294
+ "strokeWidth": 1
295
+ }
254
296
  },
255
297
  {
256
- "id": "el_total_val",
298
+ "id": "el_page_number",
257
299
  "type": "Text",
258
- "x": 570,
259
- "y": 72,
260
- "width": 150,
261
- "height": 22,
262
- "content": "${[sum(total_linea) * 1.19]}",
263
- "style": { "fontSize": "16px", "fontWeight": "bold", "color": "#3b82f6", "textAlign": "right" }
264
- },
265
- {
266
- "id": "el_page_footer",
267
- "type": "Text",
268
- "x": 30,
269
- "y": 110,
270
- "width": 200,
300
+ "x": 0,
301
+ "y": 10,
302
+ "width": 720,
271
303
  "height": 14,
272
- "content": "Página {{Page}} de {{TotalPages}} — Generado: {{Now}}",
273
- "style": { "fontSize": "9px", "color": "#94a3b8" }
304
+ "content": "Página {{Page}} de {{TotalPages}}",
305
+ "style": {
306
+ "fontSize": "10px",
307
+ "color": "#94a3b8",
308
+ "textAlign": "center"
309
+ }
274
310
  }
275
311
  ]
276
312
  }
@@ -279,9 +315,9 @@
279
315
  "dataSources": [
280
316
  {
281
317
  "id": "ds_main",
282
- "collection": "facturas_items",
318
+ "collection": "facturas",
283
319
  "alias": "main",
284
320
  "enabled": true
285
321
  }
286
322
  ]
287
- }
323
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexabase-report",
3
- "version": "0.5.13",
3
+ "version": "0.5.15",
4
4
  "description": "Professional report designer and viewer for NexaBase — drag & drop designer, PDF/Excel export, charts, crosstabs, subreports.",
5
5
  "license": "MIT",
6
6
  "author": "NexaBase Team",