<!DOCTYPE openRPTDef>
<report>
 <title>AP 30 60 90 Aging Summary</title>
 <name>APAgingSummary</name>
 <description>Enhanced AP Aging - Uses 30-60-90 columns - User provides Relative Date - all amounts in base currency based on Document Date.

Vendor Summary</description>
 <parameter default="" active="true" listtype="static" type="string" name="relDate">
  <description>Date Relative to Today</description>
 </parameter>
 <grid>
  <snap/>
  <show/>
  <x>0.05</x>
  <y>0.05</y>
 </grid>
 <size>Letter</size>
 <landscape/>
 <topmargin>50</topmargin>
 <bottommargin>50</bottommargin>
 <rightmargin>50</rightmargin>
 <leftmargin>50</leftmargin>
 <querysource>
  <name>detail</name>
  <sql>SELECT 
	apaging_vend_id,
	apaging_vend_number,
	apaging_vend_name,
	apaging_vend_vendtype_id,
	apaging_vendtype_code,
	apaging_terms_descrip,
	formatMoney(SUM(apaging_apopen_amount)) AS apaging_apopen_amount,
	SUM(apaging_cur_val) AS apaging_cur_val,   formatMoney(SUM(apaging_cur_val))    AS apaging_cur_amt,
	SUM(apaging_thirty_val) AS apaging_thirty_val, formatMoney(SUM(apaging_thirty_val)) AS apaging_thirty_amt,
	SUM(apaging_sixty_val) AS apaging_sixty_val, formatMoney(SUM(apaging_sixty_val))  AS apaging_sixty_amt,
	SUM(apaging_ninety_val) AS apaging_ninety_val, formatMoney(SUM(apaging_ninety_val)) AS apaging_ninety_amt,
	SUM(apaging_plus_val) AS apaging_plus_val,  formatMoney(SUM(apaging_plus_val))   AS apaging_plus_amt,
	SUM(apaging_total_val) AS apaging_total_val, formatMoney(SUM(apaging_total_val))  AS apaging_total_amt,
	SUM(apaging_disc_val) AS apaging_disc_val,  formatMoney(SUM(apaging_disc_val))   AS apaging_disc_amt
FROM apaging(&lt;? value("relDate") ?>, &lt;? value("useDocDate") ?>)
&lt;? if exists("vend_id") ?>
   WHERE (apaging_vend_id=&lt;? value("vend_id") ?>)
&lt;? elseif exists("vendtype_id") ?>
   WHERE (apaging_vend_vendtype_id=&lt;? value("vendtype_id") ?>)
&lt;? elseif exists("vendtype_pattern") ?>
   WHERE (apaging_vendtype_code ~ &lt;? value("vendtype_pattern") ?>)
&lt;? endif ?>
GROUP BY 	apaging_vend_id,
	apaging_vend_number,
	apaging_vend_name,
	apaging_vend_vendtype_id,
	apaging_vendtype_code,
	apaging_terms_descrip;</sql>
 </querysource>
 <rpthead>
  <height>77</height>
  <label>
   <rect>
    <x>0</x>
    <y>0</y>
    <width>450</width>
    <height>31</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>bold</weight>
   </font>
   <left/>
   <top/>
   <string>Accounts Payable Aging Summary Report</string>
  </label>
  <field>
   <rect>
    <x>45</x>
    <y>35</y>
    <width>110</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>Parameter Query</query>
    <column>relDate</column>
   </data>
  </field>
  <label>
   <rect>
    <x>0</x>
    <y>35</y>
    <width>40</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <top/>
   <string>As of:</string>
  </label>
  <label>
   <rect>
    <x>530</x>
    <y>55</y>
    <width>75</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <string>0+30 Days</string>
  </label>
  <label>
   <rect>
    <x>775</x>
    <y>55</y>
    <width>75</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <string>90+ Days</string>
  </label>
  <label>
   <rect>
    <x>450</x>
    <y>55</y>
    <width>75</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <string>Current</string>
  </label>
  <label>
   <rect>
    <x>700</x>
    <y>55</y>
    <width>75</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <string>61+90 Days</string>
  </label>
  <label>
   <rect>
    <x>615</x>
    <y>55</y>
    <width>75</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <string>31+60 Days</string>
  </label>
  <label>
   <rect>
    <x>935</x>
    <y>55</y>
    <width>55</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <string>Discount</string>
  </label>
  <label>
   <rect>
    <x>370</x>
    <y>55</y>
    <width>75</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <string>Total Amt.</string>
  </label>
  <label>
   <rect>
    <x>0</x>
    <y>55</y>
    <width>75</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <top/>
   <string>Number</string>
  </label>
  <label>
   <rect>
    <x>90</x>
    <y>55</y>
    <width>75</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <top/>
   <string>Vendor</string>
  </label>
  <line>
   <xstart>1</xstart>
   <ystart>72</ystart>
   <xend>1000</xend>
   <yend>72</yend>
   <weight>2</weight>
  </line>
 </rpthead>
 <section>
  <name>detail</name>
  <detail>
   <key>
    <query>detail</query>
   </key>
   <height>18</height>
   <field>
    <rect>
     <x>935</x>
     <y>3</y>
     <width>55</width>
     <height>12</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <right/>
    <top/>
    <data>
     <query>detail</query>
     <column>apaging_disc_amt</column>
    </data>
   </field>
   <field>
    <rect>
     <x>0</x>
     <y>5</y>
     <width>80</width>
     <height>11</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <left/>
    <top/>
    <data>
     <query>detail</query>
     <column>apaging_vend_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>530</x>
     <y>5</y>
     <width>75</width>
     <height>12</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <right/>
    <top/>
    <data>
     <query>detail</query>
     <column>apaging_thirty_amt</column>
    </data>
   </field>
   <field>
    <rect>
     <x>90</x>
     <y>5</y>
     <width>265</width>
     <height>11</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <left/>
    <top/>
    <data>
     <query>detail</query>
     <column>apaging_vend_name</column>
    </data>
   </field>
   <field>
    <rect>
     <x>450</x>
     <y>5</y>
     <width>75</width>
     <height>12</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <right/>
    <top/>
    <data>
     <query>detail</query>
     <column>apaging_cur_amt</column>
    </data>
   </field>
   <field>
    <rect>
     <x>795</x>
     <y>5</y>
     <width>55</width>
     <height>12</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <right/>
    <top/>
    <data>
     <query>detail</query>
     <column>apaging_plus_amt</column>
    </data>
   </field>
   <field>
    <rect>
     <x>620</x>
     <y>5</y>
     <width>70</width>
     <height>12</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <right/>
    <top/>
    <data>
     <query>detail</query>
     <column>apaging_sixty_amt</column>
    </data>
   </field>
   <field>
    <rect>
     <x>705</x>
     <y>5</y>
     <width>70</width>
     <height>12</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <right/>
    <top/>
    <data>
     <query>detail</query>
     <column>apaging_ninety_amt</column>
    </data>
   </field>
   <field>
    <rect>
     <x>365</x>
     <y>5</y>
     <width>80</width>
     <height>11</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <right/>
    <top/>
    <data>
     <query>detail</query>
     <column>apaging_total_amt</column>
    </data>
   </field>
  </detail>
 </section>
 <pgfoot>
  <lastpage/>
  <height>102</height>
  <field>
   <rect>
    <x>340</x>
    <y>10</y>
    <width>105</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <data>
    <query>detail</query>
    <column>apaging_total_val</column>
   </data>
   <format builtin="true">qty</format>
   <tracktotal/>
  </field>
  <field>
   <rect>
    <x>620</x>
    <y>10</y>
    <width>70</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <data>
    <query>detail</query>
    <column>apaging_sixty_val</column>
   </data>
   <format builtin="true">qty</format>
   <tracktotal/>
  </field>
  <field>
   <rect>
    <x>530</x>
    <y>10</y>
    <width>75</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <data>
    <query>detail</query>
    <column>apaging_thirty_val</column>
   </data>
   <format builtin="true">qty</format>
   <tracktotal/>
  </field>
  <label>
   <rect>
    <x>450</x>
    <y>45</y>
    <width>475</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <string>All amounts are in base currency as of the document date.</string>
  </label>
  <field>
   <rect>
    <x>450</x>
    <y>10</y>
    <width>75</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <data>
    <query>detail</query>
    <column>apaging_cur_val</column>
   </data>
   <format builtin="true">qty</format>
   <tracktotal/>
  </field>
  <label>
   <rect>
    <x>450</x>
    <y>35</y>
    <width>55</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <top/>
   <string>Note:</string>
  </label>
  <label>
   <rect>
    <x>130</x>
    <y>10</y>
    <width>170</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <top/>
   <string>Total For All Vendors</string>
  </label>
  <field>
   <rect>
    <x>710</x>
    <y>10</y>
    <width>70</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <data>
    <query>detail</query>
    <column>apaging_ninety_val</column>
   </data>
   <format builtin="true">qty</format>
   <tracktotal/>
  </field>
  <field>
   <rect>
    <x>780</x>
    <y>10</y>
    <width>75</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <data>
    <query>detail</query>
    <column>apaging_plus_val</column>
   </data>
   <format builtin="true">qty</format>
   <tracktotal/>
  </field>
  <field>
   <rect>
    <x>940</x>
    <y>10</y>
    <width>55</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <top/>
   <data>
    <query>detail</query>
    <column>apaging_disc_val</column>
   </data>
   <format builtin="true">qty</format>
   <tracktotal/>
  </field>
  <label>
   <rect>
    <x>455</x>
    <y>80</y>
    <width>35</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <string>Page: </string>
  </label>
  <field>
   <rect>
    <x>515</x>
    <y>80</y>
    <width>42</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>Context Query</query>
    <column>page_number</column>
   </data>
  </field>
  <line>
   <xstart>2</xstart>
   <ystart>4</ystart>
   <xend>1001</xend>
   <yend>4</yend>
   <weight>2</weight>
  </line>
 </pgfoot>
 <pgfoot>
  <height>47</height>
  <field>
   <rect>
    <x>515</x>
    <y>23</y>
    <width>42</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>Context Query</query>
    <column>page_number</column>
   </data>
  </field>
  <label>
   <rect>
    <x>455</x>
    <y>23</y>
    <width>35</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <string>Page: </string>
  </label>
 </pgfoot>
</report>
