Merge pull request #1609 from xtuple/4_5_x
[xtuple] / foundation-database / public / tables / report / ItemCostsByClassCode.xml
1 <!DOCTYPE openRPTDef>
2 <report>
3  <title>Item Costs By Class Code</title>
4  <name>ItemCostsByClassCode</name>
5  <description></description>
6  <size>Letter</size>
7  <portrait/>
8  <topmargin>50</topmargin>
9  <bottommargin>50</bottommargin>
10  <rightmargin>50</rightmargin>
11  <leftmargin>50</leftmargin>
12  <querysource>
13   <name>head</name>
14   <sql>SELECT &lt;? if exists("classcode_id") ?>
15          ( SELECT (classcode_code || '-' || classcode_descrip)
16              FROM classcode
17             WHERE (classcode_id=&lt;? value("classcode_id") ?>) )
18        &lt;? elseif exists("classcode_pattern") ?>
19          text(&lt;? value("classcode_pattern") ?>)
20        &lt;? else ?>
21          text('All Class Codes')
22        &lt;? endif ?>
23        AS classcode;</sql>
24  </querysource>
25  <querysource>
26   <name>detail</name>
27   <sql>SELECT item_id,
28        item_number,
29        item_descrip1,
30        item_descrip2,
31        uom_name as f_uom,
32        formatCost(scost) as f_stdcost,
33        formatCost(acost) as f_actcost,
34        classcode_code
35   FROM ( SELECT item_id,
36                 item_number,
37                 item_descrip1,
38                 item_descrip2,
39                 uom_name,
40                 stdcost(item_id) AS scost,
41                 actcost(item_id) AS acost,
42                 classcode_code
43            FROM item, classcode, uom
44           WHERE ((item_classcode_id=classcode_id)
45             AND (item_inv_uom_id=uom_id)
46           &lt;? if exists("classcode_id") ?>
47             AND (classcode_id=&lt;? value("classcode_id") ?>)
48           &lt;? elseif exists("classcode_pattern") ?>
49             AND (classcode_code ~ &lt;? value("classcode_pattern") ?>)
50           &lt;? endif ?>
51           )
52        ) AS data
53  WHERE ( (true)
54 &lt;? if exists("onlyShowZeroCosts") ?>
55    AND ((scost=0) OR (acost=0))
56 &lt;? endif ?>
57 &lt;? if exists("onlyShowDiffCosts") ?>
58    AND (scost != acost)
59 &lt;? endif ?>
60  )
61 ORDER BY item_number</sql>
62  </querysource>
63  <rpthead>
64   <height>234</height>
65   <label>
66    <rect>
67     <x>10</x>
68     <y>120</y>
69     <width>104</width>
70     <height>20</height>
71    </rect>
72    <font>
73     <face>Arial</face>
74     <size>10</size>
75     <weight>normal</weight>
76    </font>
77    <right/>
78    <vcenter/>
79    <string>Class Code(s):</string>
80   </label>
81   <label>
82    <rect>
83     <x>5</x>
84     <y>200</y>
85     <width>55</width>
86     <height>15</height>
87    </rect>
88    <font>
89     <face>Arial</face>
90     <size>8</size>
91     <weight>normal</weight>
92    </font>
93    <hcenter/>
94    <vcenter/>
95    <string>Class Code</string>
96   </label>
97   <label>
98    <rect>
99     <x>70</x>
100     <y>215</y>
101     <width>228</width>
102     <height>15</height>
103    </rect>
104    <font>
105     <face>Arial</face>
106     <size>8</size>
107     <weight>normal</weight>
108    </font>
109    <left/>
110    <vcenter/>
111    <string>Item Description</string>
112   </label>
113   <label>
114    <rect>
115     <x>345</x>
116     <y>10</y>
117     <width>380</width>
118     <height>40</height>
119    </rect>
120    <font>
121     <face>Arial</face>
122     <size>18</size>
123     <weight>bold</weight>
124    </font>
125    <right/>
126    <vcenter/>
127    <string>Item Costs by Class Code</string>
128   </label>
129   <label>
130    <rect>
131     <x>400</x>
132     <y>200</y>
133     <width>100</width>
134     <height>15</height>
135    </rect>
136    <font>
137     <face>Arial</face>
138     <size>8</size>
139     <weight>normal</weight>
140    </font>
141    <hcenter/>
142    <vcenter/>
143    <string>UOM</string>
144   </label>
145   <line>
146    <xstart>5</xstart>
147    <ystart>228</ystart>
148    <xend>745</xend>
149    <yend>228</yend>
150    <weight>2</weight>
151   </line>
152   <label>
153    <rect>
154     <x>600</x>
155     <y>200</y>
156     <width>100</width>
157     <height>15</height>
158    </rect>
159    <font>
160     <face>Arial</face>
161     <size>8</size>
162     <weight>normal</weight>
163    </font>
164    <hcenter/>
165    <vcenter/>
166    <string>Actual Cost</string>
167   </label>
168   <label>
169    <rect>
170     <x>70</x>
171     <y>200</y>
172     <width>228</width>
173     <height>15</height>
174    </rect>
175    <font>
176     <face>Arial</face>
177     <size>8</size>
178     <weight>normal</weight>
179    </font>
180    <left/>
181    <vcenter/>
182    <string>Item Number</string>
183   </label>
184   <field>
185    <rect>
186     <x>120</x>
187     <y>120</y>
188     <width>565</width>
189     <height>20</height>
190    </rect>
191    <font>
192     <face>Arial</face>
193     <size>10</size>
194     <weight>bold</weight>
195    </font>
196    <left/>
197    <vcenter/>
198    <data>
199     <query>head</query>
200     <column>classcode</column>
201    </data>
202   </field>
203   <label>
204    <rect>
205     <x>500</x>
206     <y>200</y>
207     <width>100</width>
208     <height>15</height>
209    </rect>
210    <font>
211     <face>Arial</face>
212     <size>8</size>
213     <weight>normal</weight>
214    </font>
215    <hcenter/>
216    <vcenter/>
217    <string>Standard Cost</string>
218   </label>
219  </rpthead>
220  <pghead>
221   <firstpage/>
222   <height>6</height>
223  </pghead>
224  <pghead>
225   <height>36</height>
226   <label>
227    <rect>
228     <x>600</x>
229     <y>0</y>
230     <width>100</width>
231     <height>15</height>
232    </rect>
233    <font>
234     <face>Arial</face>
235     <size>8</size>
236     <weight>normal</weight>
237    </font>
238    <hcenter/>
239    <vcenter/>
240    <string>Actual Cost</string>
241   </label>
242   <label>
243    <rect>
244     <x>500</x>
245     <y>0</y>
246     <width>100</width>
247     <height>15</height>
248    </rect>
249    <font>
250     <face>Arial</face>
251     <size>8</size>
252     <weight>normal</weight>
253    </font>
254    <hcenter/>
255    <vcenter/>
256    <string>Standard Cost</string>
257   </label>
258   <label>
259    <rect>
260     <x>5</x>
261     <y>0</y>
262     <width>55</width>
263     <height>15</height>
264    </rect>
265    <font>
266     <face>Arial</face>
267     <size>8</size>
268     <weight>normal</weight>
269    </font>
270    <hcenter/>
271    <vcenter/>
272    <string>Class Code</string>
273   </label>
274   <label>
275    <rect>
276     <x>70</x>
277     <y>15</y>
278     <width>228</width>
279     <height>15</height>
280    </rect>
281    <font>
282     <face>Arial</face>
283     <size>8</size>
284     <weight>normal</weight>
285    </font>
286    <left/>
287    <vcenter/>
288    <string>Item Description</string>
289   </label>
290   <label>
291    <rect>
292     <x>400</x>
293     <y>0</y>
294     <width>100</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>UOM</string>
305   </label>
306   <line>
307    <xstart>5</xstart>
308    <ystart>30</ystart>
309    <xend>745</xend>
310    <yend>30</yend>
311    <weight>2</weight>
312   </line>
313   <label>
314    <rect>
315     <x>70</x>
316     <y>0</y>
317     <width>228</width>
318     <height>15</height>
319    </rect>
320    <font>
321     <face>Arial</face>
322     <size>8</size>
323     <weight>normal</weight>
324    </font>
325    <left/>
326    <vcenter/>
327    <string>Item Number</string>
328   </label>
329  </pghead>
330  <section>
331   <name>detail</name>
332   <detail>
333    <key>
334     <query>detail</query>
335    </key>
336    <height>51</height>
337    <field>
338     <rect>
339      <x>400</x>
340      <y>0</y>
341      <width>100</width>
342      <height>15</height>
343     </rect>
344     <font>
345      <face>Arial</face>
346      <size>8</size>
347      <weight>bold</weight>
348     </font>
349     <hcenter/>
350     <vcenter/>
351     <data>
352      <query>detail</query>
353      <column>f_uom</column>
354     </data>
355    </field>
356    <field>
357     <rect>
358      <x>500</x>
359      <y>0</y>
360      <width>100</width>
361      <height>15</height>
362     </rect>
363     <font>
364      <face>Arial</face>
365      <size>8</size>
366      <weight>bold</weight>
367     </font>
368     <right/>
369     <vcenter/>
370     <data>
371      <query>detail</query>
372      <column>f_stdcost</column>
373     </data>
374    </field>
375    <line>
376     <xstart>5</xstart>
377     <ystart>45</ystart>
378     <xend>745</xend>
379     <yend>45</yend>
380     <weight>0</weight>
381    </line>
382    <field>
383     <rect>
384      <x>5</x>
385      <y>0</y>
386      <width>55</width>
387      <height>15</height>
388     </rect>
389     <font>
390      <face>Arial</face>
391      <size>8</size>
392      <weight>bold</weight>
393     </font>
394     <hcenter/>
395     <vcenter/>
396     <data>
397      <query>detail</query>
398      <column>classcode_code</column>
399     </data>
400    </field>
401    <field>
402     <rect>
403      <x>70</x>
404      <y>0</y>
405      <width>228</width>
406      <height>15</height>
407     </rect>
408     <font>
409      <face>Arial</face>
410      <size>8</size>
411      <weight>bold</weight>
412     </font>
413     <left/>
414     <vcenter/>
415     <data>
416      <query>detail</query>
417      <column>item_number</column>
418     </data>
419    </field>
420    <field>
421     <rect>
422      <x>70</x>
423      <y>30</y>
424      <width>228</width>
425      <height>15</height>
426     </rect>
427     <font>
428      <face>Arial</face>
429      <size>8</size>
430      <weight>bold</weight>
431     </font>
432     <left/>
433     <vcenter/>
434     <data>
435      <query>detail</query>
436      <column>item_descrip2</column>
437     </data>
438    </field>
439    <field>
440     <rect>
441      <x>70</x>
442      <y>15</y>
443      <width>228</width>
444      <height>15</height>
445     </rect>
446     <font>
447      <face>Arial</face>
448      <size>8</size>
449      <weight>bold</weight>
450     </font>
451     <left/>
452     <vcenter/>
453     <data>
454      <query>detail</query>
455      <column>item_descrip1</column>
456     </data>
457    </field>
458    <field>
459     <rect>
460      <x>600</x>
461      <y>0</y>
462      <width>100</width>
463      <height>15</height>
464     </rect>
465     <font>
466      <face>Arial</face>
467      <size>8</size>
468      <weight>bold</weight>
469     </font>
470     <right/>
471     <vcenter/>
472     <data>
473      <query>detail</query>
474      <column>f_actcost</column>
475     </data>
476    </field>
477   </detail>
478  </section>
479  <pgfoot>
480   <height>16</height>
481   <label>
482    <rect>
483     <x>615</x>
484     <y>0</y>
485     <width>85</width>
486     <height>15</height>
487    </rect>
488    <font>
489     <face>Arial</face>
490     <size>8</size>
491     <weight>normal</weight>
492    </font>
493    <right/>
494    <vcenter/>
495    <string>Page:</string>
496   </label>
497   <label>
498    <rect>
499     <x>5</x>
500     <y>0</y>
501     <width>85</width>
502     <height>15</height>
503    </rect>
504    <font>
505     <face>Arial</face>
506     <size>8</size>
507     <weight>normal</weight>
508    </font>
509    <right/>
510    <vcenter/>
511    <string>Report Date:</string>
512   </label>
513   <field>
514    <rect>
515     <x>705</x>
516     <y>0</y>
517     <width>40</width>
518     <height>15</height>
519    </rect>
520    <font>
521     <face>Arial</face>
522     <size>8</size>
523     <weight>bold</weight>
524    </font>
525    <left/>
526    <vcenter/>
527    <data>
528     <query>Context Query</query>
529     <column>page_number</column>
530    </data>
531   </field>
532   <field>
533    <rect>
534     <x>95</x>
535     <y>0</y>
536     <width>100</width>
537     <height>15</height>
538    </rect>
539    <font>
540     <face>Arial</face>
541     <size>8</size>
542     <weight>bold</weight>
543    </font>
544    <left/>
545    <vcenter/>
546    <data>
547     <query>Context Query</query>
548     <column>report_date</column>
549    </data>
550   </field>
551  </pgfoot>
552 </report>