invoice.xaction 5.81 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
<?xml version="1.0" encoding="UTF-8"?>
<action-sequence> 
  <name>invoice.xaction</name>
  <title>%title</title>
  <version>1</version>
  <logging-level>ERROR</logging-level>
  <documentation> 
    <author>Kurtis Cruzada</author>  
    <description>%description</description>  
    <icon>invoice.png</icon>  
    <help/>  
    <result-type>report</result-type> 
  </documentation>

  <inputs> 
    <output-type type="string"> 
      <default-value>pdf</default-value>  
      <sources> 
        <request>type</request> 
      </sources> 
    </output-type>  
    <customer type="string"> 
      <default-value>Reims Collectables</default-value>  
      <sources> 
        <request>customer</request> 
      </sources> 
    </customer>  
    <output-type-list type="property-map-list"> 
      <sources> 
        <runtime>output-type-list</runtime> 
      </sources>  
      <default-value type="property-map-list"> 
        <property-map> 
          <entry key="report-output-desc">PDF</entry>  
          <entry key="report-output-type-id">pdf</entry> 
        </property-map>  
        <property-map> 
          <entry key="report-output-desc">Excel</entry>  
          <entry key="report-output-type-id">xls</entry> 
        </property-map>  
        <property-map> 
          <entry key="report-output-desc">Web Page</entry>  
          <entry key="report-output-type-id">html</entry> 
        </property-map> 
      </default-value> 
    </output-type-list> 
  </inputs>

  <outputs> 
    <NoData type="string"> 
      <destinations> 
        <response>NoData</response> 
      </destinations> 
    </NoData> 
  </outputs>

  <resources> 
    <report-definition> 
      <solution-file> 
        <location>invoice.xml</location>  
        <mime-type>text/xml</mime-type> 
      </solution-file> 
    </report-definition> 
  </resources>
  
  <actions> 
    <action-definition> 
      <component-name>SQLLookupRule</component-name>
      <action-type>Get Customer List</action-type>
      <action-outputs> 
        <query-result type="result-set" mapping="customer_list"/>  
        <customernumber type="string"/>
        <customername type="string"/>
      </action-outputs>
      <component-definition> 
        <jndi>SampleData</jndi>  
        <query><![CDATA[select customernumber, customername from CUSTOMERS order by customername asc]]></query> 
      </component-definition> 
    </action-definition>
  
    <action-definition> 
      <component-name>SecureFilterComponent</component-name>
      <action-type>Prompt for Customer and Report Format</action-type>
      <action-inputs> 
        <customer type="string"/>  
        <customer_list type="property-map-list"/>  
        <output-type type="string"/>  
        <output-type-list type="property-map-list"/> 
      </action-inputs>
      <component-definition> 
        <selections> 
          <customer style="check-multi-scroll-4-column"> 
            <filter value-col-name="customernumber" display-col-name="customername">customer_list</filter>  
            <title>Customer</title> 
          </customer>  
          <output-type style="radio"> 
            <title>Report Output</title>  
            <filter value-col-name="report-output-type-id" display-col-name="report-output-desc">output-type-list</filter> 
          </output-type> 
        </selections> 
      </component-definition> 
    </action-definition>
  
    <action-definition> 
      <component-name>SQLLookupRule</component-name>
      <action-type>Get Data</action-type>
      <action-inputs> 
        <customer type="string"/> 
      </action-inputs>
      <action-outputs> 
        <query-result type="result-set" mapping="queryResult"/> 
      </action-outputs>
      <component-definition> 
        <jndi>SampleData</jndi>  
        <live>true</live>  
        <query><![CDATA[SELECT CUSTOMERS.CUSTOMERNAME, CUSTOMERS.ADDRESSLINE1, CUSTOMERS.ADDRESSLINE2, CUSTOMERS.CITY, CUSTOMERS.STATE, CUSTOMERS.POSTALCODE, CUSTOMERS.COUNTRY, CUSTOMERS.SALESREPEMPLOYEENUMBER, CUSTOMERS.CONTACTFIRSTNAME, CUSTOMERS.CONTACTLASTNAME, ORDERS.STATUS, ORDERS.CUSTOMERNUMBER, ORDERS.ORDERNUMBER, ORDERS.ORDERDATE, ORDERDETAILS.ORDERLINENUMBER, PRODUCTS.PRODUCTNAME, ORDERDETAILS.QUANTITYORDERED, ORDERDETAILS.PRODUCTCODE, ORDERDETAILS.PRICEEACH, PRODUCTS.QUANTITYINSTOCK, (ORDERDETAILS.QUANTITYORDERED*ORDERDETAILS.PRICEEACH) SOLD_PRICE FROM ORDERS, ORDERDETAILS, PRODUCTS, CUSTOMERS  WHERE CUSTOMERS.CUSTOMERNUMBER IN ({PREPARE:customer}) AND ( ORDERS.ORDERNUMBER = ORDERDETAILS.ORDERNUMBER AND PRODUCTS.PRODUCTCODE = ORDERDETAILS.PRODUCTCODE AND ORDERS.CUSTOMERNUMBER = CUSTOMERS.CUSTOMERNUMBER ) ORDER BY CUSTOMERS.CUSTOMERNAME ASC, ORDERS.ORDERNUMBER ASC, ORDERDETAILS.ORDERLINENUMBER ASC]]></query> 
      </component-definition> 
    </action-definition>
  
    <actions> 
      <condition><![CDATA[queryResult.getRowCount() > 0]]></condition>  
      <action-definition> 
        <component-name>JFreeReportComponent</component-name>
        <action-type>Run Report</action-type>
        <action-inputs> 
          <output-type type="string"/>  
          <customer type="string"/>  
          <data type="result-set" mapping="queryResult"/> 
        </action-inputs>
        <action-resources> 
          <report-definition type="resource"/> 
        </action-resources>
        <component-definition/> 
      </action-definition>
 
    </actions>
  
    <actions> 
      <condition><![CDATA[queryResult.getRowCount()==0]]></condition>  
      <action-definition> 
        <component-name>TemplateComponent</component-name>
        <action-type>Prompt No Data Message</action-type>
        <action-outputs> 
          <output-message type="string" mapping="NoData"/> 
        </action-outputs>
        <component-definition> 
          <template><![CDATA[There is no data on this customer.]]></template> 
        </component-definition> 
      </action-definition>
 
    </actions>
 
  </actions> 
</action-sequence>