[OFBiz] SVN: r5900 - trunk/applications/accounting/script/org/ofbiz/accounting/ledger

jonesde at svn.ofbiz.org jonesde at svn.ofbiz.org
Sun Oct 2 18:41:34 EDT 2005


Author: jonesde
Date: 2005-10-02 17:41:31 -0500 (Sun, 02 Oct 2005)
New Revision: 5900

Modified:
   trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
Log:
Mostly modernization and efficiencing and coding style improvemnts, found a couple of small bugs from review that are also fixed

Modified: trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
===================================================================
--- trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml	2005-10-02 18:40:06 UTC (rev 5899)
+++ trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml	2005-10-02 22:41:31 UTC (rev 5900)
@@ -102,14 +102,14 @@
     
         <log level="info" message="XXXX - Copying paramter map to appropriate maps: [${paramters}]"/>
         
-        <field-to-field field-name="organizationPartyId" map-name="parameters" to-map-name="newGlJournal"/>
-        <field-to-field field-name="glJournalName" map-name="parameters" to-map-name="newGlJournal"/>
+        <set from-field="parameters.organizationPartyId" field="newGlJournal.organizationPartyId"/>
+        <set from-field="parameters.glJournalName" field="newGlJournal.glJournalName"/>
         
         <log level="info" message="XXXX - Here is the newGlJournal map: [${newGlJournal}]"/>
-        <field-to-field field-name="description" map-name="parameters" to-map-name="newAcctgTrans"/>
-        <field-to-field field-name="acctgTransTypeId" map-name="parameters" to-map-name="newAcctgTrans"/>
-        <field-to-field field-name="glFiscalTypeId" map-name="parameters" to-map-name="newAcctgTrans"/>
-        <field-to-field field-name="transactionDate" map-name="parameters" to-map-name="newAcctgTrans"/>
+        <set from-field="parameters.description" field="newAcctgTrans.description"/>
+        <set from-field="parameters.acctgTransTypeId" field="newAcctgTrans.acctgTransTypeId"/>
+        <set from-field="parameters.glFiscalTypeId" field="newAcctgTrans.glFiscalTypeId"/>
+        <set from-field="parameters.transactionDate" field="newAcctgTrans.transactionDate"/>
         <log level="info" message="XXXX - Here is the newAcctgTrans map: [${newAcctgTrans}]"/>
         
         
@@ -122,36 +122,35 @@
             <result-to-field result-name="acctgTransId"/>
         </call-service>
         <log level="info" message="XXXX - Finished calling createAcctgTrans. Return acctgTransId: [${acctgTransId}]"/>
-	
-        <!-- field-to-field field-name="acctgTransId" map-name="newAcctgTrans" to-map-name="newAcctgTransEntryCredit"/ -->
-        <field-to-field field-name="acctgTransId" to-map-name="newAcctgTransEntryCredit"/>
-        <field-to-field field-name="acctgTransEntryTypeId" map-name="parameters" to-map-name="newAcctgTransEntryCredit"/>
-        <field-to-field field-name="partyId" map-name="parameters" to-map-name="newAcctgTransEntryCredit"/>
-        <field-to-field field-name="creditGlAccountId" map-name="parameters" to-field-name="glAccountId" to-map-name="newAcctgTransEntryCredit"/>
-        <field-to-field field-name="organizationPartyId" map-name="parameters" to-map-name="newAcctgTransEntryCredit"/>
-		<string-to-field field-name="debitCreditFlag" string="C" map-name="newAcctgTransEntryCredit"/>
-        <field-to-field field-name="amount" map-name="parameters" to-map-name="newAcctgTransEntryCredit"/>
+    
+        <!-- set from-field="newAcctgTrans.acctgTransId" field="newAcctgTransEntryCredit.acctgTransId"/ -->
+        <set field="newAcctgTransEntryCredit.acctgTransId" from-field="acctgTransId"/>
+        <set field="newAcctgTransEntryCredit.acctgTransEntryTypeId" from-field="parameters.acctgTransEntryTypeId"/>
+        <set field="newAcctgTransEntryCredit.partyId" from-field="parameters.partyId"/>
+        <set field="newAcctgTransEntryCredit.glAccountId" from-field="parameters.creditGlAccountId"/>
+        <set field="newAcctgTransEntryCredit.organizationPartyId" from-field="parameters.organizationPartyId"/>
+        <set field="newAcctgTransEntryCredit.debitCreditFlag" value="C"/>
+        <set field="newAcctgTransEntryCredit.amount" from-field="parameters.amount"/>
         <log level="info" message="XXXX - Creating AcctgTransEntry for credit side: [${newAcctgTransEntryCredit}]"/>
         <call-service service-name="createAcctgTransEntry" in-map-name="newAcctgTransEntryCredit"/>
-	
-		
-        <!-- field-to-field field-name="acctgTransId" map-name="newAcctgTrans" to-map-name="newAcctgTransEntryDebit"/ -->
-        <field-to-field field-name="acctgTransId" to-map-name="newAcctgTransEntryDebit"/>
-        <field-to-field field-name="acctgTransEntryTypeId" map-name="parameters" to-map-name="newAcctgTransEntryDebit"/>
-        <field-to-field field-name="partyId" map-name="parameters" to-map-name="newAcctgTransEntryDebit"/>
-        <field-to-field field-name="debitGlAccountId" map-name="parameters" to-field-name="glAccountId" to-map-name="newAcctgTransEntryDebit"/>
-        <field-to-field field-name="organizationPartyId" map-name="parameters" to-map-name="newAcctgTransEntryDebit"/>
-		<string-to-field field-name="debitCreditFlag" string="D" map-name="newAcctgTransEntryDebit"/>
-        <field-to-field field-name="amount" map-name="parameters" to-map-name="newAcctgTransEntryDebit"/>
+    
+        
+        <!-- set from-field="acctgTransId" map-name="newAcctgTrans" to-map-name="newAcctgTransEntryDebit"/ -->
+        <set field="newAcctgTransEntryDebit.acctgTransId" from-field="acctgTransId"/>
+        <set field="newAcctgTransEntryDebit.acctgTransEntryTypeId" from-field="parameters.acctgTransEntryTypeId"/>
+        <set field="newAcctgTransEntryDebit.partyId" from-field="parameters.partyId"/>
+        <set field="newAcctgTransEntryDebit.glAccountId" from-field="parameters.debitGlAccountId"/>
+        <set field="newAcctgTransEntryDebit.organizationPartyId" from-field="parameters.organizationPartyId"/>
+        <set field="newAcctgTransEntryDebit.debitCreditFlag" value="D"/>
+        <set field="newAcctgTransEntryDebit.amount" from-field="parameters.amount"/>
         <log level="info" message="XXXX - Creating AcctgTransEntry for debit side: [${newAcctgTransEntryDebit}]"/>
         <call-service service-name="createAcctgTransEntry" in-map-name="newAcctgTransEntryDebit"/>
-	
-		
+    
+        
         <field-to-result field-name="glJournalId" result-name="glJournalId"/>
         <field-to-result field-name="acctgTransId" result-name="acctgTransId"/>
     </simple-method> 
-	   
-	    
+       
     <simple-method method-name="createGlJournal" short-description="Create an GlJournal">
         <check-permission permission="ACCOUNTING" action="_CREATE"><fail-message message="Security Error: to run createGlJournal you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission"/></check-permission>
         <check-errors/>
@@ -169,20 +168,15 @@
         <check-permission permission="ACCOUNTING" action="_UPDATE"><fail-message message="Security Error: to run updateGlJournal you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission"/></check-permission>
         <check-errors/>
 
-        <make-value entity-name="GlJournal" value-name="lookupPKMap"/>
-        <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
-        <find-by-primary-key map-name="lookupPKMap" value-name="lookedUpValue"/>
+        <entity-one entity-name="GlJournal" value-name="lookedUpValue"/>
         <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
-        
         <store-value value-name="lookedUpValue"/>
     </simple-method>
     <simple-method method-name="deleteGlJournal" short-description="Delete an GlJournal">
         <check-permission permission="ACCOUNTING" action="_DELETE"><fail-message message="Security Error: to run deleteGlJournal you must have the ACCOUNTING_DELETE or ACCOUNTING_ADMIN permission"/></check-permission>
         <check-errors/>
 
-        <make-value entity-name="GlJournal" value-name="lookupPKMap"/>
-        <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
-        <find-by-primary-key map-name="lookupPKMap" value-name="lookedUpValue"/>
+        <entity-one entity-name="GlJournal" value-name="lookedUpValue"/>
         <remove-value value-name="lookedUpValue"/>
     </simple-method>
 
@@ -198,8 +192,8 @@
         <sequenced-id-to-env sequence-name="GlReconciliation" env-name="newEntity.glReconciliationId"/>
         <field-to-result field-name="newEntity.glReconciliationId" result-name="glReconciliationId"/>
         
-        <field-to-field field-name="userLoginId" map-name="userLogin" to-field-name="lastModifiedByUserLogin" to-map-name="newEntity"/>
-        <field-to-field field-name="userLoginId" map-name="userLogin" to-field-name="createdByUserLogin" to-map-name="newEntity"/>
+        <set from-field="userLogin.userLoginId" field="newEntity.lastModifiedByUserLogin"/>
+        <set from-field="userLogin.userLoginId" field="newEntity.createdByUserLogin"/>
         
         <create-value value-name="newEntity"/>
     </simple-method>
@@ -207,32 +201,24 @@
         <check-permission permission="ACCOUNTING" action="_UPDATE"><fail-message message="Security Error: to run updateGlReconciliation you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission"/></check-permission>
         <check-errors/>
 
-        <make-value entity-name="GlReconciliation" value-name="lookupPKMap"/>
-        <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
-        <find-by-primary-key entity-name="GlReconciliation" map-name="lookupPKMap" value-name="lookedUpValue"/>
+        <entity-one entity-name="GlReconciliation" value-name="lookedUpValue"/>
         <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
         
-        <field-to-field field-name="userLoginId" map-name="userLogin" to-field-name="lastModifiedByUserLogin" to-map-name="lookedUpValue"/>
-
+        <set from-field="userLogin.userLoginId" field="lookedUpValue.lastModifiedByUserLogin"/>
         <store-value value-name="lookedUpValue"/>
     </simple-method>
     <simple-method method-name="deleteGlReconciliation" short-description="Delete an GlReconciliation">
         <check-permission permission="ACCOUNTING" action="_DELETE"><fail-message message="Security Error: to run deleteGlReconciliation you must have the ACCOUNTING_DELETE or ACCOUNTING_ADMIN permission"/></check-permission>
         <check-errors/>
 
-        <make-value entity-name="GlReconciliation" value-name="lookupPKMap"/>
-        <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
-        <find-by-primary-key entity-name="GlReconciliation" map-name="lookupPKMap" value-name="lookedUpValue"/>
+        <entity-one entity-name="GlReconciliation" value-name="lookedUpValue"/>
         <remove-value value-name="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 -->
-        <make-value entity-name="GlReconciliation" value-name="lookupGLRMap"/>
-        <set-pk-fields map-name="parameters" value-name="lookupGLRMap"/>
-        <find-by-primary-key map-name="lookupGLRMap" value-name="lookedUpGLR"/>
-        
-        <field-to-field field-name="userLoginId" map-name="userLogin" to-field-name="lastModifiedByUserLogin" to-map-name="lookedUpGLR"/>
-        <store-value value-name="lookedUpValue"/>
+        <!-- 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-name="lookedUpGLR"/>
+        <set from-field="userLogin.userLoginId" field="lookedUpGLR.lastModifiedByUserLogin"/>
+        <store-value value-name="lookedUpGLR"/>
     </simple-method>
     
     <!-- ========= GlReconciliationEntry methods ========= -->
@@ -243,36 +229,30 @@
         <make-value entity-name="GlReconciliationEntry" value-name="newEntity"/>
         <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
         <set-pk-fields map-name="parameters" value-name="newEntity"/>
-
         <create-value value-name="newEntity"/>
 
-		<!-- when changing entries, also update the last modified info for the GlReconciliation -->
-		<call-simple-method method-name="updateGlReconciliationLastModified"/>
+        <!-- when changing entries, also update the last modified info for the GlReconciliation -->
+        <call-simple-method method-name="updateGlReconciliationLastModified"/>
     </simple-method>
     <simple-method method-name="updateGlReconciliationEntry" short-description="Update Entry To GlReconciliation">
         <check-permission permission="ACCOUNTING" action="_UPDATE"><fail-message message="Security Error: to run updateGlReconciliationEntry you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission"/></check-permission>
         <check-errors/>
 
-        <make-value entity-name="GlReconciliationEntry" value-name="lookupPKMap"/>
-        <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
-        <find-by-primary-key map-name="lookupPKMap" value-name="lookedUpValue"/>
+        <entity-one entity-name="GlReconciliationEntry" value-name="lookedUpValue"/>
         <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
-        
         <store-value value-name="lookedUpValue"/>
         
-		<!-- when changing entries, also update the last modified info for the GlReconciliation -->
-		<call-simple-method method-name="updateGlReconciliationLastModified"/>
+        <!-- when changing entries, also update the last modified info for the GlReconciliation -->
+        <call-simple-method method-name="updateGlReconciliationLastModified"/>
     </simple-method>
     <simple-method method-name="deleteGlReconciliationEntry" short-description="Remove Entry From GlReconciliation">
         <check-permission permission="ACCOUNTING" action="_DELETE"><fail-message message="Security Error: to run deleteGlReconciliationEntry you must have the ACCOUNTING_DELETE or ACCOUNTING_ADMIN permission"/></check-permission>
         <check-errors/>
 
-        <make-value entity-name="GlReconciliationEntry" value-name="lookupPKMap"/>
-        <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
-        <find-by-primary-key map-name="lookupPKMap" value-name="lookedUpValue"/>
+        <entity-one entity-name="GlReconciliationEntry" value-name="lookedUpValue"/>
         <remove-value value-name="lookedUpValue"/>
 
-		<!-- when changing entries, also update the last modified info for the GlReconciliation -->
-		<call-simple-method method-name="updateGlReconciliationLastModified"/>
+        <!-- when changing entries, also update the last modified info for the GlReconciliation -->
+        <call-simple-method method-name="updateGlReconciliationLastModified"/>
     </simple-method>
 </simple-methods>



More information about the Svn mailing list