You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ap...@apache.org on 2009/09/09 15:23:33 UTC
svn commit: r812946 - in /ofbiz/trunk/applications/accounting: config/
entitydef/ script/org/ofbiz/accounting/finaccount/ servicedef/
webapp/accounting/finaccounttrans/ widget/
Author: apatel
Date: Wed Sep 9 13:23:32 2009
New Revision: 812946
URL: http://svn.apache.org/viewvc?rev=812946&view=rev
Log:
User can add openinig balance. Patch from OFBIZ-2918. Thanks Ratnesh for implementation.
Modified:
ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml
ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml
ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl
ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl
ofbiz/trunk/applications/accounting/widget/FinAccountForms.xml
ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml
ofbiz/trunk/applications/accounting/widget/GlForms.xml
Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=812946&r1=812945&r2=812946&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Wed Sep 9 13:23:32 2009
@@ -9837,6 +9837,10 @@
<value xml:lang="it">Id client</value>
<value xml:lang="zh">å®¢æ·æ è¯</value>
</property>
+ <property key="FormFieldTitle_closingBalance">
+ <value xml:lang="en">Closing Balance</value>
+ <value xml:lang="hi_IN">बà¤à¤¦ शà¥à¤·</value>
+ </property>
<property key="FormFieldTitle_closingBalanceCredit">
<value xml:lang="en">Closing Balance Credit</value>
<value xml:lang="hi_IN">बà¤à¤¦ शà¥à¤· à¤à¤®à¤¾</value>
Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?rev=812946&r1=812945&r2=812946&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Wed Sep 9 13:23:32 2009
@@ -2184,6 +2184,7 @@
<field name="statusId" type="id-ne"></field>
<field name="organizationPartyId" type="id-ne"></field>
<field name="reconciledBalance" type="currency-amount"></field>
+ <field name="openingBalance" type="currency-amount"></field>
<field name="reconciledDate" type="date-time"></field>
<prim-key field="glReconciliationId"/>
<relation type="one" fk-name="GLREC_GLACCT" rel-entity-name="GlAccount">
Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml?rev=812946&r1=812945&r2=812946&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml Wed Sep 9 13:23:32 2009
@@ -604,6 +604,9 @@
<field-to-result field="totalApprovedTransactions"/>
<field-to-result field="createdApprovedGrandTotal"/>
<field-to-result field="totalCreatedApprovedTransactions"/>
+ <if-not-empty field="parameters.openingBalance">
+ <set field="glReconciliationApprovedGrandTotal" type="BigDecimal" value="${glReconciliationApprovedGrandTotal + parameters.openingBalance}"/>
+ </if-not-empty>
<field-to-result field="glReconciliationApprovedGrandTotal"/>
</simple-method>
@@ -621,7 +624,8 @@
<set field="numberOfTransactions" type="Long" value="${numberOfTransactions + 1}"/>
<field-to-result field="numberOfTransactions"/>
<set field="openingBalance" type="BigDecimal" from-field="parameters.openingBalance" default-value="0"/>
- <set field="endingBalance" type="BigDecimal" value="${openingBalance + runningTotal}"/>
+ <set field="reconciledBalance" type="BigDecimal" from-field="parameters.reconciledBalance" default-value="0"/>
+ <set field="endingBalance" type="BigDecimal" value="${openingBalance + reconciledBalance + runningTotal}"/>
<set-service-fields service-name="getPartyAccountingPreferences" map="parameters" to-map="getPartyAccountingPreferencesMap"/>
<call-service service-name="getPartyAccountingPreferences" in-map-name="getPartyAccountingPreferencesMap">
<result-to-field result-name="partyAccountingPreference"/>
Modified: ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml?rev=812946&r1=812945&r2=812946&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml Wed Sep 9 13:23:32 2009
@@ -219,6 +219,7 @@
<attribute name="thruTransactionDate" type="Timestamp" mode="IN" optional="true"/>
<attribute name="fromEntryDate" type="Timestamp" mode="IN" optional="true"/>
<attribute name="thruEntryDate" type="Timestamp" mode="IN" optional="true"/>
+ <attribute name="openingBalance" type="BigDecimal" mode="IN" optional="true"/>
<attribute name="finAccountTransList" type="List" mode="OUT" optional="true"/>
<attribute name="searchedNumberOfRecords" type="Integer" mode="OUT" optional="true"/>
<attribute name="grandTotal" type="BigDecimal" mode="OUT" optional="true"/>
@@ -236,6 +237,7 @@
<attribute name="finAccountTransId" type="String" mode="IN" optional="false"/>
<attribute name="organizationPartyId" type="String" mode="IN" optional="false"/>
<attribute name="openingBalance" type="BigDecimal" mode="IN" optional="true"/>
+ <attribute name="reconciledBalance" type="BigDecimal" mode="IN" optional="true"/>
<attribute name="runningTotal" type="BigDecimal" mode="INOUT" optional="true"/>
<attribute name="numberOfTransactions" type="Long" mode="INOUT" optional="true"/>
<attribute name="finAccountTransRunningTotal" type="String" mode="OUT" optional="true"/>
Modified: ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl?rev=812946&r1=812945&r2=812946&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl Wed Sep 9 13:23:32 2009
@@ -70,7 +70,8 @@
$('showFinAccountTransRunningTotal').update("");
$('finAccountTransRunningTotal').update("");
$('numberOfFinAccountTransaction').update("");
- $('endingBalance').update($('openingBalanceWithUom').value);
+ $('endingBalance').update($('endingBalanceInput').value);
+
}
$('submitButton').disabled = true;
}
@@ -91,8 +92,8 @@
<input name="finAccountId" type="hidden" value="${parameters.finAccountId}"/>
<input name="statusId" type="hidden" value="${parameters.statusId?if_exists}"/>
<#if !grandTotal?exists>
- <input name="openingBalance" type="hidden" value="${glReconciliationApprovedGrandTotal}"/>
- <input name="openingBalanceWithUom" type="hidden" id="openingBalanceWithUom" value="<@ofbizCurrency amount=glReconciliationApprovedGrandTotal?if_exists/>"/>
+ <input name="reconciledBalance" type="hidden" value="${(glReconciliation.reconciledBalance)?if_exists}"/>
+ <input name="reconciledBalanceWithUom" type="hidden" id="reconciledBalanceWithUom" value="<@ofbizCurrency amount=(glReconciliation.reconciledBalance)?default('0')/>"/>
</#if>
<#assign glReconciliations = delegator.findByAnd("GlReconciliation", {"glAccountId" : finAccount.postToGlAccountId, "statusId" : "GLREC_CREATED"}, Static["org.ofbiz.base.util.UtilMisc"].toList("reconciledDate DESC"))>
<#if (glReconciliationId?has_content && (glReconciliationId == "_NA_" && finAccountTransList?has_content)) || !grandTotal?exists>
@@ -168,6 +169,7 @@
</#if>
<#if finAccountTrans.glReconciliationId?has_content>
<#assign glReconciliation = delegator.findOne("GlReconciliation", {"glReconciliationId" : finAccountTrans.glReconciliationId}, true)>
+ <input name="openingBalance_o_${finAccountTrans_index}" type="hidden" value="${glReconciliation.openingBalance?if_exists}"/>
</#if>
<#if finAccountTrans.partyId?has_content>
<#assign partyName = (delegator.findOne("PartyNameView", {"partyId" : finAccountTrans.partyId}, true))!>
@@ -296,15 +298,18 @@
<tr>
<th>${uiLabelMap.AccountingRunningTotal} / ${uiLabelMap.AccountingNumberOfTransaction}</th>
<th>${uiLabelMap.AccountingOpeningBalance}</th>
- <th>${uiLabelMap.AccountingEndingBalance}</th>
+ <th>${uiLabelMap.FormFieldTitle_reconciledBalance}</th>
+ <th>${uiLabelMap.FormFieldTitle_closingBalance}</th>
</tr>
<tr>
<td>
<span id="finAccountTransRunningTotal"></span> /
<span id="numberOfFinAccountTransaction"></span>
</td>
- <td><@ofbizCurrency amount=glReconciliationApprovedGrandTotal?if_exists/></td>
+ <td><@ofbizCurrency amount=glReconciliation.openingBalance?default('0')/></td>
+ <td><@ofbizCurrency amount=glReconciliation.reconciledBalance?default('0')/></td>
<td id="endingBalance"><@ofbizCurrency amount=glReconciliationApprovedGrandTotal?if_exists/></td>
+ <input type="hidden" id="endingBalanceInput" value="<@ofbizCurrency amount=glReconciliationApprovedGrandTotal?if_exists/>"/>
</tr>
</table>
</#if>
Modified: ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl?rev=812946&r1=812945&r2=812946&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl Wed Sep 9 13:23:32 2009
@@ -51,6 +51,10 @@
<td><span class="label">${uiLabelMap.FormFieldTitle_reconciledDate}</span></td>
<td>${currentGlReconciliation.reconciledDate?if_exists}</td>
</tr>
+ <tr>
+ <td><span class="label">${uiLabelMap.AccountingOpeningBalance}</span></td>
+ <td><@ofbizCurrency amount=currentGlReconciliation.openingBalance?default('0')/></td>
+ </tr>
</table>
</#if>
</div>
@@ -76,6 +80,10 @@
<td><span class="label">${uiLabelMap.FormFieldTitle_reconciledDate}</span></td>
<td>${previousGlReconciliation.reconciledDate?if_exists}</td>
</tr>
+ <tr>
+ <td><span class="label">${uiLabelMap.AccountingOpeningBalance}</span></td>
+ <td><@ofbizCurrency amount=previousGlReconciliation.openingBalance?default('0')/></td>
+ </tr>
</table>
</#if>
</div>
Modified: ofbiz/trunk/applications/accounting/widget/FinAccountForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/FinAccountForms.xml?rev=812946&r1=812945&r2=812946&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/FinAccountForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/FinAccountForms.xml Wed Sep 9 13:23:32 2009
@@ -429,5 +429,6 @@
</hyperlink>
</field>
<field name="reconciledBalance"><display type="currency" currency="${currencyUomId}"></display></field>
+ <field name="openingBalance"><display type="currency" currency="${currencyUomId}"></display></field>
</form>
</forms>
Modified: ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml?rev=812946&r1=812945&r2=812946&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml Wed Sep 9 13:23:32 2009
@@ -491,6 +491,8 @@
</not>
</condition>
<actions>
+ <entity-one entity-name="GlReconciliation" value-field="glReconciliation"/>
+ <set field="parameters.openingBalance" from-field="glReconciliation.openingBalance"/>
<service service-name="getFinAccountTransListAndTotals" result-map="finAccountTransListAndTotals" auto-field-map="true"/>
<set field="finAccountTransList" type="List" from-field="finAccountTransListAndTotals.finAccountTransList"/>
<set field="createdApprovedGrandTotal" type="BigDecimal" from-field="finAccountTransListAndTotals.createdApprovedGrandTotal"/>
Modified: ofbiz/trunk/applications/accounting/widget/GlForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlForms.xml?rev=812946&r1=812945&r2=812946&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/GlForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/GlForms.xml Wed Sep 9 13:23:32 2009
@@ -799,6 +799,7 @@
<field name="reconciledDate"><date-time/></field>
<field name="organizationPartyId"><display/></field>
<field name="reconciledBalance"><display/></field>
+ <field name="openingBalance" use-when=""GLREC_RECONCILED".equals("${glReconciliation.statusId}")"><display/></field>
<field use-when="glReconciliationId!=null" name="updateButton" title="${uiLabelMap.CommonUpdate}" widget-style="buttontext" ><submit button-type="text-link"/></field>
</form>
<form name="ListGlReconciliationEntries" type="list" use-row-submit="true"