[ofbiz-framework] branch trunk updated: Improved: Converted all GlReconciliation related CRUD services from simple to entity-auto (#110)

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

[ofbiz-framework] branch trunk updated: Improved: Converted all GlReconciliation related CRUD services from simple to entity-auto (#110)

surajk
This is an automated email from the ASF dual-hosted git repository.

surajk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new c7e0f90  Improved: Converted all GlReconciliation related CRUD services from simple to entity-auto (#110)
c7e0f90 is described below

commit c7e0f909ea4a65d72bbe2fd2db9c516495c8bd27
Author: Suraj Khurana <[hidden email]>
AuthorDate: Sat May 9 12:31:23 2020 +0530

    Improved: Converted all GlReconciliation related CRUD services from simple to entity-auto (#110)
   
    (OFBIZ-11642)
---
 .../minilang/ledger/GeneralLedgerServices.xml      | 29 ----------------------
 .../accounting/servicedef/secas_ledger.xml         |  4 +++
 .../accounting/servicedef/services_ledger.xml      |  7 +++---
 3 files changed, 7 insertions(+), 33 deletions(-)

diff --git a/applications/accounting/minilang/ledger/GeneralLedgerServices.xml b/applications/accounting/minilang/ledger/GeneralLedgerServices.xml
index 8135ff8..87e6b00 100644
--- a/applications/accounting/minilang/ledger/GeneralLedgerServices.xml
+++ b/applications/accounting/minilang/ledger/GeneralLedgerServices.xml
@@ -118,41 +118,12 @@ under the License.
             <call-service service-name="postAcctgTrans" in-map-name="callServiceMap"/>
         </iterate>
     </simple-method>
-
-    <!-- ========= GlReconciliation methods ========= -->
-    <simple-method method-name="createGlReconciliation" short-description="Create an GlReconciliation">
-        <make-value entity-name="GlReconciliation" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-
-        <!-- GlReconciliation uses a sequenced id, so get the next one now and set it... -->
-        <sequenced-id sequence-name="GlReconciliation" field="newEntity.glReconciliationId"/>
-        <field-to-result field="newEntity.glReconciliationId" result-name="glReconciliationId"/>
-
-        <set from-field="userLogin.userLoginId" field="newEntity.lastModifiedByUserLogin"/>
-        <set from-field="userLogin.userLoginId" field="newEntity.createdByUserLogin"/>
-
-        <if-empty field="newEntity.statusId">
-            <set field="newEntity.statusId" value="GLREC_CREATED"/>
-        </if-empty>
-        <create-value value-field="newEntity"/>
-    </simple-method>
-    <simple-method method-name="updateGlReconciliation" short-description="Update an GlReconciliation">
-        <set-service-fields service-name="setGlReconciliationStatus" map="parameters" to-map="setGlReconciliationStatusMap"/>
-        <call-service service-name="setGlReconciliationStatus" in-map-name="setGlReconciliationStatusMap"/>
-        <check-errors/>
-        <entity-one entity-name="GlReconciliation" value-field="lookedUpValue"/>
-        <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-
-        <set from-field="userLogin.userLoginId" field="lookedUpValue.lastModifiedByUserLogin"/>
-        <store-value value-field="lookedUpValue"/>
-    </simple-method>
     <simple-method method-name="updateGlReconciliationLastModified" short-description="Update GlReconciliation LastModified Info">
         <!-- this is just a little method that is meant to be called as an inline call-simple-method target with the context already setup -->
         <entity-one entity-name="GlReconciliation" value-field="lookedUpGLR"/>
         <set from-field="userLogin.userLoginId" field="lookedUpGLR.lastModifiedByUserLogin"/>
         <store-value value-field="lookedUpGLR"/>
     </simple-method>
-
     <!-- ========= GlReconciliationEntry methods ========= -->
     <simple-method method-name="createGlReconciliationEntry" short-description="Add Entry To GlReconciliation">
         <!-- first of all, make sure that the AcctgTransEntry is not already reconciled -->
diff --git a/applications/accounting/servicedef/secas_ledger.xml b/applications/accounting/servicedef/secas_ledger.xml
index 920d9c4..1ecccc9 100644
--- a/applications/accounting/servicedef/secas_ledger.xml
+++ b/applications/accounting/servicedef/secas_ledger.xml
@@ -158,4 +158,8 @@ under the License.
         <action service="checkUpdateFixedAssetDepreciation" mode="sync"/>
     </eca>
 
+    <eca service="updateGlReconciliation" event="invoke">
+        <action service="setGlReconciliationStatus" mode="sync"/>
+    </eca>
+
 </service-eca>
diff --git a/applications/accounting/servicedef/services_ledger.xml b/applications/accounting/servicedef/services_ledger.xml
index f60032a..44b7c9f 100644
--- a/applications/accounting/servicedef/services_ledger.xml
+++ b/applications/accounting/servicedef/services_ledger.xml
@@ -122,8 +122,7 @@ under the License.
     </service>
 
     <!-- GlReconciliation & Related -->
-    <service name="createGlReconciliation" default-entity-name="GlReconciliation" engine="simple"
-            location="component://accounting/minilang/ledger/GeneralLedgerServices.xml" invoke="createGlReconciliation" auth="true">
+    <service name="createGlReconciliation" default-entity-name="GlReconciliation" engine="entity-auto" invoke="create" auth="true">
         <description>Create a GlReconciliation record</description>
         <permission-service service-name="basicGeneralLedgerPermissionCheck" main-action="CREATE"/>
         <auto-attributes include="pk" mode="OUT" optional="false"/>
@@ -132,9 +131,9 @@ under the License.
             <exclude field-name="lastModifiedByUserLogin"/>
         </auto-attributes>
         <override name="glReconciliationName" optional="false"/>
+        <override name="statusId" default-value="GLREC_CREATED"/>
     </service>
-    <service name="updateGlReconciliation" default-entity-name="GlReconciliation" engine="simple"
-            location="component://accounting/minilang/ledger/GeneralLedgerServices.xml" invoke="updateGlReconciliation" auth="true">
+    <service name="updateGlReconciliation" default-entity-name="GlReconciliation" engine="entity-auto" invoke="update" auth="true">
         <description>Update a GlReconciliation record</description>
         <permission-service service-name="basicGeneralLedgerPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>