svn commit: r1834186 - in /ofbiz/ofbiz-framework/trunk/applications: accounting/minilang/ledger/AcctgTransServices.xml accounting/minilang/ledger/GeneralLedgerServices.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: r1834186 - in /ofbiz/ofbiz-framework/trunk/applications: accounting/minilang/ledger/AcctgTransServices.xml accounting/minilang/ledger/GeneralLedgerServices.xml datamodel/entitydef/accounting-entitymodel.xml

Arun Patidar-4
Author: arunpatidar
Date: Sat Jun 23 09:17:33 2018
New Revision: 1834186

URL: http://svn.apache.org/viewvc?rev=1834186&view=rev
Log:
Improved: Make accounting entry configurable.
(OFBIZ-10391)

Thanks Aman Agrawal for your contribution.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/AcctgTransServices.xml
    ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/GeneralLedgerServices.xml
    ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/AcctgTransServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/AcctgTransServices.xml?rev=1834186&r1=1834185&r2=1834186&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/AcctgTransServices.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/AcctgTransServices.xml Sat Jun 23 09:17:33 2018
@@ -347,6 +347,15 @@ under the License.
                      <call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap">
                          <result-to-field result-name="partyAccountingPreference" field="partyAcctgPreference"/>
                      </call-service>
+                    <if>
+                        <condition>
+                            <if-compare field="partyAcctgPreference.enableAccounting" value="N" operator="equals"/>
+                        </condition>
+                        <then>
+                            <log level="warning" message="The internal organization with id [${acctgTransEntry.organizationPartyId}] has no PartyAcctgPreference setting; the following accounting transaction will be ignored: ${acctgTransEntry}"/>
+                            <return/>
+                        </then>
+                    </if>
                     <if-empty field="partyAcctgPreference.errorGlJournalId">
                         <!-- if no error journal is set, then return the error messages -->
                         <check-errors/>

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/GeneralLedgerServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/GeneralLedgerServices.xml?rev=1834186&r1=1834185&r2=1834186&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/GeneralLedgerServices.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/GeneralLedgerServices.xml Sat Jun 23 09:17:33 2018
@@ -260,8 +260,14 @@ under the License.
                 <call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap">
                      <result-to-field result-name="partyAccountingPreference" field="partyAcctgPreference"/>
                 </call-service>
-                <if-empty field="partyAcctgPreference">
-                    <log level="warning" message="The internal organization with id [${acctgTransEntry.organizationPartyId}] has no PartyAcctgPreference setting; the following accounting transaction will be ignored: ${acctgTransEntry}"/>
+                <if>
+                    <condition>
+                        <if-compare field="partyAcctgPreference.enableAccounting" value="N" operator="equals"/>
+                    </condition>
+                    <then>
+                        <log level="warning" message="The internal organization with id [${acctgTransEntry.organizationPartyId}] has no PartyAcctgPreference setting; the following accounting transaction will be ignored: ${acctgTransEntry}"/>
+                        <return/>
+                    </then>
                 <else>
                     <!-- if the amount field is empty, then determine it from the origAmount and origCurrencyUomId fields:
                          if origCurrencyUomId is different from the base currency of the organization, then the amount value will be converted -->
@@ -317,7 +323,7 @@ under the License.
                     </if-empty>
                     <set field="normalizedAcctgTransEntries[]" from-field="acctgTransEntry"/>
                 </else>
-                </if-empty>
+                </if>
             </else>
             </if-empty>
         </iterate>
@@ -1051,6 +1057,15 @@ under the License.
         <call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap">
              <result-to-field result-name="partyAccountingPreference" field="partyAcctgPreference"/>
         </call-service>
+        <if>
+            <condition>
+                <if-compare field="partyAcctgPreference.enableAccounting" value="N" operator="equals"/>
+            </condition>
+            <then>
+                <log level="warning" message="The internal organization with id [${partyAccountingPreferencesCallMap.organizationPartyId}] has no PartyAcctgPreference setting; the following accounting transaction will be ignored."/>
+                <return/>
+            </then>
+        </if>
         <set field="totalAmount" value="0.0" type="BigDecimal"/>
         <if>
             <condition>
@@ -1267,6 +1282,15 @@ under the License.
         <call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap">
              <result-to-field result-name="partyAccountingPreference" field="partyAcctgPreference"/>
         </call-service>
+        <if>
+            <condition>
+                <if-compare field="partyAcctgPreference.enableAccounting" value="N" operator="equals"/>
+            </condition>
+            <then>
+                <log level="warning" message="The internal organization with id [${partyAccountingPreferencesCallMap.organizationPartyId}] has no PartyAcctgPreference setting; the following accounting transaction will be ignored."/>
+                <return/>
+            </then>
+        </if>
         <if-not-empty field="shipmentReceipt.returnId">
             <if>
                 <condition>

Modified: ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml?rev=1834186&r1=1834185&r2=1834186&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml Sat Jun 23 09:17:33 2018
@@ -2488,6 +2488,7 @@ under the License.
         <relation type="one" fk-name="ACTGPREF_ODRSQ" title="OrderSequence" rel-entity-name="Enumeration">
             <key-map field-name="oldOrderSequenceEnumId" rel-field-name="enumId"/>
         </relation>
+        <field name="enableAccounting" type="indicator"/>
     </entity>
     <entity entity-name="PartyPrefDocTypeTpl"
             package-name="org.apache.ofbiz.accounting.ledger"