svn commit: r590611 - in /ofbiz/trunk/applications: accounting/config/ accounting/webapp/accounting/WEB-INF/ accounting/webapp/accounting/invoice/ accounting/widget/ workeffort/script/org/ofbiz/workeffort/timesheet/ workeffort/servicedef/

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

svn commit: r590611 - in /ofbiz/trunk/applications: accounting/config/ accounting/webapp/accounting/WEB-INF/ accounting/webapp/accounting/invoice/ accounting/widget/ workeffort/script/org/ofbiz/workeffort/timesheet/ workeffort/servicedef/

hansbak-2
Author: hansbak
Date: Wed Oct 31 03:09:19 2007
New Revision: 590611

URL: http://svn.apache.org/viewvc?rev=590611&view=rev
Log:
show time-entry information on the invoice with the possibility to unlink

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml
    ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml
    ofbiz/trunk/applications/accounting/widget/Menus.xml
    ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/timesheet/TimesheetServices.xml
    ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml

Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties?rev=590611&r1=590610&r2=590611&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties Wed Oct 31 03:09:19 2007
@@ -246,6 +246,7 @@
 AccountingInvoiceStatusToReceived=Status to 'Received'
 AccountingInvoiceStatusToSent=Status to 'Sent'
 AccountingInvoiceStatusToWriteoff=Status to 'Writeoff'
+AccountingInvoiceTimeEntries=Time Entries
 AccountingInvoiceTotal=Invoice Total
 AccountingInvoices=Invoices
 AccountingInvoicesFound=Invoices Found

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=590611&r1=590610&r2=590611&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Wed Oct 31 03:09:19 2007
@@ -207,6 +207,16 @@
         <response name="success" type="view" value="listInvoiceItems"/>
         <response name="error" type="view" value="listInvoiceItems"/>
     </request-map>
+    <request-map uri="editInvoiceTimeEntries">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="editInvoiceTimeEntries"/>
+    </request-map>    
+    <request-map uri="unlinkInvoiceFromTimeEntry">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="unlinkInvoiceFromTimeEntry"/>
+        <response name="success" type="view" value="editInvoiceTimeEntries"/>
+        <response name="error" type="view" value="editInvoiceTimeEntries"/>
+    </request-map>
     <request-map uri="editInvoiceApplications">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="editInvoiceApplications"/>
@@ -1407,6 +1417,7 @@
     <view-map name="editInvoice" type="screen" page="component://accounting/widget/InvoiceScreens.xml#EditInvoice"/>
     <view-map name="listInvoiceItems" type="screen" page="component://accounting/widget/InvoiceScreens.xml#EditInvoiceItems"/>
     <view-map name="editInvoiceItem" type="screen" page="component://accounting/widget/InvoiceScreens.xml#EditInvoiceItem"/>
+    <view-map name="editInvoiceTimeEntries" type="screen" page="component://accounting/widget/InvoiceScreens.xml#EditInvoiceTimeEntries"/>
     <view-map name="invoiceStatus" type="screen" page="component://accounting/widget/InvoiceScreens.xml#InvoiceStatus"/>
     <view-map name="editInvoiceApplications" type="screen" page="component://accounting/widget/InvoiceScreens.xml#EditInvoiceApplications"/>
     <view-map name="invoiceRoles" type="screen" page="component://accounting/widget/InvoiceScreens.xml#InvoiceRoles"/>

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=590611&r1=590610&r2=590611&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml Wed Oct 31 03:09:19 2007
@@ -439,4 +439,20 @@
         <field name="bodyText"><textarea/></field>
         <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
+    <form name="EditTimeEntries" type="list" list-name="timeEntries">
+        <auto-fields-service service-name="updateTimeEntry" default-field-type="display"/>
+        
+        <field name="invoiceId"><hidden/></field>
+        
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink target="unlinkInvoiceFromTimeEntry?timeEntryId=${timeEntryId}&amp;invoiceId=${invoiceId}"
+                description="${uiLabelMap.CommonDelete}" also-hidden="false"/>
+        </field>
+    </form>
+    <form name="ListTimeEntries" type="list" list-name="timeEntries">
+        <auto-fields-service service-name="updateTimeEntry" default-field-type="display"/>
+        
+        <field name="invoiceId"><hidden/></field>
+        
+    </form>
 </forms>

Modified: ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml?rev=590611&r1=590610&r2=590611&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml Wed Oct 31 03:09:19 2007
@@ -112,6 +112,10 @@
                     <field-map env-name="parameters.invoiceId" field-name="invoiceId"/>
                     <order-by field-name="invoiceTermId"/>
                 </entity-and>
+                <entity-and entity-name="TimeEntry" list-name="timeEntries">
+                    <field-map env-name="parameters.invoiceId" field-name="invoiceId"/>
+                    <order-by field-name="timeEntryId"/>
+                </entity-and>
                 <script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/createApplicationList.bsh"/>
                 <script location="component://accounting/webapp/accounting/WEB-INF/actions/invoice/orderListInvoiceItem.bsh"/>
                 <set field="invoiceAmount" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotalBd(invoice)}"/>
@@ -143,6 +147,9 @@
                                 <container><label style="head1" text="${uiLabelMap.AccountingInvoiceItems}"/></container>
                                 <container><link target="listInvoiceItems?invoiceId=${invoiceId}" text="${uiLabelMap.CommonUpdate}" style="buttontext"/></container>
                                 <include-form name="invoiceItems" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
+                                <container><label style="head1" text="${uiLabelMap.AccountingInvoiceTimeEntries}"/></container>
+                                <container><link target="editInvoiceTimeEntries?invoiceId=${invoiceId}" text="${uiLabelMap.CommonUpdate}" style="buttontext"/></container>
+                                <include-form name="ListTimeEntries" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
                                 <container><label style="head1" text="${uiLabelMap.AccountingTransactions}"/></container>
                                 <include-form name="AcctgTransAndEntries" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
                             </widgets>
@@ -158,6 +165,8 @@
                                 <include-form name="ListInvoiceApplications" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
                                 <container><label style="head1" text="${uiLabelMap.AccountingInvoiceItems}"/></container>
                                 <include-form name="invoiceItems" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
+                                <container><label style="head1" text="${uiLabelMap.AccountingInvoiceTimeEntries}"/></container>
+                                <include-form name="ListTimeEntries" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
                                 <container><label style="head1" text="${uiLabelMap.AccountingTransactions}"/></container>
                                 <include-form name="AcctgTransAndEntries" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
                             </fail-widgets>
@@ -283,6 +292,30 @@
         </section>
     </screen>
 
+    <screen name="EditInvoiceTimeEntries">
+        <section>
+            <actions>
+                <set field="title" value="List time entries for an invoice"/>
+                <set field="titleProperty" value="PageTitleListInvoiceTimeEntries"/>
+                <set field="tabButtonItem" value="EditInvoiceTimeEntries"/>
+                <set field="invoiceId" from-field="parameters.invoiceId"/>
+                <entity-one entity-name="Invoice" value-name="invoice"/>
+                <entity-and entity-name="TimeEntry" list-name="timeEntries">
+                    <field-map field-name="invoiceId" env-name="parameters.invoiceId"/>
+                    <order-by field-name="timeEntryId"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonInvoiceDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <label style="head1" text="${uiLabelMap.AccountingInvoiceTimeEntries}"/>
+                        <include-form name="EditTimeEntries" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    
     <screen name="InvoiceRoles">
         <section>
             <actions>

Modified: ofbiz/trunk/applications/accounting/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/Menus.xml?rev=590611&r1=590610&r2=590611&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/Menus.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/Menus.xml Wed Oct 31 03:09:19 2007
@@ -56,6 +56,20 @@
             </condition>
             <link target="listInvoiceItems?invoiceId=${invoice.invoiceId}"/>
         </menu-item>
+
+        <menu-item name="EditInvoiceTimeEntries" title="${uiLabelMap.AccountingInvoiceTimeEntries}">
+            <condition>
+                <and>
+                    <not><if-empty field-name="invoice.invoiceId"/></not>
+                    <or>
+                        <if-compare field-name="invoice.statusId" operator="equals" value="INVOICE_IN_PROCESS"/>
+                        <if-compare field-name="invoice.statusId" operator="equals" value="INVOICE_SENT"/>
+                        <if-compare field-name="invoice.statusId" operator="equals" value="INVOICE_RECEIVED"/>
+                    </or>                
+                </and>
+            </condition>
+            <link target="editInvoiceTimeEntries?invoiceId=${invoice.invoiceId}"/>
+        </menu-item>
         
         <menu-item name="invoiceRoles" title="${uiLabelMap.AccountingInvoiceRoles}">
             <condition>

Modified: ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/timesheet/TimesheetServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/timesheet/TimesheetServices.xml?rev=590611&r1=590610&r2=590611&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/timesheet/TimesheetServices.xml (original)
+++ ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/timesheet/TimesheetServices.xml Wed Oct 31 03:09:19 2007
@@ -197,6 +197,12 @@
         <call-simple-method method-name="checkTimesheetStatus"/>
         <remove-value value-name="lookedUpValue"/>
     </simple-method>
+    <simple-method method-name="unlinkInvoiceFromTimeEntry" short-description="Delete TimeEntry">
+        <entity-one entity-name="TimeEntry" value-name="lookedUpValue"/>
+        <field-to-result field-name="invoiceId" map-name="lookedUpValue"/>
+        <clear-field field-name="lookedUpValue.invoiceId"/>
+        <store-value value-name="lookedUpValue"/>
+    </simple-method>
     <simple-method method-name="getTimeEntryRate" short-description="Get TimeEntry Rate">
         <check-permission permission="WORKEFFORTMGR" action="_VIEW"><fail-message message="You do not have permission to perform this operation: ${methodShortDescription}."/></check-permission>
         <check-errors/>

Modified: ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml?rev=590611&r1=590610&r2=590611&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml (original)
+++ ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml Wed Oct 31 03:09:19 2007
@@ -121,6 +121,12 @@
         <description>Deletes TimeEntry</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
+    <service name="unlinkInvoiceFromTimeEntry" default-entity-name="TimeEntry" engine="simple" auth="true"
+        location="org/ofbiz/workeffort/timesheet/TimesheetServices.xml" invoke="unlinkInvoiceFromTimeEntry">
+        <description>Deletes TimeEntry</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <attribute name="invoiceId" type="String" mode="INOUT" optional="false"/>
+    </service>
     <service name="getTimeEntryRate" default-entity-name="TimeEntry" engine="simple" auth="true"
         location="org/ofbiz/workeffort/timesheet/TimesheetServices.xml" invoke="getTimeEntryRate">
         <description>Creates TimeEntry</description>