svn commit: r573674 - in /ofbiz/trunk/applications/accounting: webapp/accounting/WEB-INF/actions/invoice/orderListInvoiceItem.bsh webapp/accounting/invoice/InvoiceForms.xml webapp/accounting/invoice/viewInvoice.fo.ftl widget/InvoiceScreens.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r573674 - in /ofbiz/trunk/applications/accounting: webapp/accounting/WEB-INF/actions/invoice/orderListInvoiceItem.bsh webapp/accounting/invoice/InvoiceForms.xml webapp/accounting/invoice/viewInvoice.fo.ftl widget/InvoiceScreens.xml

jaz-3
Author: jaz
Date: Fri Sep  7 12:18:00 2007
New Revision: 573674

URL: http://svn.apache.org/viewvc?rev=573674&view=rev
Log:
invoice formatting changed (PDF) as well as now added link to order(s) from the invoive items

Added:
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/orderListInvoiceItem.bsh   (with props)
Modified:
    ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/invoice/viewInvoice.fo.ftl
    ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml

Added: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/orderListInvoiceItem.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/orderListInvoiceItem.bsh?rev=573674&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/orderListInvoiceItem.bsh (added)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/orderListInvoiceItem.bsh Fri Sep  7 12:18:00 2007
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.*;
+import org.ofbiz.entity.*;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.entity.util.EntityUtil;
+import javolution.util.FastMap;
+
+invoiceId = context.get("invoiceId");
+if(invoiceId != null) {
+    List invoiceItems = new LinkedList();
+    invoiceItemList = delegator.findByAnd("InvoiceItem", UtilMisc.toMap("invoiceId", invoiceId),UtilMisc.toList("invoiceItemSeqId"));
+    if(invoiceItemList != null) {
+        itr = invoiceItemList.iterator();
+        while(itr.hasNext()) {
+            GenericValue invoiceItem = itr.next();
+            invoiceItemSeqId = invoiceItem.get("invoiceItemSeqId");
+            invoiceId = invoiceItem.get("invoiceId");            
+            orderItemBilling = EntityUtil.getFirst(delegator.findByAnd("OrderItemBilling", UtilMisc.toMap("invoiceId", invoiceId, "invoiceItemSeqId", invoiceItemSeqId)));
+            Map invoiceItemMap = FastMap.newInstance();
+            invoiceItemMap.putAll((Map) invoiceItem);
+            if(orderItemBilling != null) {
+                orderId = orderItemBilling.get("orderId");
+                invoiceItemMap.put("orderId", orderId);
+            }
+            invoiceItems.add(invoiceItemMap);
+        }
+        context.put("invoiceItems", invoiceItems);
+    }
+}
\ No newline at end of file

Propchange: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/orderListInvoiceItem.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/orderListInvoiceItem.bsh
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/orderListInvoiceItem.bsh
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml?rev=573674&r1=573673&r2=573674&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml Fri Sep  7 12:18:00 2007
@@ -129,6 +129,7 @@
         <field name="invoiceId"><hidden/></field>
         <field name="invoiceItemSeqId"><display/></field>
         <field name="invoiceItemTypeId"><display-entity description="${description}" entity-name="InvoiceItemType"/></field>
+        <field name="orderId" widget-style="linktext"><hyperlink target="/ordermgr/control/orderview?orderId=${orderId}" target-type="inter-app" description="${orderId}"/></field>
         <field name="inventoryItemId" widget-area-style="align-text"><display/></field>
         <field name="quantity" widget-area-style="align-text"><display/></field>
         <field name="amount" title="${uiLabelMap.AccountingUnitPrice}" widget-area-style="align-text"><display type="currency" currency="${invoice.currencyUomId}"/></field>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/viewInvoice.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/invoice/viewInvoice.fo.ftl?rev=573674&r1=573673&r2=573674&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/invoice/viewInvoice.fo.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/invoice/viewInvoice.fo.ftl Fri Sep  7 12:18:00 2007
@@ -229,10 +229,10 @@
                                 <fo:block> ${invoiceItem.invoiceItemSeqId} </fo:block>              
                             </fo:table-cell>    
                             <fo:table-cell>
-                                <fo:block> ${invoiceItem.productId?if_exists} </fo:block>              
+                                <fo:block text-align="center">${invoiceItem.productId?if_exists} </fo:block>              
                             </fo:table-cell>    
                             <fo:table-cell>
-                                <fo:block> ${description?if_exists} </fo:block>              
+                                <fo:block text-align="center"> ${description?if_exists}</fo:block>              
                             </fo:table-cell>      
                               <fo:table-cell>
                                 <fo:block text-align="center"> <#if invoiceItem.quantity?exists>${invoiceItem.quantity?string.number}</#if> </fo:block>              

Modified: ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml?rev=573674&r1=573673&r2=573674&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml Fri Sep  7 12:18:00 2007
@@ -113,10 +113,7 @@
                     <order-by field-name="invoiceTermId"/>
                 </entity-and>
                 <script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/createApplicationList.bsh"/>
-                <entity-and entity-name="InvoiceItem" list-name="invoiceItems">
-                    <field-map field-name="invoiceId" value="${parameters.invoiceId}"/>
-                    <order-by field-name="invoiceItemSeqId"/>
-                </entity-and>
+                <script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/orderListInvoiceItem.bsh"/>
                 <set field="invoiceAmount" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotalBd(invoice)}"/>
                 <set field="notAppliedAmount" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(invoice)}"/>
                 <set field="appliedAmount" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceAppliedBd(invoice)}"/>