Merge branch '4_7_x' of https://github.com/xtuple/xtuple into i24559_xtlocks
[xtuple] / enyo-client / extensions / source / billing / database / source / xt / tables / rptdef.sql
1 select xt.add_report_definition('XM.Invoice', 0, $${
2   "settings": {
3     "detailAttribute": "lineItems",
4     "defaultFontSize": 12,
5     "defaultMarginSize": 20
6   },
7   "headerElements": [
8     {
9       "definition": [
10         {"attr": "remitto.name"},
11         {"attr": "remitto.address"}
12       ],
13       "options": {"x": 0, "y": 40}
14     },
15     {
16       "element": "image",
17       "definition": "Invoice Logo",
18       "options": {"x": 200, "y": 40, "width": 150}
19     },
20     {
21       "definition": [{"text": "_invoice"}],
22       "options": {"fontBold": true, "fontSize": 18, "x": 500, "y": 40, "align": "right"}
23     },
24     {
25       "definition": [{"text": "_invoiceDate", "label": true}],
26       "options": {"fontBold": true, "x": 400, "y": 60}
27     },
28     {
29       "definition": [{"attr": "invoiceDate"}],
30       "options": {"x": 500, "y": 60, "align": "right"}
31     },
32     {
33       "definition": [{"text": "_dueDate", "label": true}],
34       "options": {"fontBold": true, "x": 400, "y": 75}
35     },
36     {
37       "definition": [{"attr": "dueDate"}],
38       "options": {"x": 500, "y": 75, "align": "right"}
39     },
40     {
41       "definition": [{"text": "_discountDate", "label": true}],
42       "options": {"fontBold": true, "x": 400, "y": 90}
43     },
44     {
45       "definition": [{"attr": "discountDate"}],
46       "options": {"x": 500, "y": 90, "align": "right"}
47     },
48     {
49       "definition": [{"text": "_orderDate", "label": true}],
50       "options": {"fontBold": true, "x": 400, "y": 105}
51     },
52     {
53       "definition": [{"attr": "orderDate"}],
54       "options": {"x": 500, "y": 105, "align": "right"}
55     },
56     {
57       "definition": [{"text": "_terms", "label": true}],
58       "options": {"fontBold": true, "x": 400, "y": 120}
59     },
60     {
61       "definition": [{"attr": "terms.description"}],
62       "options": {"x": 475, "y": 120, "align": "right"}
63     },
64     {
65       "definition": [{"text": "_orderNumber", "label": true}],
66       "options": {"fontBold": true, "x": 0, "y": 180}
67     },
68     {
69       "definition": [{"attr": "orderNumber"}],
70       "options": {"x": 200, "y": 180}
71     },
72     {
73       "definition": [{"text": "_invoiceNumber", "label": true}],
74       "options": {"fontBold": true, "x": 0, "y": 195}
75     },
76     {
77       "definition": [{"attr": "number"}],
78       "options": {"x": 200, "y": 195}
79     },
80     {
81       "definition": [{"text": "_purchaseOrderNumber", "label": true}],
82       "options": {"fontBold": true, "x": 0, "y": 210}
83     },
84     {
85       "definition": [{"attr": "customerPurchaseOrderNumber"}],
86       "options": {"x": 200, "y": 210}
87     },
88     {
89       "definition": [{"text": "_customerNumber", "label": true}],
90       "options": {"fontBold": true, "x": 0, "y": 225}
91     },
92     {
93       "definition": [{"attr": "customer.number"}],
94       "options": {"x": 200, "y": 225}
95     },
96     {
97       "definition": [{"text": "_billto", "label": true}],
98       "options": {"x": 0, "y": 250, "fontBold": true}
99     },
100     {
101       "definition": [
102         {"attr": "billtoName"},
103         {"attr": "billtoAddress1"},
104         {"attr": "billtoAddress2"},
105         {"attr": "billtoAddress3"},
106         {"attr": "billtoCity"},
107         {"attr": "billtoState"},
108         {"attr": "billtoPostalCode"},
109         {"attr": "billtoCountry"},
110         {"attr": "billtoPhone"}
111       ],
112       "transform": "address",
113       "options": {"x": 120, "y": 250, "width": 250}
114     },
115     {"element": "fontBold"},
116     {
117       "element": "band",
118       "definition": [
119         {"text": "_quantity", "width": 100},
120         {"text": "_uom", "width": 50},
121         {"text": "_item", "width": 100},
122         {"text": "_currency", "width": 80},
123         {"text": "_unitPrice", "width": 100},
124         {"text": "_extendedPrice", "width": 100}
125       ],
126       "options": {"border": 0, "padding": 5, "x": 0, "y": 325}
127     },
128     {"element": "bandLine", "size": 2}
129   ],
130   "detailElements": [
131     {"element": "fontNormal"},
132     {
133       "element": "band",
134       "definition": [
135         {"attr": "lineItems*quantity", "width": 100},
136         {"attr": "lineItems*quantityUnit", "width": 50},
137         {"attr": "lineItems*item.number", "width": 100},
138         {"attr": "currency", "width": 80},
139         {"attr": "lineItems*price", "width": 100},
140         {"attr": "lineItems*extendedPrice", "width": 100}
141       ],
142       "options": {"fontBold": true, "border": 0, "padding": 12}
143     }
144   ],
145   "footerElements": [
146     {
147       "definition": [
148         {"attr": "notes", "label": true}
149       ],
150       "options": {"fontSize": 10, "width": 400}
151     },
152     {"element": "bandLine", "size": 2},
153     {
154       "element": "band",
155       "definition": [
156         {"text": "_subtotal", "label": true, "width": 70, "align": "left"},
157         {"attr": "subtotal", "width": 100, "align": "right"}
158       ],
159       "options": {"border": 0, "x": 360}
160     },
161     {
162       "element": "band",
163       "definition": [
164         {"text": "_taxTotal", "label": true, "width": 70, "align": "left"},
165         {"attr": "taxTotal", "width": 100, "align": "right"}
166       ],
167       "options": {"border": 0, "x": 360}
168     },
169     {
170       "element": "band",
171       "definition": [
172         {"text": "_total", "label": true, "width": 70, "align": "left"},
173         {"attr": "total", "width": 100, "align": "right"}
174       ],
175       "options": {"border": 0, "x": 360}
176     },
177     {
178       "definition": []
179     }
180   ],
181   "pageFooterElements": [
182     {
183       "element": "pageNumber", "definition": [],
184       "options": {"align": "center"}
185     }
186   ]
187 }$$);