Issue #24224:nomalize sales reporting
[xtuple] / foundation-database / public / tables / report / BriefSalesHistory.xml
1 <!DOCTYPE openRPTDef>
2 <report>
3  <title>Brief Sales History</title>
4  <name>BriefSalesHistory</name>
5  <description></description>
6  <grid>
7   <snap/>
8   <show/>
9   <x>0.05</x>
10   <y>0.05</y>
11  </grid>
12  <size>Letter</size>
13  <portrait/>
14  <topmargin>50</topmargin>
15  <bottommargin>50</bottommargin>
16  <rightmargin>50</rightmargin>
17  <leftmargin>50</leftmargin>
18  <querysource>
19   <name>head</name>
20   <sql>SELECT &lt;? if exists("startDate") ?>
21          formatDate(date(&lt;? value("startDate") ?>))
22        &lt;? else ?>
23          text('Earliest')
24        &lt;? endif ?> AS startDate,
25        &lt;? if exists("endDate") ?>
26          formatDate(date(&lt;? value("endDate") ?>))
27        &lt;? else ?>
28          text('Latest')
29        &lt;? endif ?> AS endDate,
30        &lt;? if exists("showPrices") ?>
31            text('Unit Price') AS lbl_unitprice,
32            text('Total') AS lbl_total,
33        &lt;? else ?>
34            text('') AS lbl_unitprice,
35            text('') AS lbl_total,
36        &lt;? endif ?>
37        &lt;? if exists("warehous_id") ?>
38          (SELECT warehous_code FROM whsinfo WHERE warehous_id=&lt;? value("warehous_id") ?>)
39        &lt;? else ?>
40          text('All Sites')
41        &lt;? endif ?>
42        AS warehouse,
43        &lt;? if exists("cust_id") ?>
44          (SELECT cust_name FROM custinfo WHERE cust_id=&lt;? value("cust_id") ?>)
45        &lt;? else ?>
46          text('All Customers')
47        &lt;? endif ?>
48          AS cust_name,
49        &lt;? if exists("custtype_id") ?>
50          (SELECT custtype_code FROM custtype WHERE custtype_id=&lt;? value("custtype_id") ?>)
51        &lt;? else ?>
52          text('All Customer Types')
53        &lt;? endif ?>
54          AS custtype_code,
55        &lt;? if exists("custtype_pattern") ?>
56            text(&lt;? value("custtype_pattern") ?>)
57        &lt;? else ?>
58            text('Not Applicable')
59        &lt;? endif ?>
60          AS custtype_pattern,
61        &lt;? if exists("custgrp_id") ?>
62          (SELECT custgrp_name FROM custgrp WHERE custgrp_id=&lt;? value("custgrp_id") ?>)
63        &lt;? else ?>
64          text('All Customer Groups')
65        &lt;? endif ?>
66          AS custgrp_name,
67        &lt;? if exists("custgrp_pattern") ?>
68            text(&lt;? value("custgrp_pattern") ?>)
69        &lt;? else ?>
70            text('Not Applicable')
71        &lt;? endif ?>
72          AS custgrp_pattern,
73       &lt;? if exists("prodcat_id") ?>
74          (SELECT prodcat_code FROM prodcat WHERE prodcat_id=&lt;? value("prodcat_id") ?>)
75        &lt;? else ?>
76          text('All Product Categories')
77        &lt;? endif ?>
78          AS prodcat_code,
79        &lt;? if exists("prodcat_pattern") ?>
80            text(&lt;? value("prodcat_pattern") ?>)
81        &lt;? else ?>
82            text('Not Applicable')
83        &lt;? endif ?>
84          AS prodcat_pattern,
85        &lt;? if exists("item_id") ?>
86          (SELECT item_number FROM item WHERE item_id=&lt;? value("item_id") ?>)
87        &lt;? else ?>
88          text('All Item Numbers')
89        &lt;? endif ?>
90          AS item_number,
91        &lt;? if exists("cohead_id") ?>
92          (SELECT cohead_number FROM cohead WHERE cohead_id=&lt;? value("cohead_id") ?>)
93        &lt;? else ?>
94          text('All Orders')
95        &lt;? endif ?>
96          AS docnumber; </sql>
97  </querysource>
98  <querysource loadFromDb="true">
99   <name>detail</name>
100   <mqlgroup>briefSalesHistory</mqlgroup>
101   <mqlname>detail</mqlname>
102  </querysource>
103  <rpthead>
104   <height>221</height>
105   <label>
106    <rect>
107     <x>5</x>
108     <y>200</y>
109     <width>100</width>
110     <height>15</height>
111    </rect>
112    <font>
113     <face>Arial</face>
114     <size>8</size>
115     <weight>normal</weight>
116    </font>
117    <left/>
118    <vcenter/>
119    <string>Doc. #</string>
120   </label>
121   <label>
122    <rect>
123     <x>355</x>
124     <y>200</y>
125     <width>80</width>
126     <height>15</height>
127    </rect>
128    <font>
129     <face>Arial</face>
130     <size>8</size>
131     <weight>normal</weight>
132    </font>
133    <hcenter/>
134    <vcenter/>
135    <string>Invc. Date</string>
136   </label>
137   <label>
138    <rect>
139     <x>110</x>
140     <y>200</y>
141     <width>100</width>
142     <height>15</height>
143    </rect>
144    <font>
145     <face>Arial</face>
146     <size>8</size>
147     <weight>normal</weight>
148    </font>
149    <left/>
150    <vcenter/>
151    <string>Invoice #</string>
152   </label>
153   <label>
154    <rect>
155     <x>345</x>
156     <y>5</y>
157     <width>400</width>
158     <height>40</height>
159    </rect>
160    <font>
161     <face>Arial</face>
162     <size>18</size>
163     <weight>bold</weight>
164    </font>
165    <right/>
166    <vcenter/>
167    <string>Brief Sales History</string>
168   </label>
169   <label>
170    <rect>
171     <x>665</x>
172     <y>200</y>
173     <width>80</width>
174     <height>15</height>
175    </rect>
176    <font>
177     <face>Arial</face>
178     <size>8</size>
179     <weight>normal</weight>
180    </font>
181    <hcenter/>
182    <vcenter/>
183    <string>Total</string>
184   </label>
185   <label>
186    <rect>
187     <x>270</x>
188     <y>200</y>
189     <width>80</width>
190     <height>15</height>
191    </rect>
192    <font>
193     <face>Arial</face>
194     <size>8</size>
195     <weight>normal</weight>
196    </font>
197    <hcenter/>
198    <vcenter/>
199    <string>Ord. Date</string>
200   </label>
201   <line>
202    <xstart>0</xstart>
203    <ystart>218</ystart>
204    <xend>745</xend>
205    <yend>218</yend>
206    <weight>2</weight>
207   </line>
208   <text>
209    <rect>
210     <x>10</x>
211     <y>38</y>
212     <width>725</width>
213     <height>15</height>
214    </rect>
215    <bottompad>12</bottompad>
216    <font>
217     <face>Arial</face>
218     <size>10</size>
219     <weight>bold</weight>
220    </font>
221    <left/>
222    <top/>
223    <data>
224     <query>Parameter Query</query>
225     <column>filter</column>
226    </data>
227   </text>
228  </rpthead>
229  <pghead>
230   <firstpage/>
231   <height>6</height>
232  </pghead>
233  <pghead>
234   <height>21</height>
235   <label>
236    <rect>
237     <x>665</x>
238     <y>0</y>
239     <width>80</width>
240     <height>15</height>
241    </rect>
242    <font>
243     <face>Arial</face>
244     <size>8</size>
245     <weight>normal</weight>
246    </font>
247    <hcenter/>
248    <vcenter/>
249    <string>Total</string>
250   </label>
251   <label>
252    <rect>
253     <x>270</x>
254     <y>0</y>
255     <width>80</width>
256     <height>15</height>
257    </rect>
258    <font>
259     <face>Arial</face>
260     <size>8</size>
261     <weight>normal</weight>
262    </font>
263    <hcenter/>
264    <vcenter/>
265    <string>Ord. Date</string>
266   </label>
267   <label>
268    <rect>
269     <x>110</x>
270     <y>0</y>
271     <width>100</width>
272     <height>15</height>
273    </rect>
274    <font>
275     <face>Arial</face>
276     <size>8</size>
277     <weight>normal</weight>
278    </font>
279    <left/>
280    <vcenter/>
281    <string>Invoice #</string>
282   </label>
283   <line>
284    <xstart>5</xstart>
285    <ystart>15</ystart>
286    <xend>745</xend>
287    <yend>15</yend>
288    <weight>2</weight>
289   </line>
290   <label>
291    <rect>
292     <x>355</x>
293     <y>0</y>
294     <width>80</width>
295     <height>15</height>
296    </rect>
297    <font>
298     <face>Arial</face>
299     <size>8</size>
300     <weight>normal</weight>
301    </font>
302    <hcenter/>
303    <vcenter/>
304    <string>Ship Date</string>
305   </label>
306   <label>
307    <rect>
308     <x>5</x>
309     <y>0</y>
310     <width>100</width>
311     <height>15</height>
312    </rect>
313    <font>
314     <face>Arial</face>
315     <size>8</size>
316     <weight>normal</weight>
317    </font>
318    <left/>
319    <vcenter/>
320    <string>Doc. #</string>
321   </label>
322  </pghead>
323  <section>
324   <name>detail</name>
325   <detail>
326    <key>
327     <query>detail</query>
328    </key>
329    <height>16</height>
330    <field>
331     <rect>
332      <x>5</x>
333      <y>0</y>
334      <width>100</width>
335      <height>15</height>
336     </rect>
337     <font>
338      <face>Arial</face>
339      <size>8</size>
340      <weight>bold</weight>
341     </font>
342     <left/>
343     <vcenter/>
344     <data>
345      <query>detail</query>
346      <column>cohist_ordernumber</column>
347     </data>
348    </field>
349    <field>
350     <rect>
351      <x>110</x>
352      <y>0</y>
353      <width>100</width>
354      <height>15</height>
355     </rect>
356     <font>
357      <face>Arial</face>
358      <size>8</size>
359      <weight>bold</weight>
360     </font>
361     <left/>
362     <vcenter/>
363     <data>
364      <query>detail</query>
365      <column>invoicenumber</column>
366     </data>
367    </field>
368    <field>
369     <rect>
370      <x>665</x>
371      <y>0</y>
372      <width>80</width>
373      <height>15</height>
374     </rect>
375     <font>
376      <face>Arial</face>
377      <size>8</size>
378      <weight>bold</weight>
379     </font>
380     <right/>
381     <vcenter/>
382     <data>
383      <query>detail</query>
384      <column>f_baseextprice</column>
385     </data>
386    </field>
387    <field>
388     <rect>
389      <x>355</x>
390      <y>0</y>
391      <width>80</width>
392      <height>15</height>
393     </rect>
394     <font>
395      <face>Arial</face>
396      <size>8</size>
397      <weight>bold</weight>
398     </font>
399     <hcenter/>
400     <vcenter/>
401     <data>
402      <query>detail</query>
403      <column>f_invcdate</column>
404     </data>
405    </field>
406    <field>
407     <rect>
408      <x>270</x>
409      <y>0</y>
410      <width>80</width>
411      <height>15</height>
412     </rect>
413     <font>
414      <face>Arial</face>
415      <size>8</size>
416      <weight>bold</weight>
417     </font>
418     <hcenter/>
419     <vcenter/>
420     <data>
421      <query>detail</query>
422      <column>f_orderdate</column>
423     </data>
424    </field>
425   </detail>
426  </section>
427  <pgfoot>
428   <height>16</height>
429   <label>
430    <rect>
431     <x>0</x>
432     <y>0</y>
433     <width>100</width>
434     <height>15</height>
435    </rect>
436    <font>
437     <face>Arial</face>
438     <size>8</size>
439     <weight>normal</weight>
440    </font>
441    <right/>
442    <vcenter/>
443    <string>Report Date:</string>
444   </label>
445   <field>
446    <rect>
447     <x>705</x>
448     <y>0</y>
449     <width>40</width>
450     <height>15</height>
451    </rect>
452    <font>
453     <face>Arial</face>
454     <size>8</size>
455     <weight>bold</weight>
456    </font>
457    <left/>
458    <vcenter/>
459    <data>
460     <query>Context Query</query>
461     <column>page_number</column>
462    </data>
463   </field>
464   <field>
465    <rect>
466     <x>103</x>
467     <y>0</y>
468     <width>100</width>
469     <height>15</height>
470    </rect>
471    <font>
472     <face>Arial</face>
473     <size>8</size>
474     <weight>bold</weight>
475    </font>
476    <left/>
477    <vcenter/>
478    <data>
479     <query>Context Query</query>
480     <column>report_date</column>
481    </data>
482   </field>
483   <label>
484    <rect>
485     <x>600</x>
486     <y>0</y>
487     <width>100</width>
488     <height>15</height>
489    </rect>
490    <font>
491     <face>Arial</face>
492     <size>8</size>
493     <weight>normal</weight>
494    </font>
495    <right/>
496    <vcenter/>
497    <string>Page:</string>
498   </label>
499  </pgfoot>
500  <rptfoot>
501   <height>21</height>
502   <label>
503    <rect>
504     <x>575</x>
505     <y>0</y>
506     <width>80</width>
507     <height>15</height>
508    </rect>
509    <font>
510     <face>Arial</face>
511     <size>8</size>
512     <weight>normal</weight>
513    </font>
514    <right/>
515    <vcenter/>
516    <string>Total:</string>
517   </label>
518   <field>
519    <rect>
520     <x>665</x>
521     <y>0</y>
522     <width>80</width>
523     <height>15</height>
524    </rect>
525    <font>
526     <face>Arial</face>
527     <size>8</size>
528     <weight>bold</weight>
529    </font>
530    <right/>
531    <vcenter/>
532    <data>
533     <query>detail</query>
534     <column>baseextprice</column>
535    </data>
536    <format builtin="true">money</format>
537    <tracktotal/>
538   </field>
539  </rptfoot>
540 </report>