<!DOCTYPE openRPTDef>
<report>
 <title>Sales Account Assignments Master List</title>
 <name>SalesAccountAssignmentsMasterList</name>
 <description></description>
 <size>Letter</size>
 <portrait/>
 <topmargin>50</topmargin>
 <bottommargin>50</bottommargin>
 <rightmargin>50</rightmargin>
 <leftmargin>50</leftmargin>
 <querysource>
  <name>detail</name>
  <sql>SELECT salesaccnt_id,
       CASE WHEN salesaccnt_warehous_id=-1 THEN 'Any'::TEXT
            ELSE (SELECT warehous_code FROM whsinfo WHERE (warehous_id=salesaccnt_warehous_id))
       END AS warehouscode,
       CASE WHEN salesaccnt_custtype_id=-1 THEN salesaccnt_custtype
            ELSE (SELECT custtype_code FROM custtype WHERE (custtype_id=salesaccnt_custtype_id))
       END AS custtypecode,
       CASE WHEN salesaccnt_prodcat_id=-1 THEN salesaccnt_prodcat
            ELSE (SELECT prodcat_code FROM prodcat WHERE (prodcat_id=salesaccnt_prodcat_id))
       END AS prodcatcode,
       formatGLAccount(salesaccnt_sales_accnt_id) AS salesaccnt,
       formatGLAccount(salesaccnt_credit_accnt_id) AS creditaccnt,
       formatGLAccount(salesaccnt_cos_accnt_id) AS costaccnt,
       formatGLAccount(salesaccnt_returns_accnt_id) AS returnsaccnt,
       formatGLAccount(salesaccnt_cor_accnt_id) AS coraccnt,
       formatGLAccount(salesaccnt_cow_accnt_id) AS cowaccnt
  FROM salesaccnt
ORDER BY warehouscode, custtypecode, prodcatcode;</sql>
 </querysource>
 <rpthead>
  <height>87</height>
  <line>
   <xstart>0</xstart>
   <ystart>81</ystart>
   <xend>740</xend>
   <yend>81</yend>
   <weight>2</weight>
  </line>
  <label>
   <rect>
    <x>315</x>
    <y>66</y>
    <width>75</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Credit Accnt:</string>
  </label>
  <label>
   <rect>
    <x>230</x>
    <y>66</y>
    <width>75</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Sales Accnt:</string>
  </label>
  <label>
   <rect>
    <x>215</x>
    <y>10</y>
    <width>530</width>
    <height>38</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>18</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Sales Account Assignments Master List</string>
  </label>
  <label>
   <rect>
    <x>65</x>
    <y>66</y>
    <width>80</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Customer Type:</string>
  </label>
  <label>
   <rect>
    <x>400</x>
    <y>66</y>
    <width>75</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>COS Accnt:</string>
  </label>
  <label>
   <rect>
    <x>155</x>
    <y>66</y>
    <width>65</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Product Cat:</string>
  </label>
  <label>
   <rect>
    <x>5</x>
    <y>65</y>
    <width>50</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Site:</string>
  </label>
  <label>
   <rect>
    <x>485</x>
    <y>66</y>
    <width>75</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Returns Accnt:</string>
  </label>
  <label>
   <rect>
    <x>570</x>
    <y>66</y>
    <width>75</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>COR Accnt:</string>
  </label>
  <label>
   <rect>
    <x>655</x>
    <y>66</y>
    <width>80</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>COW Accnt:</string>
  </label>
 </rpthead>
 <pghead>
  <firstpage/>
  <height>7</height>
 </pghead>
 <pghead>
  <height>27</height>
  <line>
   <xstart>5</xstart>
   <ystart>20</ystart>
   <xend>745</xend>
   <yend>20</yend>
   <weight>2</weight>
  </line>
  <label>
   <rect>
    <x>5</x>
    <y>3</y>
    <width>45</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Site:</string>
  </label>
  <label>
   <rect>
    <x>65</x>
    <y>3</y>
    <width>80</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Customer Type:</string>
  </label>
  <label>
   <rect>
    <x>150</x>
    <y>3</y>
    <width>65</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Product Cat:</string>
  </label>
  <label>
   <rect>
    <x>230</x>
    <y>3</y>
    <width>75</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Sales Accnt:</string>
  </label>
  <label>
   <rect>
    <x>315</x>
    <y>3</y>
    <width>75</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Credit Accnt:</string>
  </label>
  <label>
   <rect>
    <x>400</x>
    <y>3</y>
    <width>75</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>COS Accnt:</string>
  </label>
  <label>
   <rect>
    <x>485</x>
    <y>3</y>
    <width>75</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Returns Accnt:</string>
  </label>
  <label>
   <rect>
    <x>570</x>
    <y>3</y>
    <width>75</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>COR Accnt:</string>
  </label>
  <label>
   <rect>
    <x>655</x>
    <y>3</y>
    <width>80</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>COW Accnt:</string>
  </label>
 </pghead>
 <section>
  <name>detail</name>
  <detail>
   <key>
    <query>detail</query>
   </key>
   <height>17</height>
   <field>
    <rect>
     <x>230</x>
     <y>-1</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>salesaccnt</column>
    </data>
   </field>
   <field>
    <rect>
     <x>5</x>
     <y>0</y>
     <width>50</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>warehouscode</column>
    </data>
   </field>
   <field>
    <rect>
     <x>65</x>
     <y>-1</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>custtypecode</column>
    </data>
   </field>
   <field>
    <rect>
     <x>315</x>
     <y>-1</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>creditaccnt</column>
    </data>
   </field>
   <field>
    <rect>
     <x>150</x>
     <y>-1</y>
     <width>70</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>prodcatcode</column>
    </data>
   </field>
   <field>
    <rect>
     <x>400</x>
     <y>-1</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>costaccnt</column>
    </data>
   </field>
   <field>
    <rect>
     <x>485</x>
     <y>-1</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>returnsaccnt</column>
    </data>
   </field>
   <field>
    <rect>
     <x>570</x>
     <y>-1</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>coraccnt</column>
    </data>
   </field>
   <field>
    <rect>
     <x>655</x>
     <y>-1</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>cowaccnt</column>
    </data>
   </field>
  </detail>
 </section>
 <pgfoot>
  <height>17</height>
  <field>
   <rect>
    <x>90</x>
    <y>0</y>
    <width>100</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>Context Query</query>
    <column>report_date</column>
   </data>
  </field>
  <label>
   <rect>
    <x>0</x>
    <y>0</y>
    <width>85</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Report Date:</string>
  </label>
  <field>
   <rect>
    <x>705</x>
    <y>0</y>
    <width>40</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>Context Query</query>
    <column>page_number</column>
   </data>
  </field>
  <label>
   <rect>
    <x>610</x>
    <y>2</y>
    <width>85</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Page:</string>
  </label>
 </pgfoot>
</report>
