3 <title>Inventory Availability by Source Vendor</title>
4 <name>InventoryAvailabilityBySourceVendor</name>
5 <description></description>
14 <topmargin>50</topmargin>
15 <bottommargin>50</bottommargin>
16 <rightmargin>50</rightmargin>
17 <leftmargin>50</leftmargin>
20 <sql>SELECT <? if exists("byDays") ?>
21 (text('Look ahead ') || text(<? value("byDays") ?>) || text(' days'))
22 <? elseif exists("byDate") ?>
23 (text('Cutoff date ') || formatDate(<? value("byDate") ?>))
24 <? elseif exists("byDates") ?>
25 (text('Dates from ') || formatDate(<? value("startDate") ?>) || text(' to ') || formatDate(<? value("endDate") ?>))
27 text('Item Site Lead Time')
33 <sql>SELECT item_number,
39 formatQty(qtyonhand) AS f_qtyonhand,
40 formatQty(noNeg(qtyonhand - allocated)) AS f_unallocated,
41 formatQty(noNeg(allocated)) AS f_allocated,
42 formatQty(ordered) AS f_ordered,
43 formatQty(reorderlevel) AS f_reorderlevel,
44 formatQty(outlevel) AS f_outlevel,
45 (qtyonhand - allocated + ordered) AS available,
46 formatQty(qtyonhand - allocated + ordered) AS f_available
48 <? if reExists("[vV]end") ?>
52 CASE WHEN (item_type IN ('P', 'O')) THEN 1
53 WHEN (item_type IN ('M')) THEN 2
56 item_number, item_descrip1, item_descrip2, item_inv_uom_id,
57 warehous_id, warehous_code, itemsite_leadtime,
58 qtyAvailable(itemsite_id) AS qtyonhand,
59 CASE WHEN itemsite_useparams THEN itemsite_reorderlevel
62 CASE WHEN itemsite_useparams THEN itemsite_ordertoqty
65 <? if exists("byVend") ?>
70 <? if exists("byLeadTime") ?>
71 qtyAllocated(itemsite_id, itemsite_leadtime) AS allocated,
72 qtyOrdered(itemsite_id, itemsite_leadtime) AS ordered,
73 qtypr(itemsite_id, itemsite_leadtime) AS requests
74 <? elseif exists("byDays") ?>
75 qtyAllocated(itemsite_id, CAST(<? value("byDays") ?> AS INTEGER)) AS allocated,
76 qtyOrdered(itemsite_id, CAST(<? value("byDays") ?> AS INTEGER)) AS ordered,
77 qtypr(itemsite_id, CAST(<? value("byDays") ?> AS INTEGER)) AS requests
78 <? elseif exists("byDate") ?>
79 qtyAllocated(itemsite_id, (<? value("byDate") ?> - CURRENT_DATE)) AS allocated,
80 qtyOrdered(itemsite_id, (<? value("byDate") ?> - CURRENT_DATE)) AS ordered,
81 qtypr(itemsite_id, (<? value("byDate") ?> - CURRENT_DATE)) AS requests
82 <? elseif exists("byDates") ?>
83 qtyAllocated(itemsite_id, <? value("startDate") ?>, <? value("endDate") ?>) AS allocated,
84 qtyOrdered(itemsite_id, <? value("startDate") ?>, <? value("endDate") ?>) AS ordered,
85 qtypr(itemsite_id, <? value("startDate") ?>, <? value("endDate") ?>) AS requests
87 FROM item, itemsite, whsinfo
88 <? if reExists("[vV]end") ?>
89 , vendinfo JOIN itemsrc ON (itemsrc_vend_id=vend_id)
91 WHERE ( (itemsite_active)
92 AND (itemsite_item_id=item_id)
93 AND (itemsite_warehous_id=warehous_id)
94 <? if exists("warehous_id") ?>
95 AND (warehous_id=<? value("warehous_id") ?>)
97 <? if exists("item_id") ?>
98 AND (item_id=<? value("item_id") ?>)
99 <? elseif exists("classcode_id") ?>
100 AND (item_classcode_id=<? value("classcode_id") ?>)
101 <? elseif exists("classcode_pattern") ?>
102 AND (item_classcode_id IN (SELECT classcode_id
104 WHERE (classcode_code ~ <? value("classcode_pattern") ?>)))
105 <? elseif exists("plancode_id") ?>
106 AND (itemsite_plancode_id=<? value("plancode_id") ?>)
107 <? elseif exists("plancode_pattern") ?>
108 AND (itemsite_plancode_id IN (SELECT plancode_id
110 WHERE (plancode_code ~ <? value("plancode_pattern") ?>)))
111 <? elseif exists("itemgrp_id") ?>
112 AND (item_id IN (SELECT itemgrpitem_item_id
114 WHERE (itemgrpitem_itemgrp_id=<? value("itemgrp_id") ?>)))
115 <? elseif exists("itemgrp_pattern") ?>
116 AND (item_id IN (SELECT itemgrpitem_item_id
117 FROM itemgrpitem, itemgrp
118 WHERE ( (itemgrpitem_itemgrp_id=itemgrp_id)
119 AND (itemgrp_name ~ <? value("itemgrp_pattern") ?>) ) ))
120 <? elseif exists("itemgrp") ?>
121 AND (item_id IN (SELECT DISTINCT itemgrpitem_item_id FROM itemgrpitem))
123 <? if reExists("[vV]end") ?>
124 AND (itemsrc_item_id=item_id)
126 <? if exists("vend_id") ?>
127 AND (vend_id=<? value("vend_id") ?>)
128 <? elseif exists("vendtype_id") ?>
129 AND (vend_vendtype_id=<? value("vendtype_id") ?>)
130 <? elseif exists("vendtype_pattern") ?>
131 AND (vend_vendtype_id IN (SELECT vendtype_id
133 WHERE (vendtype_code ~ <? value("vendtype_pattern") ?>)))
136 <? if exists("showReorder") ?>
137 WHERE ( ((qtyonhand - allocated + ordered) <= reorderlevel)
138 <? if exists("ignoreReorderAtZero") ?>
139 AND (NOT ( ((qtyonhand - allocated + ordered) = 0) AND (reorderlevel = 0)))
142 <? elseif exists("showShortages") ?>
143 WHERE ((qtyonhand - allocated + ordered) < 0)
145 ORDER BY vend_number, item_number, warehous_code DESC;</sql>
159 <weight>normal</weight>
175 <weight>normal</weight>
179 <string>Site</string>
191 <weight>normal</weight>
195 <string>Allocated</string>
207 <weight>normal</weight>
211 <string>On Order</string>
230 <weight>normal</weight>
234 <string>Available</string>
246 <weight>bold</weight>
250 <string>Inventory Availability by Source Vendor</string>
262 <weight>bold</weight>
268 <column>ltcriteria</column>
281 <weight>normal</weight>
297 <weight>normal</weight>
301 <string>OUT Level</string>
313 <weight>normal</weight>
317 <string>Unallocated</string>
329 <weight>normal</weight>
333 <string>Reorder Level</string>
345 <weight>normal</weight>
349 <string>Vendor #</string>
361 <weight>normal</weight>
365 <string>Item Number</string>
377 <weight>normal</weight>
381 <string>Availability as of: </string>
393 <weight>normal</weight>
397 <string>Description</string>
406 <bottompad>12</bottompad>
410 <weight>bold</weight>
415 <query>Parameter Query</query>
416 <column>filter</column>
436 <weight>normal</weight>
440 <string>On Order</string>
452 <weight>normal</weight>
456 <string>Item Number</string>
468 <weight>normal</weight>
484 <weight>normal</weight>
500 <weight>normal</weight>
504 <string>OUT Level</string>
516 <weight>normal</weight>
520 <string>Allocated</string>
532 <weight>normal</weight>
536 <string>Unallocated</string>
548 <weight>normal</weight>
552 <string>Reorder Level</string>
571 <weight>normal</weight>
575 <string>Site</string>
587 <weight>normal</weight>
591 <string>Description</string>
603 <weight>normal</weight>
607 <string>Vendor #</string>
619 <weight>normal</weight>
623 <string>Available</string>
630 <query>detail</query>
643 <weight>bold</weight>
648 <query>detail</query>
649 <column>f_available</column>
662 <weight>bold</weight>
667 <query>detail</query>
668 <column>f_qtyonhand</column>
681 <weight>bold</weight>
686 <query>detail</query>
687 <column>item_number</column>
700 <weight>bold</weight>
705 <query>detail</query>
706 <column>vend_number</column>
719 <weight>bold</weight>
724 <query>detail</query>
725 <column>f_reorderlevel</column>
738 <weight>bold</weight>
743 <query>detail</query>
744 <column>f_outlevel</column>
757 <weight>bold</weight>
762 <query>detail</query>
763 <column>itemsite_leadtime</column>
776 <weight>bold</weight>
781 <query>detail</query>
782 <column>f_allocated</column>
795 <weight>bold</weight>
800 <query>detail</query>
801 <column>f_ordered</column>
814 <weight>bold</weight>
819 <query>detail</query>
820 <column>item_descrip1</column>
833 <weight>bold</weight>
838 <query>detail</query>
839 <column>item_descrip2</column>
859 <weight>bold</weight>
864 <query>detail</query>
865 <column>f_unallocated</column>
878 <weight>bold</weight>
883 <query>detail</query>
884 <column>warehous_code</column>
901 <weight>bold</weight>
906 <query>Context Query</query>
907 <column>page_number</column>
920 <weight>bold</weight>
925 <query>Context Query</query>
926 <column>report_date</column>
939 <weight>normal</weight>
943 <string>Report Date:</string>
955 <weight>normal</weight>
959 <string>Page:</string>