#3936 Add missing commented CRM2 entries for the financials component
[opentaps:opentaps.git] / opentaps / financials / widget / financials / screens / invoices / InvoiceScreens.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Copyright (c) Open Source Strategies, Inc.
4  *
5  * Opentaps is free software: you can redistribute it and/or modify it
6  * under the terms of the GNU Affero General Public License as published
7  * by the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * Opentaps is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with Opentaps.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  *  @author Leon Torres (leon@opensourcestrategies.com)
19 -->
20
21 <!-- This file contains all the invoice specific screens for the various types of invoices, such as find and view invoice. -->
22
23 <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
24
25     <!-- This screen captures the common layout of the find and list invoices screens. -->
26     <screen name="findAndListInvoices">
27         <section>
28             <actions>
29                 <java location="com.opensourcestrategies.financials.invoice.InvoiceActions" invoke="findInvoices"/>
30             </actions>
31             <widgets>
32                 <frame-container title="${findFormTitle}">
33                   <platform-specific><html>
34                     <html-template location="component://financials/webapp/financials/invoices/findInvoices.ftl"/>
35                   </html></platform-specific>
36                 </frame-container>
37                 <platform-specific>
38                     <html><html-template location="component://financials/webapp/financials/invoices/listInvoices.ftl"/></html>
39                 </platform-specific>
40             </widgets>
41         </section>
42     </screen>
43
44     <screen name="findSalesInvoices">
45         <section>
46             <actions>
47                 <set field="pageTitleLabel" value="FinancialsFindSalesInvoices"/>
48                 <set field="invoiceTypeId" value="SALES_INVOICE"/>
49                 <set field="formTarget" value="findSalesInvoices"/>
50             </actions>
51             <widgets>
52                 <decorator-screen name="main-section-decorator" location="component://financials/widget/financials/screens/receivables/ReceivablesScreens.xml">
53                     <decorator-section name="section-body">
54                         <include-screen name="findAndListInvoices"/>
55                     </decorator-section>
56                 </decorator-screen>
57             </widgets>
58         </section>
59     </screen>
60
61     <screen name="findFinanceCharges">
62         <section>
63             <actions>
64                 <set field="pageTitleLabel" value="FinancialsFindFinanceCharges"/>
65                 <set field="invoiceTypeId" value="INTEREST_INVOICE"/>
66                 <set field="formTarget" value="findFinanceCharges"/>
67             </actions>
68             <widgets>
69                 <decorator-screen name="main-section-decorator" location="component://financials/widget/financials/screens/receivables/ReceivablesScreens.xml">
70                     <decorator-section name="section-body">
71                         <include-screen name="findAndListInvoices"/>
72                     </decorator-section>
73                 </decorator-screen>
74             </widgets>
75         </section>
76     </screen>
77
78     <screen name="findPurchaseInvoices">
79         <section>
80             <actions>
81                 <set field="pageTitleLabel" value="FinancialsFindPurchaseInvoices"/>
82                 <set field="invoiceTypeId" value="PURCHASE_INVOICE"/>
83                 <set field="formTarget" value="findPurchaseInvoices"/>
84             </actions>
85             <widgets>
86                 <decorator-screen name="main-section-decorator" location="component://financials/widget/financials/screens/payables/PayablesScreens.xml">
87                     <decorator-section name="section-body">
88                         <include-screen name="findAndListInvoices"/>
89                     </decorator-section>
90                 </decorator-screen>
91             </widgets>
92         </section>
93     </screen>
94
95     <screen name="findCustomerReturnInvoices">
96         <section>
97             <actions>
98                 <set field="pageTitleLabel" value="FinancialsFindCustomerReturnInvoices"/>
99                 <set field="invoiceTypeId" value="CUST_RTN_INVOICE"/>
100                 <set field="formTarget" value="findCustomerReturnInvoices"/>
101             </actions>
102             <widgets>
103                 <decorator-screen name="main-section-decorator" location="component://financials/widget/financials/screens/payables/PayablesScreens.xml">
104                     <decorator-section name="section-body">
105                         <include-screen name="findAndListInvoices"/>
106                     </decorator-section>
107                 </decorator-screen>
108             </widgets>
109         </section>
110     </screen>
111
112     <screen name="findCommissionInvoices">
113         <section>
114             <actions>
115                 <set field="invoiceTypeId" value="COMMISSION_INVOICE"/>
116                 <set field="formTarget" value="findCommissionInvoices"/>
117             </actions>
118             <widgets>
119                 <decorator-screen name="main-section-decorator" location="component://financials/widget/financials/screens/payables/PayablesScreens.xml">
120                     <decorator-section name="section-body">
121                         <include-screen name="findAndListInvoices"/>
122                     </decorator-section>
123                 </decorator-screen>
124             </widgets>
125         </section>
126     </screen>
127
128      <screen name="findPartnerInvoices">
129         <section>
130             <actions>
131                 <set field="invoiceTypeId" value="PARTNER_INVOICE"/>
132                 <set field="formTarget" value="findPartnerInvoices"/>
133                 <script location="component://financials/webapp/financials/WEB-INF/actions/partners/getPartnersForOrganization.bsh"/>
134             </actions>
135             <widgets>
136                 <decorator-screen name="main-section-decorator" location="component://financials/widget/financials/screens/partners/PartnerScreens.xml">
137                     <decorator-section name="section-body">
138                         <include-screen name="findAndListInvoices"/>
139                     </decorator-section>
140                 </decorator-screen>
141             </widgets>
142         </section>
143     </screen>
144
145     <!-- This is probably the best way to create a view screen that is common across several tabs.  One weakness with this approachs is that the Invoice not found error page is generic, because we don't know what tab unless the invoice exists. -->
146     <screen name="viewInvoice">
147         <section>
148             <actions>
149                 <set field="pageTitleLabel" value="AccountingInvoice"/>
150                 <set field="invoiceId" from-field="parameters.invoiceId"/>
151                 <set field="gwtScripts[]" value="financialsgwt/org.opentaps.gwt.financials.invoices.invoices" global="true"/>
152                 <java location="com.opensourcestrategies.financials.invoice.InvoiceActions" invoke="viewInvoice"/>
153                 <!-- Uncomment to use Crm2 application
154                 <java location="com.opentaps.crm2.ActivitiesWidgetActions" invoke="getWidgetConfiguration"/>
155                 <java location="com.opentaps.crm2.ActivitiesWidgetActions" invoke="getInvoiceLink"/>
156                 -->
157             </actions>
158             <widgets>
159                 <decorator-screen name="main-section-decorator" location="${decoratorLocation}">
160                     <decorator-section name="section-body">
161                         <platform-specific><html>
162                             <html-template location="component://financials/webapp/financials/invoices/viewInvoice.ftl"/>
163                         </html></platform-specific>
164                         <!-- Uncomment to use Crm2 application
165                         <container style="subSectionBlock">
166                           <platform-specific><html><html-template location="component://crm2/webapp/crm2/activities/activitiesWidget.ftl"/></html></platform-specific>
167                         </container>
168                         -->
169                     </decorator-section>
170                 </decorator-screen>
171             </widgets>
172         </section>
173     </screen>
174
175     <screen name="createInvoiceForm">
176         <section>
177             <actions>
178                 <set field="invoiceTypeId" from-field="parameters.invoiceTypeId"/>
179                 <script location="component://financials/webapp/financials/WEB-INF/actions/invoices/createInvoiceForm.bsh"/>
180             </actions>
181             <widgets>
182                 <decorator-screen name="main-section-decorator" location="${decoratorLocation}">
183                     <decorator-section name="section-body">
184                         <section>
185                             <condition>
186                                 <or>
187                                     <if-has-permission permission="FINANCIALS_AP" action="_INCRTE"/>
188                                     <if-has-permission permission="FINANCIALS_AR" action="_INCRTE"/>
189                                 </or>
190                             </condition>
191                             <widgets>
192                                 <platform-specific><html>
193                                     <html-template location="component://financials/webapp/financials/invoices/createInvoiceForm.ftl"/>
194                                 </html></platform-specific>
195                             </widgets>
196                             <fail-widgets>
197                                 <include-screen name="PermissionErrorScreen" location="component://financials/widget/financials/screens/common/CommonScreens.xml"/>
198                             </fail-widgets>
199                         </section>
200                     </decorator-section>
201                 </decorator-screen>
202             </widgets>
203         </section>
204     </screen>
205
206     <screen name="updateInvoiceItemForm">
207         <section>
208             <actions>
209                 <set field="invoiceId" from-field="parameters.invoiceId"/>
210                 <java location="com.opensourcestrategies.financials.invoice.InvoiceActions" invoke="viewInvoice"/>
211                 <script location="component://financials/webapp/financials/WEB-INF/actions/invoices/updateInvoiceItem.bsh"/>
212             </actions>
213             <widgets>
214                 <decorator-screen name="main-section-decorator" location="${decoratorLocation}">
215                     <decorator-section name="section-body">
216                         <section>
217                             <condition>
218                                 <or>
219                                     <if-has-permission permission="FINANCIALS_AP" action="_INUPDT"/>
220                                     <if-has-permission permission="FINANCIALS_AR" action="_INUPDT"/>
221                                 </or>
222                             </condition>
223                             <widgets>
224                                 <platform-specific><html>
225                                     <html-template location="component://financials/webapp/financials/invoices/createOrUpdateInvoiceItem.ftl"/>
226                                 </html></platform-specific>
227                             </widgets>
228                             <fail-widgets>
229                                 <include-screen name="PermissionErrorScreen" location="component://financials/widget/financials/screens/common/CommonScreens.xml"/>
230                             </fail-widgets>
231                         </section>
232                     </decorator-section>
233                 </decorator-screen>
234             </widgets>
235         </section>
236     </screen>
237
238     <screen name="emailInvoice">
239         <section>
240             <actions>
241                 <set field="invoiceId" from-field="parameters.invoiceId"/>
242                 <java location="com.opensourcestrategies.financials.invoice.InvoiceActions" invoke="viewInvoice"/>
243                 <script location="component://financials/webapp/financials/WEB-INF/actions/invoices/emailInvoice.bsh"/>
244             </actions>
245             <widgets>
246                 <decorator-screen name="main-section-decorator" location="${decoratorLocation}">
247                     <decorator-section name="section-body">
248                         <platform-specific><html>
249                             <html-template location="component://financials/webapp/financials/invoices/emailInvoice.ftl"/>
250                         </html></platform-specific>
251                     </decorator-section>
252                 </decorator-screen>
253             </widgets>
254         </section>
255     </screen>
256
257     <screen name="SampleInvoicePDF">
258         <section>
259             <actions>
260                 <!-- 
261                 <set field="defaultFontFamily" value="DejaVuSans"/>
262                 -->
263                 <set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
264                 <set field="invoiceId" from-field="parameters.invoiceId"/>
265                 <script location="component://opentaps-common/webapp/common/WEB-INF/actions/includes/macro-setup.bsh"/>
266                 <script location="component://financials/webapp/financials/WEB-INF/actions/invoices/viewInvoicePDF.bsh"/>
267             </actions>
268             <widgets>
269                 <platform-specific>
270                     <html><html-template location="component://financials/webapp/financials/invoices/sampleInvoice.fo.ftl"/></html>
271                 </platform-specific>                
272             </widgets>
273         </section>
274     </screen>
275
276 </screens>