You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by si...@apache.org on 2007/02/26 19:45:09 UTC

svn commit: r511942 - in /ofbiz/trunk/applications/accounting: entitydef/entitymodel.xml script/org/ofbiz/accounting/ledger/AcctgTransServices.xml

Author: sichen
Date: Mon Feb 26 10:45:09 2007
New Revision: 511942

URL: http://svn.apache.org/viewvc?view=rev&rev=511942
Log:
Added a new field of scheduledPostingDate to AcctgTrans and modified postAcctgTrans not to post if the current date time is before is before the scheduled posting time

Modified:
    ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml

Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?view=diff&rev=511942&r1=511941&r2=511942
==============================================================================
--- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Mon Feb 26 10:45:09 2007
@@ -1028,6 +1028,7 @@
       <field name="transactionDate" type="date-time"></field>
       <field name="isPosted" type="indicator"></field>
       <field name="postedDate" type="date-time"></field>
+      <field name="scheduledPostingDate" type="date-time"></field>
       <field name="glJournalId" type="id"></field>
       <field name="glFiscalTypeId" type="id"></field>
       <field name="voucherRef" type="short-varchar"></field>

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml?view=diff&rev=511942&r1=511941&r2=511942
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml Mon Feb 26 10:45:09 2007
@@ -171,6 +171,15 @@
             <order-by field-name="acctgTransEntrySeqId"/>
         </entity-condition>
         
+        <!-- check the scheduled posting date, but only if it's set -->
+        <if-not-empty field-name="acctgTrans.scheduledPostingDate">
+            <set field="scheduledPostingDate" from-field="acctgTrans.scheduledPostingDate"/>
+            <set field="beforeScheduled" value="${bsh: org.ofbiz.base.util.UtilDateTime.nowTimestamp().before(scheduledPostingDate)}"/>
+            <if-compare field-name="beforeScheduled" operator="equals" value="true" type="Boolean">
+                <add-error><fail-message message="Not posting GL Accounting Transaction with ID [${parameters.acctgTransId}] because it's not scheduled to be posted yet.  The scheduled posting date is [${acctgTrans.scheduledPostingDate}]"/></add-error>
+            </if-compare>
+        </if-not-empty>
+
         <!-- setup periodTypeIdList to use for CustomTimePeriod support -->
         <set value="FISCAL_YEAR" field="onlyIncludePeriodTypeIdList[]"/>
         <set value="FISCAL_QUARTER" field="onlyIncludePeriodTypeIdList[]"/>