svn commit: r1752602 - in /ofbiz/trunk/applications: accounting/minilang/budget/BudgetServices.xml accounting/servicedef/services_budget.xml accounting/widget/BudgetForms.xml datamodel/entitydef/accounting-entitymodel.xml

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

svn commit: r1752602 - in /ofbiz/trunk/applications: accounting/minilang/budget/BudgetServices.xml accounting/servicedef/services_budget.xml accounting/widget/BudgetForms.xml datamodel/entitydef/accounting-entitymodel.xml

nmalin
Author: nmalin
Date: Thu Jul 14 08:40:28 2016
New Revision: 1752602

URL: http://svn.apache.org/viewvc?rev=1752602&view=rev
Log:
Add changeByUserLoginId field for BudgetStatus and use entity-auto service to create values. Thanks Nameet Jain for sumbmit and resolve isse on OFBIZ-7619

Modified:
    ofbiz/trunk/applications/accounting/minilang/budget/BudgetServices.xml
    ofbiz/trunk/applications/accounting/servicedef/services_budget.xml
    ofbiz/trunk/applications/accounting/widget/BudgetForms.xml
    ofbiz/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml

Modified: ofbiz/trunk/applications/accounting/minilang/budget/BudgetServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/minilang/budget/BudgetServices.xml?rev=1752602&r1=1752601&r2=1752602&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/minilang/budget/BudgetServices.xml (original)
+++ ofbiz/trunk/applications/accounting/minilang/budget/BudgetServices.xml Thu Jul 14 08:40:28 2016
@@ -40,7 +40,6 @@ under the License.
 
     <!-- update Budget Status -->
     <simple-method method-name="updateBudgetStatus" short-description="Update Budget Status">
-        <now-timestamp field="nowDate"/>
         <entity-and list="budgetStatuses" entity-name="BudgetStatus">
             <field-map field-name="budgetId" from-field="parameters.budgetId"/>
             <order-by field-name="-statusDate"/>
@@ -52,18 +51,12 @@ under the License.
                 <field-map field-name="statusIdTo" from-field="parameters.statusId"/>
             </entity-one>
             <if-not-empty field="statusValidChange">
-                <make-value value-field="newEntity" entity-name="BudgetStatus"/>
-                <set-pk-fields value-field="newEntity" map="parameters"/>
-                <set-nonpk-fields map="parameters" value-field="newEntity"/>
-                <set field="newEntity.statusDate" from-field="nowDate"/>
-                <create-value value-field="newEntity"/>
+                <set-service-fields service-name="createBudgetStatus" to-map="createBudgetStatusMap" map="parameters" mode="IN"/>
+                <call-service service-name="createBudgetStatus" in-map-name="createBudgetStatusMap"/>
             </if-not-empty>
             <else>
-                <make-value value-field="newEntity" entity-name="BudgetStatus"/>
-                <set-pk-fields value-field="newEntity" map="parameters"/>
-                <set-nonpk-fields map="parameters" value-field="newEntity"/>
-                <set field="newEntity.statusDate" from-field="nowDate"/>
-                <create-value value-field="newEntity"/>
+                <set-service-fields service-name="createBudgetStatus" to-map="createBudgetStatusMap" map="parameters" mode="IN"/>
+                <call-service service-name="createBudgetStatus" in-map-name="createBudgetStatusMap"/>
             </else>
         </if-not-empty>
     </simple-method>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_budget.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_budget.xml?rev=1752602&r1=1752601&r2=1752602&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_budget.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_budget.xml Thu Jul 14 08:40:28 2016
@@ -37,6 +37,11 @@ under the License.
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
 
+    <service name="createBudgetStatus" default-entity-name="BudgetStatus" engine="entity-auto" invoke="create" auth="true">
+        <description>Create Budget Status Record</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
     <service name="updateBudgetStatus" default-entity-name="BudgetStatus" engine="simple"
                 location="component://accounting/minilang/budget/BudgetServices.xml" invoke="updateBudgetStatus">
         <description>Update a Budget</description>

Modified: ofbiz/trunk/applications/accounting/widget/BudgetForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/BudgetForms.xml?rev=1752602&r1=1752601&r2=1752602&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/BudgetForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/BudgetForms.xml Thu Jul 14 08:40:28 2016
@@ -82,8 +82,9 @@ under the License.
     <form name="BudgetStatus" list-name="budgetStatuses" target="" title="" type="list" separate-columns="true" paginate-target="budgetOverview"
         odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
         <field name="budgetId"><hidden/></field>
-        <field name="statusDate"><display/></field>
+        <field name="statusDate"><display type="date-time"/></field>
         <field name="statusId" title="${uiLabelMap.AccountingBudgetStatus}"><display-entity entity-name="StatusItem"/></field>
+        <field name="changeByUserLoginId"><display/></field>
     </form>
     
     <form name="BudgetRoles" type="list" use-row-submit="true" title="" list-name="budgetRoles" paginate-target="BudgetOverview"

Modified: ofbiz/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml?rev=1752602&r1=1752601&r2=1752602&view=diff
==============================================================================
--- ofbiz/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml (original)
+++ ofbiz/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml Thu Jul 14 08:40:28 2016
@@ -287,6 +287,7 @@ under the License.
       <field name="statusId" type="id-ne"></field>
       <field name="statusDate" type="date-time"></field>
       <field name="comments" type="comment"></field>
+      <field name="changeByUserLoginId" type="id-vlong"></field>
       <prim-key field="budgetId"/>
       <prim-key field="statusId"/>
       <relation type="one" fk-name="BUDGET_STTS_BDGT" rel-entity-name="Budget">
@@ -295,6 +296,9 @@ under the License.
       <relation type="one" fk-name="BUDGET_STTS_STTS" rel-entity-name="StatusItem">
         <key-map field-name="statusId"/>
       </relation>
+      <relation type="one" fk-name="BUDGET_STTS_USRLGN" title="ChangeBy" rel-entity-name="UserLogin">
+          <key-map field-name="changeByUserLoginId" rel-field-name="userLoginId"/>
+      </relation>
     </entity>
     <entity entity-name="BudgetType"
             package-name="org.ofbiz.accounting.budget"