svn commit: r790567 - in /ofbiz/trunk/applications/accounting: webapp/accounting/invoice/InvoiceSubTabBar.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: r790567 - in /ofbiz/trunk/applications/accounting: webapp/accounting/invoice/InvoiceSubTabBar.ftl widget/InvoiceScreens.xml

ashish-18
Author: ashish
Date: Thu Jul  2 12:40:23 2009
New Revision: 790567

URL: http://svn.apache.org/viewvc?rev=790567&view=rev
Log:
Applied patch from jira issue OFBIZ-2684 (In Accounting invoice section the InvoiceSubBar Menu all options are not working properly, convert it to ftl, so that all functionality can be run.)
There is bug in the Menu Widget code and it will be handled in separate issue created and referred on the above jira issue.
For now I have commented out the code of Menus.xml from InvoiceScreens.xml file and on fixing this bug in menu widget code the artifact will be reused again.

Thanks Rishi for your contribution on this.

Added:
    ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceSubTabBar.ftl   (with props)
Modified:
    ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml

Added: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceSubTabBar.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceSubTabBar.ftl?rev=790567&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceSubTabBar.ftl (added)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceSubTabBar.ftl Thu Jul  2 12:40:23 2009
@@ -0,0 +1,117 @@
+<#--
+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.
+-->
+<div class="button-bar button-style-2">
+  <ul>
+    <li><a href="<@ofbizUrl>newInvoice</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonCreateNew}</a></li>
+    <#if (invoice.invoiceId)?has_content>
+      <li>
+        <a href="javascript:document.InvoiceSubTabBar_copyInvoice.submit()" class="buttontext">${uiLabelMap.CommonCopy}</a>
+        <form method="post" action="<@ofbizUrl>copyInvoice</@ofbizUrl>" onSubmit="javascript:submitFormDisableSubmits(this)" name="InvoiceSubTabBar_copyInvoice">
+          <input type="hidden" name="invoiceIdToCopyFrom" value="${invoice.invoiceId}"/>
+        </form>
+      </li>
+      <li><a target="_BLANK" href="<@ofbizUrl>invoice.pdf?invoiceId=${invoice.invoiceId}</@ofbizUrl>">${uiLabelMap.AccountingInvoicePDF}</a></li>
+      <#if (invoice.currencyUomId)?if_exists != defaultOrganizationPartyCurrencyUomId>
+        <li><a target="_BLANK" href="<@ofbizUrl>invoice.pdf?invoiceId=${invoice.invoiceId}&currency=${defaultOrganizationPartyCurrencyUomId}</@ofbizUrl>">${uiLabelMap.AccountingInvoicePDFDefaultCur}(${defaultOrganizationPartyCurrencyUomId})</a></li>
+      </#if>
+      <#if invoice.statusId == "INVOICE_IN_PROCESS" || invoice.statusId == "INVOICE_RECEIVED">
+        <li>
+          <a href="javascript:document.InvoiceSubTabBar_statusToApproved.submit()" class="buttontext">${uiLabelMap.AccountingInvoiceStatusToApproved}</a>
+          <form method="post" action="<@ofbizUrl>setInvoiceStatus</@ofbizUrl>" onSubmit="javascript:submitFormDisableSubmits(this)" name="InvoiceSubTabBar_statusToApproved">
+            <input type="hidden" name="invoiceId" value="${invoice.invoiceId}"/>
+            <input type="hidden" name="statusId" value="INVOICE_APPROVED"/>
+          </form>
+        </li>
+      </#if>
+      <#if invoice.statusId == "INVOICE_IN_PROCESS">
+        <#if invoice.invoiceTypeId == "PURCHASE_INVOICE" || invoice.invoiceTypeId == "CUST_RTN_INVOICE">
+          <li>
+            <a href="javascript:document.InvoiceSubTabBar_statusToReceived.submit()" class="buttontext">${uiLabelMap.AccountingInvoiceStatusToReceived}</a>
+            <form method="post" action="<@ofbizUrl>setInvoiceStatus</@ofbizUrl>" onSubmit="javascript:submitFormDisableSubmits(this)" name="InvoiceSubTabBar_statusToReceived">
+              <input type="hidden" name="invoiceId" value="${invoice.invoiceId}"/>
+              <input type="hidden" name="statusId" value="INVOICE_RECEIVED"/>
+            </form>
+          </li>
+        </#if>
+      </#if>
+      <#if invoice.invoiceTypeId == "SALES_INVOICE" && (invoice.statusId == "INVOICE_IN_PROCESS" || invoice.statusId == "INVOICE_APPROVED")>
+        <li>
+          <a href="javascript:document.InvoiceSubTabBar_statusToSent.submit()" class="buttontext">${uiLabelMap.AccountingInvoiceStatusToSent}</a>
+          <form method="post" action="<@ofbizUrl>setInvoiceStatus</@ofbizUrl>" onSubmit="javascript:submitFormDisableSubmits(this)" name="InvoiceSubTabBar_statusToSent">
+            <input type="hidden" name="invoiceId" value="${invoice.invoiceId}"/>
+            <input type="hidden" name="statusId" value="INVOICE_SENT"/>
+          </form>
+        </li>
+      </#if>
+      <#if invoice.statusId == "INVOICE_IN_PROCESS" || invoice.statusId == "INVOICE_SENT" || invoice.statusId == "INVOICE_RECEIVED" || invoice.statusId == "INVOICE_APPROVED">
+        <li>
+          <a href="javascript:document.InvoiceSubTabBar_statusToReady.submit()" class="buttontext">${uiLabelMap.AccountingInvoiceStatusToReady}</a>
+          <form method="post" action="<@ofbizUrl>setInvoiceStatus</@ofbizUrl>" onSubmit="javascript:submitFormDisableSubmits(this)" name="InvoiceSubTabBar_statusToReady">
+            <input type="hidden" name="invoiceId" value="${invoice.invoiceId}"/>
+            <input type="hidden" name="statusId" value="INVOICE_READY"/>
+          </form>
+        </li>
+      </#if>
+      <#if invoice.statusId == "INVOICE_READY">
+        <li>
+          <a href="javascript:document.InvoiceSubTabBar_statusToPaid.submit()" class="buttontext">${uiLabelMap.AccountingInvoiceStatusToPaid}</a>
+          <form method="post" action="<@ofbizUrl>setInvoiceStatus</@ofbizUrl>" onSubmit="javascript:submitFormDisableSubmits(this)" name="InvoiceSubTabBar_statusToPaid">
+            <input type="hidden" name="invoiceId" value="${invoice.invoiceId}"/>
+            <input type="hidden" name="statusId" value="INVOICE_PAID"/>
+          </form>
+        </li>
+        <li>
+          <a href="javascript:confirmActionFormLink('You want to writeoff this invoice number ${invoice.invoiceId}?','InvoiceSubTabBar_statusToWriteoff')" class="buttontext">${uiLabelMap.AccountingInvoiceStatusToWriteoff}</a>
+          <form method="post" action="<@ofbizUrl>setInvoiceStatus</@ofbizUrl>" onSubmit="javascript:submitFormDisableSubmits(this)" name="InvoiceSubTabBar_statusToWriteoff">
+            <input type="hidden" name="invoiceId" value="${invoice.invoiceId}"/>
+            <input type="hidden" name="statusId" value="INVOICE_WRITEOFF"/>
+          </form>
+        </li>
+      </#if>
+      <#if invoice.statusId == "INVOICE_SENT" || invoice.statusId == "INVOICE_RECEIVED">
+        <li>
+          <a href="javascript:document.InvoiceSubTabBar_statusToInProcess.submit()" class="buttontext">${uiLabelMap.AccountingInvoiceStatusToInProcess}</a>
+          <form method="post" action="<@ofbizUrl>setInvoiceStatus</@ofbizUrl>" onSubmit="javascript:submitFormDisableSubmits(this)" name="InvoiceSubTabBar_statusToInProcess">
+            <input type="hidden" name="invoiceId" value="${invoice.invoiceId}"/>
+            <input type="hidden" name="statusId" value="INVOICE_IN_PROCESS"/>
+          </form>
+        </li>
+      </#if>
+      <#if invoice.statusId == "INVOICE_SENT" || invoice.statusId == "INVOICE_RECEIVED" || invoice.statusId == "INVOICE_IN_PROCESS">
+        <li>
+          <a href="javascript:confirmActionFormLink('You want to cancel this invoice number ${invoice.invoiceId}?','InvoiceSubTabBar_statusToCancelled')" class="buttontext">${uiLabelMap.AccountingInvoiceStatusToCancelled}</a>
+          <form method="post" action="<@ofbizUrl>setInvoiceStatus</@ofbizUrl>" onSubmit="javascript:submitFormDisableSubmits(this)" name="InvoiceSubTabBar_statusToCancelled">
+            <input type="hidden" name="invoiceId" value="${invoice.invoiceId}"/>
+            <input type="hidden" name="statusId" value="INVOICE_CANCELLED"/>
+          </form>
+        </li>
+      </#if>
+      <#if invoice.invoiceTypeId == "SALES_INVOICE" || invoice.invoiceTypeId == "PURCHASE_INVOICE">
+        <li>
+          <a href="javascript:document.InvoiceSubTabBar_saveInvoiceAsTemplate.submit()" class="buttontext">${uiLabelMap.ProjectMgrSaveAsTemplate}</a>
+          <form method="post" action="<@ofbizUrl>setInvoiceStatus</@ofbizUrl>" onSubmit="javascript:submitFormDisableSubmits(this)" name="InvoiceSubTabBar_saveInvoiceAsTemplate">
+            <input type="hidden" name="invoiceId" value="${invoice.invoiceId}"/>
+            <input type="hidden" name="invoiceTypeId" value="${invoice.invoiceTypeId}"/>
+          </form>
+        </li>
+      </#if>
+    </#if>
+  </ul>
+</div>
+

Propchange: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceSubTabBar.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceSubTabBar.ftl
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceSubTabBar.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml?rev=790567&r1=790566&r2=790567&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml Thu Jul  2 12:40:23 2009
@@ -41,7 +41,8 @@
                                     <condition><not><if-empty field="parameters.invoiceId"/></not></condition>
                                     <widgets>
                                         <include-menu name="InvoiceTabBar" location="component://accounting/widget/Menus.xml"/>
-                                        <include-menu name="InvoiceSubTabBar" location="component://accounting/widget/Menus.xml"/>
+                                        <!-- include-menu name="InvoiceSubTabBar" location="component://accounting/widget/Menus.xml"/-->
+                                        <platform-specific><html><html-template location="component://accounting/webapp/accounting/invoice/InvoiceSubTabBar.ftl"/></html></platform-specific>
                                         <container style="leftclear">
                                             <label style="h1" text="${uiLabelMap[labelTitleProperty]} ${uiLabelMap.CommonFor}: ${invoice.description} [${invoiceId}]  ${${extraFunctionName}}"/>
                                         </container>
@@ -73,7 +74,8 @@
                             <widgets>
                                 <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                                     <decorator-section name="menu-bar">
-                                        <include-menu name="InvoiceSubTabBar" location="component://accounting/widget/Menus.xml"/>
+                                        <!-- include-menu name="InvoiceSubTabBar" location="component://accounting/widget/Menus.xml"/-->
+                                        <platform-specific><html><html-template location="component://accounting/webapp/accounting/invoice/InvoiceSubTabBar.ftl"/></html></platform-specific>
                                         <container style="clear"/>
                                     </decorator-section>
                                     <decorator-section name="search-options">