Author: apatel
Date: Sat Sep 15 18:32:28 2007 New Revision: 576020 URL: http://svn.apache.org/viewvc?rev=576020&view=rev Log: Code patch by Eriks Dobelis with some modifications based on comments on Jira issues https://issues.apache.org/jira/browse/OFBIZ-434 Eriks Thanks for your patch. Added: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/chartofaccounts/editGlJournalEntry.bsh Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml ofbiz/trunk/applications/accounting/widget/AccountingScreens.xml ofbiz/trunk/applications/accounting/widget/JournalEntryForms.xml ofbiz/trunk/applications/accounting/widget/Menus.xml Added: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/chartofaccounts/editGlJournalEntry.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/chartofaccounts/editGlJournalEntry.bsh?rev=576020&view=auto ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/chartofaccounts/editGlJournalEntry.bsh (added) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/chartofaccounts/editGlJournalEntry.bsh Sat Sep 15 18:32:28 2007 @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.ofbiz.base.util.*; + import org.ofbiz.entity.*; + + acctgTransId = request.getParameter("acctgTransId"); + if(acctgTransId !=null){ + acctgTrans = delegator.findByPrimaryKey("AcctgTrans", UtilMisc.toMap("acctgTransId", acctgTransId)); + isPosted = acctgTrans.get("isPosted"); + if (isPosted !=null && isPosted.equals("Y")){ + parameters.put("isPosted", isPosted); + } + } Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=576020&r1=576019&r2=576020&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Sat Sep 15 18:32:28 2007 @@ -454,6 +454,10 @@ <security https="true" auth="true"/> <response name="success" type="view" value="NewGlJournalEntry"/> </request-map> + <request-map uri="EditAcctgTrans"> + <security https="true" auth="true"/> + <response name="success" type="view" value="EditAcctgTrans"/> + </request-map> <request-map uri="ListUnpostedAcctgTrans"> <security https="true" auth="true"/> <response name="success" type="view" value="ListUnpostedAcctgTrans"/> @@ -464,6 +468,30 @@ <response name="success" type="view" value="ListUnpostedAcctgTrans"/> <response name="error" type="view" value="ListUnpostedAcctgTrans"/> </request-map> + <request-map uri="updateAcctgTrans"> + <security https="true" auth="true"/> + <event type="service" invoke="updateAcctgTrans"/> + <response name="success" type="view" value="EditAcctgTrans"/> + <response name="error" type="view" value="EditAcctgTrans"/> + </request-map> + <request-map uri="createAcctgTransEntry"> + <security https="true" auth="true"/> + <event type="service" invoke="createAcctgTransEntry"/> + <response name="success" type="view" value="EditAcctgTrans"/> + <response name="error" type="view" value="EditAcctgTrans"/> + </request-map> + <request-map uri="updateAcctgTransEntry"> + <security https="true" auth="true"/> + <event type="service" invoke="updateAcctgTransEntry"/> + <response name="success" type="view" value="EditAcctgTrans"/> + <response name="error" type="view" value="EditAcctgTrans"/> + </request-map> + <request-map uri="deleteAcctgTransEntry"> + <security https="true" auth="true"/> + <event type="service" invoke="deleteAcctgTransEntry"/> + <response name="success" type="view" value="EditAcctgTrans"/> + <response name="error" type="view" value="EditAcctgTrans"/> + </request-map> <!-- GlAccount requests --> <request-map uri="AssignGlAccount"> @@ -1456,6 +1484,7 @@ <view-map name="PartyAccountsSummary" type="screen" page="component://accounting/widget/AccountingScreens.xml#PartyAccountsSummary"/> <view-map name="FindGlJournalEntry" type="screen" page="component://accounting/widget/AccountingScreens.xml#FindGlJournalEntry"/> <view-map name="NewGlJournalEntry" type="screen" page="component://accounting/widget/AccountingScreens.xml#NewGlJournalEntry"/> + <view-map name="EditAcctgTrans" type="screen" page="component://accounting/widget/AccountingScreens.xml#EditAcctgTrans"/> <view-map name="ListUnpostedAcctgTrans" type="screen" page="component://accounting/widget/AccountingScreens.xml#ListUnpostedAcctgTrans"/> <!-- GlAccount, GlJournalEntry, AcctgTrans --> Modified: ofbiz/trunk/applications/accounting/widget/AccountingScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AccountingScreens.xml?rev=576020&r1=576019&r2=576020&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/AccountingScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/AccountingScreens.xml Sat Sep 15 18:32:28 2007 @@ -139,6 +139,7 @@ <actions> <set field="titleProperty" value="AcctgNewGlJournalEntry"/> <set field="tabButtonItem" value="FindGlJournalEntry"/> + <set field="organizationPartyId" from-field="parameters.organizationPartyId" global="true"/> <set field="labelTitleProperty" value="AcctgNewGlJournalEntry"/> </actions> <widgets> @@ -146,6 +147,60 @@ <decorator-section name="body"> <include-menu name="JournalEntryActionsBar" location="component://accounting/widget/Menus.xml"/> <include-form name="NewGlJournalEntry" location="component://accounting/widget/JournalEntryForms.xml"/> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + + <screen name="EditAcctgTrans"> + <section> + <actions> + <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/> + <set field="title" value="Edit Accounting transaction"/> + <set field="tabButtonItem" value="FindGlJournalEntry"/> + <set field="organizationPartyId" from-field="parameters.organizationPartyId" global="true"/> + <set field="acctgTransId" from-field="parameters.acctgTransId"/> + <script location="component://accounting/webapp/accounting/WEB-INF/actions/chartofaccounts/editGlJournalEntry.bsh"/> + <set field="isPosted" from-field="parameters.isPosted"/> + + <entity-one entity-name="AcctgTrans" value-name="acctgTrans"/> + <entity-one entity-name="AcctgTransEntry" value-name="acctgTransEntry"> + <field-map field-name="acctgTransId"/> + <field-map field-name="acctgTransEntrySeqId" env-name="parameters.editAcctgTransEntrySeqId"/> + </entity-one> + <entity-and entity-name="AcctgTransEntry" list-name="acctgTransEntries"> + <field-map field-name="acctgTransId"/> + <order-by field-name="acctgTransEntrySeqId"/> + </entity-and> + </actions> + <widgets> + <decorator-screen name="CommonPartyAccountsDecorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <section> + <condition> + <not><if-empty field-name="acctgTransId"/></not> + </condition> + <widgets> + <container> + <include-form name="EditAcctgTrans" location="component://accounting/widget/JournalEntryForms.xml"/> + <include-form name="ListAcctgTransEntries" location="component://accounting/widget/JournalEntryForms.xml"/> + </container> + </widgets> + </section> + <section> + <condition> + <if-empty field-name="isPosted"/> + </condition> + <widgets> + <container> + <link target="EditAcctgTrans?acctgTransId=${acctgTransId}&organizationPartyId=${organizationPartyId}" text="${uiLabelMap.AcctgNewGlJournalEntry}" style="buttontext"/> + </container> + <container> + <include-form name="EditAcctgTransEntry" location="component://accounting/widget/JournalEntryForms.xml"/> + </container> + </widgets> + </section> </decorator-section> </decorator-screen> </widgets> Modified: ofbiz/trunk/applications/accounting/widget/JournalEntryForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/JournalEntryForms.xml?rev=576020&r1=576019&r2=576020&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/JournalEntryForms.xml (original) +++ ofbiz/trunk/applications/accounting/widget/JournalEntryForms.xml Sat Sep 15 18:32:28 2007 @@ -59,7 +59,7 @@ </service> </actions> <field name="acctgTransId" widget-style="buttontext"> - <hyperlink also-hidden="false" description="${acctgTransId}" target="ListAcctgTransEntries?acctgTransId=${acctgTransId}"/> + <hyperlink also-hidden="false" description="${acctgTransId}" target="EditAcctgTrans?acctgTransId=${acctgTransId}&organizationPartyId=${organizationPartyId}"/> </field> <field name="transactionDate"><display/></field> <field name="acctgTransTypeId"><display-entity entity-name="AcctgTransType" description="${description}"/></field> @@ -78,7 +78,7 @@ <form name="ListUnpostedAcctgTrans" type="list" title="Unposted Accounting Transactions" list-name="transactions"> <field name="acctgTransId" widget-style="buttontext"> - <hyperlink also-hidden="false" description="${acctgTransId}" target="ListAcctgTransEntries?acctgTransId=${acctgTransId}"/> + <hyperlink also-hidden="false" description="${acctgTransId}" target="EditAcctgTrans?acctgTransId=${acctgTransId}&organizationPartyId=${organizationPartyId}"/> </field> <field name="transactionDate"><display/></field> <field name="acctgTransTypeId"><display-entity entity-name="AcctgTransType" description="${description}"/></field> @@ -156,4 +156,87 @@ <field name="submitButton" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field> </form> + <form name="EditAcctgTrans" type="single" target="updateAcctgTrans" default-map-name="acctgTrans" default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext"> + <field name="acctgTransId"><display/></field> + <field name="organizationPartyId" map-name="parameter"><hidden/></field> + <field name="acctgTransTypeId" title="${uiLabelMap.AccountingTransactionType}" widget-style="selectBox"> + <drop-down> + <entity-options entity-name="AcctgTransType" description="${description}"> + <entity-order-by field-name="acctgTransTypeId"/> + </entity-options> + </drop-down> + </field> + <field name="glFiscalTypeId" widget-style="selectBox"> + <drop-down> + <entity-options entity-name="GlFiscalType" description="${description}"> + <entity-order-by field-name="glFiscalTypeId"/> + </entity-options> + </drop-down> + </field> + <field name="transactionDate"><date-time/></field> + <field name="updateButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field> + </form> + + <form name="EditAcctgTransEntry" type="single" target="updateAcctgTransEntry" default-map-name="acctgTransEntry" default-entity-name="AcctgTransEntry"> + <alt-target use-when="acctgTransEntry==null" target="createAcctgTransEntry"/> + <field name="acctgTransId"><hidden/></field> + <field name="acctgTransEntrySeqId"><hidden/></field> + <field name="acctgTransTypeId" title="${uiLabelMap.AccountingTransactionType}"> + <drop-down> + <entity-options entity-name="AcctgTransType" description="${description}"> + <entity-order-by field-name="acctgTransTypeId"/> + </entity-options> + </drop-down> + </field> + <field name="acctgTransEntryTypeId" ><hidden value="_NA_"/></field> + <field name="description"><text size="30"/></field> + <field name="glAccountId" widget-style="selectBox"> + <drop-down> + <entity-options entity-name="GlAccount" description="${glAccountId}: ${accountName}" key-field-name="glAccountId"> + <entity-order-by field-name="glAccountId"/> + </entity-options> + </drop-down> + </field> + <field name="amount"><text size="30"/></field> + <field name="voucherRef"><text size="30"/></field> + <field name="partyId"><text size="30"/></field> + <field name="organizationPartyId"><hidden/></field> + <field name="productId"><text size="20"/></field> + <field name="debitCreditFlag"> + <drop-down current="selected"> + <option description="Credit" key="C"/> + <option description="Debit" key="D"/> + </drop-down> + </field> + <field name="reconcileStatusId"><text size="30"/></field> + <field name="settlementTermId"><text size="20"/></field> + <field name="isSummary"><text size="10"/></field> + <field use-when="acctgTransEntry!=null" name="updateButton" title="${uiLabelMap.CommonUpdate}" widget-style="buttontext" ><submit button-type="text-link"/></field> + <field use-when="acctgTransEntry==null" name="createButton" title="${uiLabelMap.CommonCreate}" widget-style="buttontext" ><submit button-type="text-link"/></field> + </form> + <form name="ListAcctgTransEntries" type="list" list-name="acctgTransEntries" default-entity-name="AcctgTransEntry"> + <field name="acctgTransId"><hidden/></field> + <field name="acctgTransEntrySeqId"><hidden/></field> + <field name="glAccountId"> + <display-entity entity-name="GlAccount" description="${accountName}"> + <sub-hyperlink target="ListGlAccountEntries?glAccountId=${glAccountId}" description="[${glAccountId}]"/> + </display-entity> + </field> + <field name="description"><display/></field> + <field name="voucherRef"><display/></field> + <field name="partyId"><display/></field> + <field name="organizationPartyId"><display/></field> + <field name="productId"><display/></field> + <field name="debitCreditFlag"><display/></field> + <field name="amount"><display/></field> + <field name="reconcileStatusId"><display/></field> + <field name="settlementTermId"><display/></field> + <field name="isSummary"><display/></field> + <field name="EditButton" title="" widget-style="buttontext" use-when="isPosted==null"> + <hyperlink description="${uiLabelMap.CommonEdit}" target="EditAcctgTrans?acctgTransId=${acctgTransId}&editAcctgTransEntrySeqId=${acctgTransEntrySeqId}&organizationPartyId=${organizationPartyId}"/> + </field> + <field name="removeButton" title="" widget-style="buttontext" use-when="isPosted==null"> + <hyperlink description="${uiLabelMap.CommonRemove}" target="deleteAcctgTransEntry?acctgTransId=${acctgTransId}&acctgTransEntrySeqId=${acctgTransEntrySeqId}&organizationPartyId=${organizationPartyId}"/> + </field> + </form> </forms> Modified: ofbiz/trunk/applications/accounting/widget/Menus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/Menus.xml?rev=576020&r1=576019&r2=576020&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/Menus.xml (original) +++ ofbiz/trunk/applications/accounting/widget/Menus.xml Sat Sep 15 18:32:28 2007 @@ -403,8 +403,7 @@ </menu-item> </menu> - <menu name="JournalEntryActionsBar" menu-container-style="button-bar button-style-2" type="simple" - default-selected-style="selected"> + <menu name="JournalEntryActionsBar" menu-container-style="button-bar button-style-2" type="simple"> <menu-item name="FindGlJournalEntry" title="${uiLabelMap.AcctgFindGlJournalEntry}"> <link target="FindGlJournalEntry?organizationPartyId=${organizationPartyId}"/> </menu-item> |
Free forum by Nabble | Edit this page |