Author: jacopoc
Date: Thu Apr 10 01:58:40 2008 New Revision: 646697 URL: http://svn.apache.org/viewvc?rev=646697&view=rev Log: Applied patch from Sumit Porwal, with some changes I did, (OFBIZ-1632 "Refactor the getGlAccountFromAccountType minilang method so that all the entity-one calls are replaced by calls to minilang (inline) methods.") and patch from Rashko Rejmer (OFBIZ-1631, "Replace all the code that directly retrieves from the db a PartyAcctgPreference for an organizationPartyId with a call to the service implemented in OFBIZ-1630"); misc cleanups to gl forms and screens; implemented new service to manually run the mappings for acctg trans entries (useful also to test the gl setup for automatic transactions). Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml ofbiz/trunk/applications/accounting/widget/GlForms.xml ofbiz/trunk/applications/accounting/widget/GlScreens.xml ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml ofbiz/trunk/applications/accounting/widget/GlSetupScreens.xml ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/receiveInventory.bsh ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original) +++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Thu Apr 10 01:58:40 2008 @@ -2790,6 +2790,9 @@ <value xml:lang="th">à¸à¹à¸à¸¡à¸¹à¸¥</value> <value xml:lang="zh">ä¿¡æ¯</value> </property> + <property key="AccountingInheritedValue"> + <value xml:lang="en">Inherited Value</value> + </property> <property key="AccountingInvNr"> <value xml:lang="ar">رÙ٠اÙÙاتÙرة</value> <value xml:lang="en">Inv.Nr</value> 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?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml (original) +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml Thu Apr 10 01:58:40 2008 @@ -64,9 +64,10 @@ <!-- if not explicitly provided in the parameters, set the currency of the entry from PartyAcctgPreference --> <if-empty field-name="parameters.currencyUomId"> - <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference" use-cache="true"> - <field-map env-name="parameters.organizationPartyId" field-name="partyId"/> - </entity-one> + <set field="partyAccountingPreferencesCallMap.organizationPartyId" from-field="parameters.organizationPartyId"/> + <call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap"> + <result-to-field result-name="partyAccountingPreference" field-name="partyAcctgPreference"/> + </call-service> <set from-field="partyAcctgPreference.baseCurrencyUomId" field="newEntity.currencyUomId"/> </if-empty> <if-empty field-name="newEntity.acctgTransEntryTypeId"> @@ -245,9 +246,10 @@ <!-- if there are errors and we have an error journal assign to the journal and return --> <if-not-empty field-name="error_list"> <iterate list-name="acctgTransEntryList" entry-name="acctgTransEntry"> - <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference" use-cache="true" auto-field-map="false"> - <field-map field-name="partyId" env-name="acctgTransEntry.organizationPartyId"/> - </entity-one> + <set field="partyAccountingPreferencesCallMap.organizationPartyId" from-field="acctgTransEntry.organizationPartyId"/> + <call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap"> + <result-to-field result-name="partyAccountingPreference" field-name="partyAcctgPreference"/> + </call-service> <if-empty field-name="partyAcctgPreference.errorGlJournalId"> <!-- if no error journal is set, then return the error messages --> <check-errors/> Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml (original) +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml Thu Apr 10 01:58:40 2008 @@ -263,6 +263,38 @@ </simple-method> <!-- ========== GL Posting Services ========== --> + <simple-method method-name="completeAcctgTransEntries" short-description="Completes, if possible, the AcctgTransEntries using the mappings defined in the gl setup"> + <entity-one entity-name="AcctgTrans" value-name="acctgTrans"/> + <get-related value-name="acctgTrans" relation-name="AcctgTransEntry" list-name="acctgTransEntries"/> + <iterate list-name="acctgTransEntries" entry-name="acctgTransEntry"> + <!-- if the glAccountId is empty, but we have a glAccountTypeId, then we will determine the + correct glAccountId from the gl setup settings --> + <if-empty field-name="acctgTransEntry.glAccountId"> + <clear-field field-name="getGlAccountFromAccountTypeInMap"/> + <set field="getGlAccountFromAccountTypeInMap.organizationPartyId" from-field="acctgTransEntry.organizationPartyId"/> + <set field="getGlAccountFromAccountTypeInMap.acctgTransTypeId" from-field="acctgTrans.acctgTransTypeId"/> + <set field="getGlAccountFromAccountTypeInMap.glAccountTypeId" from-field="acctgTransEntry.glAccountTypeId"/> + <set field="getGlAccountFromAccountTypeInMap.debitCreditFlag" from-field="acctgTransEntry.debitCreditFlag"/> + <set field="getGlAccountFromAccountTypeInMap.productId" from-field="acctgTransEntry.productId"/> + <set field="getGlAccountFromAccountTypeInMap.partyId" from-field="acctgTrans.partyId"/> + <set field="getGlAccountFromAccountTypeInMap.invoiceId" from-field="acctgTrans.invoiceId"/> + <set field="getGlAccountFromAccountTypeInMap.paymentId" from-field="acctgTrans.paymentId"/> + <call-service service-name="getGlAccountFromAccountType" in-map-name="getGlAccountFromAccountTypeInMap"> + <result-to-field result-name="glAccountId" field-name="acctgTransEntry.glAccountId"/> + </call-service> + </if-empty> + <if-empty field-name="acctgTransEntry.origAmount"> + <set field="acctgTransEntry.origAmount" from-field="acctgTransEntry.amount"/> + </if-empty> + <entity-one entity-name="GlAccountType" value-name="glAccountType" use-cache="true" auto-field-map="false"> + <field-map field-name="glAccountTypeId" env-name="acctgTransEntry.glAccountTypeId"/> + </entity-one> + <if-empty field-name="glAccountType"> + <clear-field field-name="acctgTransEntry.glAccountTypeId"/> + </if-empty> + <store-value value-name="acctgTransEntry"/> + </iterate> + </simple-method> <simple-method method-name="createAcctgTransAndEntries" short-description="Verifies and posts a set of AcctgTransEntries"> <!-- retrieve ledger rounding properties --> <property-to-field resource="arithmetic" property="ledger.decimals" field-name="ledgerDecimals"/> @@ -279,9 +311,10 @@ <if-empty field-name="partyRole"> <log level="warning" message="The party with id [${acctgTransEntry.organizationPartyId}] is not an internal organization; the following accounting transaction will be ignored: ${acctgTransEntry}"/> <else> - <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference" use-cache="true" auto-field-map="false"> - <field-map field-name="partyId" env-name="acctgTransEntry.organizationPartyId"/> - </entity-one> + <set field="partyAccountingPreferencesCallMap.organizationPartyId" from-field="acctgTransEntry.organizationPartyId"/> + <call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap"> + <result-to-field result-name="partyAccountingPreference" field-name="partyAcctgPreference"/> + </call-service> <if-empty field-name="partyAcctgPreference"> <log level="warning" message="The internal organization with id [${acctgTransEntry.organizationPartyId}] has no PartyAcctgPreference setting; the following accounting transaction will be ignored: ${acctgTransEntry}"/> <else> @@ -391,11 +424,7 @@ <simple-method method-name="getGlAccountFromAccountType" short-description="Look up a GlAccountId from GlAccountTypeId"> <!-- if this is an inventory variance then the glAccountTypeId contains the varianceReasonId; the value is used to lookup the account id in the VarianceReasonGlAccount entity --> <if-compare field-name="parameters.acctgTransTypeId" operator="equals" value="ITEM_VARIANCE"> - <!-- TODO: refactor the entity-one into a simple-method call: input organizationPartyId and varianceReasonId; output varianceReasonGlAccount --> - <entity-one entity-name="VarianceReasonGlAccount" value-name="varianceReasonGlAccount"> - <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> - <field-map field-name="varianceReasonId" env-name="parameters.glAccountTypeId"/> - </entity-one> + <call-simple-method method-name="getVarianceReasonGlAccountInline"/> <if-not-empty field-name="varianceReasonGlAccount.glAccountId"> <field-to-result field-name="varianceReasonGlAccount.glAccountId" result-name="glAccountId"/> <return/> @@ -442,20 +471,13 @@ <set field="roleTypeId" value="BILL_TO_CUSTOMER"/> </else> </if> - <!-- TODO: refactor the entity-one into a simple-method call: input organizationPartyId, partyId, roleTypeId and glAccountTypeId; output partyGlAccount --> - <entity-one entity-name="PartyGlAccount" value-name="partyGlAccount"> - <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> - <field-map field-name="partyId" env-name="parameters.partyId"/> - <field-map field-name="roleTypeId" env-name="roleTypeId"/> - <field-map field-name="glAccountTypeId" env-name="parameters.glAccountTypeId"/> - </entity-one> + <call-simple-method method-name="getPartyGlAccountInline"/> <if-not-empty field-name="partyGlAccount.glAccountId"> <field-to-result field-name="partyGlAccount.glAccountId" result-name="glAccountId"/> <return/> </if-not-empty> </then> </if> - <if> <condition> <and> @@ -473,7 +495,6 @@ </and> </condition> <then> - <entity-one entity-name="Payment" value-name="payment"/> <get-related-one value-name="payment" relation-name="PaymentMethod" to-value-name="paymentMethod"/> <if-not-empty field-name="paymentMethod.glAccountId"> @@ -482,21 +503,13 @@ </if-not-empty> <if-compare field-name="payment.paymentMethodTypeId" operator="equals" value="CREDIT_CARD"> <get-related-one value-name="payment" relation-name="CreditCard" to-value-name="creditCard"/> - <!-- TODO: refactor the entity-one into a simple-method call: input organizationPartyId and cardType; output creditCardTypeGlAccount --> - <entity-one entity-name="CreditCardTypeGlAccount" value-name="creditCardTypeGlAccount"> - <field-map field-name="cardType" env-name="creditCard.cardType"/> - <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> - </entity-one> + <call-simple-method method-name="getCreditCardTypeGlAccountInline"/> <if-not-empty field-name="creditCardTypeGlAccount.glAccountId"> <field-to-result field-name="creditCardTypeGlAccount.glAccountId" result-name="glAccountId"/> <return/> </if-not-empty> </if-compare> - <!-- TODO: refactor the entity-one into a simple-method call: input organizationPartyId and paymentMethodTypeId; output paymentMethodTypeGlAccount --> - <entity-one entity-name="PaymentMethodTypeGlAccount" value-name="paymentMethodTypeGlAccount"> - <field-map field-name="paymentMethodTypeId" env-name="payment.paymentMethodTypeId"/> - <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> - </entity-one> + <call-simple-method method-name="getPaymentMethodTypeGlAccountInline"/> <if-not-empty field-name="paymentMethodTypeGlAccount.glAccountId"> <field-to-result field-name="paymentMethodTypeGlAccount.glAccountId" result-name="glAccountId"/> <return/> @@ -505,8 +518,7 @@ </then> </if> <if-not-empty field-name="parameters.productId"> - <!-- TODO: refactor the entity-one into a simple-method call: input organizationPartyId, glAccountTypeId and productId; output productGlAccount --> - <entity-one entity-name="ProductGlAccount" value-name="productGlAccount" use-cache="true"/> + <call-simple-method method-name="getProductGlAccountInline"/> <!-- if nothing found look if the parameters.productId is member of any ProductCategory in ProductCategoryGlAccount --> <if-empty field-name="productGlAccount.glAccountId"> <entity-and entity-name="ProductCategoryMember" list-name="productCategoryMembers" filter-by-date="true"> @@ -514,12 +526,7 @@ <order-by field-name="-fromDate"/> </entity-and> <iterate list-name="productCategoryMembers" entry-name="productCategoryMember"> - <!-- TODO: refactor the entity-one into one simple-method call: input organizationPartyId, glAccountTypeId and productCategoryId; output productCategoryGlAccount --> - <entity-one entity-name="ProductCategoryGlAccount" value-name="productCategoryGlAccount"> - <field-map field-name="productCategoryId" env-name="productCategoryMember.productCategoryId"/> - <field-map field-name="glAccountTypeId" env-name="parameters.glAccountTypeId"/> - <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> - </entity-one> + <call-simple-method method-name="getProductCategoryGlAccountInline"/> <if-not-empty field-name="productCategoryGlAccount.glAccountId"> <field-to-result field-name="productCategoryGlAccount.glAccountId" result-name="glAccountId"/> <return/> @@ -552,17 +559,13 @@ <if-not-empty field-name="parameters.productId"> <if-compare field-name="parameters.acctgTransTypeId" operator="equals" value="PURCHASE_INVOICE"> - <!-- TODO ***: refactor the entity-one into one simple-method call: input organizationPartyId and glAccountTypeId; output glAccountTypeDefault --> - <entity-one entity-name="GlAccountTypeDefault" value-name="glAccountTypeDefault" use-cache="true"> - <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> - <field-map field-name="glAccountTypeId" value="UNINVOICED_SHIP_RCPT"/> - </entity-one> + <set field="parameters.glAccountTypeId" value="UNINVOICED_SHIP_RCPT"/> + <call-simple-method method-name="getGlAccountTypeDefaultInline"/> + <set field="glAccountTypeDefault" from-field="lookedUpValue"/> <else> - <!-- TODO: refactor the entity-one into one simple-method call: use the same method of the previous TODO comment (***) --> - <entity-one entity-name="GlAccountTypeDefault" value-name="glAccountTypeDefault" use-cache="true"> - <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> - <field-map field-name="glAccountTypeId" value="SALES_ACCOUNT"/> - </entity-one> + <set field="parameters.glAccountTypeId" value="SALES_ACCOUNT"/> + <call-simple-method method-name="getGlAccountTypeDefaultInline"/> + <set field="glAccountTypeDefault" from-field="lookedUpValue"/> </else> </if-compare> <if-not-empty field-name="glAccountTypeDefault.glAccountId"> @@ -570,11 +573,7 @@ <return/> </if-not-empty> </if-not-empty> - <!-- TODO: refactor the entity-one into one simple-method call: input organizationPartyId and invoiceItemTypeId; output invoiceItemTypeGlAccount --> - <entity-one entity-name="InvoiceItemTypeGlAccount" value-name="invoiceItemTypeGlAccount"> - <field-map field-name="invoiceItemTypeId" env-name="parameters.glAccountTypeId"/> - <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> - </entity-one> + <call-simple-method method-name="getInvoiceItemTypeGlAccountInline"/> <if-not-empty field-name="invoiceItemTypeGlAccount.glAccountId"> <field-to-result field-name="invoiceItemTypeGlAccount.glAccountId" result-name="glAccountId"/> <return/> @@ -591,8 +590,7 @@ </if> <!-- if nothing found or if no such parameters were passed (lookedUpValue empty in both cases), try GlAccountTypeDefault --> <if-empty field-name="lookedUpValue.glAccountId"> - <!-- TODO: refactor the entity-one into one simple-method call: use the same method of the previous TODO comment (***) --> - <entity-one entity-name="GlAccountTypeDefault" value-name="lookedUpValue" use-cache="true"/> + <call-simple-method method-name="getGlAccountTypeDefaultInline"/> </if-empty> <field-to-result field-name="lookedUpValue.glAccountId" result-name="glAccountId"/> </simple-method> @@ -723,9 +721,10 @@ <calcop field-name="totalAmount" operator="add"><calcop field-name="amount" operator="get"/></calcop> </calculate> </iterate> - <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference" use-cache="true" auto-field-map="false"> - <field-map field-name="partyId" env-name="customTimePeriod.organizationPartyId"/> - </entity-one> + <set field="partyAccountingPreferencesCallMap.organizationPartyId" from-field="customTimePeriod.organizationPartyId"/> + <call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap"> + <result-to-field result-name="partyAccountingPreference" field-name="partyAcctgPreference"/> + </call-service> <!-- get the profit and loss gl account id --> <entity-one entity-name="GlAccountTypeDefault" value-name="profitLossAccount" use-cache="true"> <field-map field-name="organizationPartyId" env-name="customTimePeriod.organizationPartyId"/> @@ -2295,5 +2294,62 @@ <simple-method method-name="deletePartyGlAccount" short-description="Delete an existing General Ledger Account of a Party"> <entity-one entity-name="PartyGlAccount" value-name="lookedUpValue"/> <remove-value value-name="lookedUpValue"/> + </simple-method> + + <!-- Entity Specific Inline Methods --> + <simple-method method-name="getVarianceReasonGlAccountInline" short-description="Gets VarianceReasonGlAccount on the basis of primary key"> + <entity-one entity-name="VarianceReasonGlAccount" value-name="varianceReasonGlAccount"> + <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> + <field-map field-name="varianceReasonId" env-name="parameters.glAccountTypeId"/> + </entity-one> + </simple-method> + + <simple-method method-name="getPartyGlAccountInline" short-description="Gets PartyGlAccount on the basis of primary key" > + <entity-one entity-name="PartyGlAccount" value-name="partyGlAccount"> + <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> + <field-map field-name="partyId" env-name="parameters.partyId"/> + <field-map field-name="roleTypeId" env-name="roleTypeId"/> + <field-map field-name="glAccountTypeId" env-name="parameters.glAccountTypeId"/> + </entity-one> + </simple-method> + + <simple-method method-name="getCreditCardTypeGlAccountInline" short-description="Gets CreditCardTypeGlAccount on the basis of primary key" > + <entity-one entity-name="CreditCardTypeGlAccount" value-name="creditCardTypeGlAccount"> + <field-map field-name="cardType" env-name="creditCard.cardType"/> + <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> + </entity-one> + </simple-method> + + <simple-method method-name="getPaymentMethodTypeGlAccountInline" short-description="Gets PaymentMethodTypeGlAccount on the basis of primary key" > + <entity-one entity-name="PaymentMethodTypeGlAccount" value-name="paymentMethodTypeGlAccount"> + <field-map field-name="paymentMethodTypeId" env-name="payment.paymentMethodTypeId"/> + <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> + </entity-one> + </simple-method> + + <simple-method method-name="getProductGlAccountInline" short-description="Gets ProductGlAccount on the basis of primary key" > + <entity-one entity-name="ProductGlAccount" value-name="productGlAccount" use-cache="true"/> + </simple-method> + + <simple-method method-name="getProductCategoryGlAccountInline" short-description="Gets ProductCategoryGlAccount on the basis of primary key" > + <entity-one entity-name="ProductCategoryGlAccount" value-name="productCategoryGlAccount"> + <field-map field-name="productCategoryId" env-name="productCategoryMember.productCategoryId"/> + <field-map field-name="glAccountTypeId" env-name="parameters.glAccountTypeId"/> + <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> + </entity-one> + </simple-method> + + <simple-method method-name="getInvoiceItemTypeGlAccountInline" short-description="Gets InvoiceItemTypeGlAccount on the basis of primary key" > + <entity-one entity-name="InvoiceItemTypeGlAccount" value-name="invoiceItemTypeGlAccount"> + <field-map field-name="invoiceItemTypeId" env-name="parameters.glAccountTypeId"/> + <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> + </entity-one> + </simple-method> + + <simple-method method-name="getGlAccountTypeDefaultInline" short-description="Gets GlAccountTypeDefault on the basis of primary key" > + <entity-one entity-name="GlAccountTypeDefault" value-name="lookedUpValue" use-cache="true"> + <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> + <field-map field-name="glAccountTypeId" env-name="parameters.glAccountTypeId"/> + </entity-one> </simple-method> </simple-methods> Modified: ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml (original) +++ ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml Thu Apr 10 01:58:40 2008 @@ -181,6 +181,12 @@ </service> <!-- AcctgTrans & Related --> + <service name="completeAcctgTransEntries" default-entity-name="AcctgTrans" engine="simple" + location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="completeAcctgTransEntries" auth="true"> + <description>Completes, if possible, the AcctgTransEntries using the mappings defined in the gl setup</description> + <permission-service service-name="acctgTransactionPermissionCheck" main-action="UPDATE"/> + <auto-attributes include="pk" mode="IN" optional="false"/> + </service> <service name="interfaceAcctgTrans" default-entity-name="AcctgTrans" engine="interface" location="" invoke=""> <auto-attributes include="nonpk" mode="IN" optional="true"> <exclude field-name="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=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Thu Apr 10 01:58:40 2008 @@ -455,6 +455,12 @@ <security https="true" auth="true"/> <response name="success" type="view" value="ListUnpostedAcctgTrans"/> </request-map> + <request-map uri="completeAcctgTransEntries"> + <security https="true" auth="true"/> + <event type="service" invoke="completeAcctgTransEntries"/> + <response name="success" type="view" value="EditAcctgTrans"/> + <response name="error" type="view" value="EditAcctgTrans"/> + </request-map> <request-map uri="postAcctgTrans"> <security https="true" auth="true"/> <event type="service" invoke="postAcctgTrans"/> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml Thu Apr 10 01:58:40 2008 @@ -197,7 +197,8 @@ </field> <field position="1" name="organizationPartyId" parameter-name="partyIdFrom"> <drop-down allow-empty="false"> - <entity-options description="${partyId}" entity-name="PartyAcctgPreference" key-field-name="partyId"> + <entity-options description="${partyId}" entity-name="PartyRole" key-field-name="partyId"> + <entity-constraint name="roleTypeId" value="INTERNAL_ORGANIZATIO"/> <entity-order-by field-name="partyId"/> </entity-options> </drop-down> @@ -220,7 +221,8 @@ </field> <field position="1" name="organizationPartyId" parameter-name="partyId"> <drop-down allow-empty="false"> - <entity-options description="${partyId}" entity-name="PartyAcctgPreference" key-field-name="partyId"> + <entity-options description="${partyId}" entity-name="PartyRole" key-field-name="partyId"> + <entity-constraint name="roleTypeId" value="INTERNAL_ORGANIZATIO"/> <entity-order-by field-name="partyId"/> </entity-options> </drop-down> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml Thu Apr 10 01:58:40 2008 @@ -80,7 +80,8 @@ <field name="statusId"><hidden value="PMNT_NOT_PAID"/></field> <field position="1" name="organizationPartyId" parameter-name="partyIdFrom"> <drop-down allow-empty="false"> - <entity-options description="${partyId}" entity-name="PartyAcctgPreference" key-field-name="partyId"> + <entity-options description="${partyId}" entity-name="PartyRole" key-field-name="partyId"> + <entity-constraint name="roleTypeId" value="INTERNAL_ORGANIZATIO"/> <entity-order-by field-name="partyId"/> </entity-options> </drop-down> @@ -118,7 +119,8 @@ <field name="statusId"><hidden value="PMNT_NOT_PAID"/></field> <field position="1" name="organizationPartyId" parameter-name="partyIdTo"> <drop-down allow-empty="false"> - <entity-options description="${partyId}" entity-name="PartyAcctgPreference" key-field-name="partyId"> + <entity-options description="${partyId}" entity-name="PartyRole" key-field-name="partyId"> + <entity-constraint name="roleTypeId" value="INTERNAL_ORGANIZATIO"/> <entity-order-by field-name="partyId"/> </entity-options> </drop-down> @@ -451,7 +453,8 @@ <field name="invoiceTypeId"><hidden value="SALES_INVOICE"/></field> <field name="organizationPartyId" parameter-name="partyIdFrom"> <drop-down allow-empty="false"> - <entity-options description="${partyId}" entity-name="PartyAcctgPreference" key-field-name="partyId"> + <entity-options description="${partyId}" entity-name="PartyRole" key-field-name="partyId"> + <entity-constraint name="roleTypeId" value="INTERNAL_ORGANIZATIO"/> <entity-order-by field-name="partyId"/> </entity-options> </drop-down> @@ -467,7 +470,8 @@ <field name="invoiceTypeId"><hidden value="PURCHASE_INVOICE"/></field> <field name="organizationPartyId" parameter-name="partyId"> <drop-down allow-empty="false"> - <entity-options description="${partyId}" entity-name="PartyAcctgPreference" key-field-name="partyId"> + <entity-options description="${partyId}" entity-name="PartyRole" key-field-name="partyId"> + <entity-constraint name="roleTypeId" value="INTERNAL_ORGANIZATIO"/> <entity-order-by field-name="partyId"/> </entity-options> </drop-down> Modified: ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml (original) +++ ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml Thu Apr 10 01:58:40 2008 @@ -265,7 +265,8 @@ <field name="partyIdFrom"><lookup target-form-name="LookupPartyName"/></field> <field name="organizationPartyId" parameter-name="partyIdTo"> <drop-down allow-empty="false"> - <entity-options description="${partyId}" entity-name="PartyAcctgPreference" key-field-name="partyId"> + <entity-options description="${partyId}" entity-name="PartyRole" key-field-name="partyId"> + <entity-constraint name="roleTypeId" value="INTERNAL_ORGANIZATIO"/> <entity-order-by field-name="partyId"/> </entity-options> </drop-down> Modified: ofbiz/trunk/applications/accounting/widget/GlForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlForms.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/GlForms.xml (original) +++ ofbiz/trunk/applications/accounting/widget/GlForms.xml Thu Apr 10 01:58:40 2008 @@ -496,7 +496,7 @@ <field name="acctgTransEntryTypeId" ><hidden value="_NA_"/></field> <field name="description"><text size="30"/></field> <field name="glAccountId"> - <drop-down> + <drop-down allow-empty="true"> <entity-options entity-name="GlAccountOrganizationAndClass" key-field-name="glAccountId" description="${glAccountId} ${accountName}"> <entity-constraint name="organizationPartyId" operator="equals" env-name="parameters.organizationPartyId"/> <entity-order-by field-name="glAccountId"/> @@ -524,6 +524,13 @@ <field name="organizationPartyId"><hidden/></field> <field name="acctgTransId"><hidden/></field> <field name="acctgTransEntrySeqId"><display/></field> + <field name="glAccountTypeId"> + <drop-down allow-empty="true"> + <entity-options entity-name="GlAccountType" description="${description}"> + <entity-order-by field-name="glAccountTypeId"/> + </entity-options> + </drop-down> + </field> <field name="glAccountId"> <drop-down allow-empty="true"> <entity-options entity-name="GlAccountOrganizationAndClass" key-field-name="glAccountId" description="${glAccountId} ${accountName}"> @@ -532,13 +539,16 @@ </entity-options> </drop-down> </field> + <!-- <field name="acctgTransEntryTypeId" title="${uiLabelMap.AccountingTransactionEntryType}"> <drop-down allow-empty="true"> <entity-options entity-name="AcctgTransEntryType" description="${description}"> <entity-order-by field-name="acctgTransEntryTypeId"/> </entity-options> </drop-down> - </field> + </field> + <field name="settlementTermId"><display/></field> + --> <field name="description"><display/></field> <field name="voucherRef"><display/></field> <field name="partyId"> @@ -546,7 +556,7 @@ </field> <field name="productId"> <lookup target-form-name="LookupProduct" size="20" maxlength="20"/> - </field> + </field> <field name="reconcileStatusId"> <drop-down allow-empty="true"> <entity-options entity-name="StatusItem" key-field-name="statusId" description="${description}"> @@ -555,7 +565,6 @@ </entity-options> </drop-down> </field> - <field name="settlementTermId"><display/></field> <field name="isSummary"><display/></field> <field name="debitCreditFlag"> <drop-down current="selected"> @@ -563,9 +572,10 @@ <option description="Debit" key="D"/> </drop-down> </field> + <field name="origAmount"><display type="currency" currency="${origCurrencyUomId}"/></field> <field name="amount"><display type="currency" currency="${currencyUomId}"/></field> <field name="updateButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field> - <field name="removeButton" title="" widget-style="buttontext" use-when="isPosted==null"> + <field name="removeButton" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> <hyperlink description="${uiLabelMap.CommonRemove}" target="deleteAcctgTransEntry?acctgTransId=${acctgTransId}&acctgTransEntrySeqId=${acctgTransEntrySeqId}&organizationPartyId=${organizationPartyId}"/> </field> </form> @@ -574,14 +584,14 @@ <auto-fields-service service-name="createAcctgTrans"/> <field name="organizationPartyId"><hidden value="${organizationPartyId}"/></field> <field name="acctgTransTypeId"> - <drop-down allow-empty="true"> + <drop-down> <entity-options entity-name="AcctgTransType" description="${description}"> <entity-order-by field-name="description"/> </entity-options> </drop-down> </field> <field name="glFiscalTypeId"> - <drop-down allow-empty="true"> + <drop-down> <entity-options entity-name="GlFiscalType" description="${description}" key-field-name="glFiscalTypeId"> <entity-order-by field-name="description"/> </entity-options> Modified: ofbiz/trunk/applications/accounting/widget/GlScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlScreens.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/GlScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/GlScreens.xml Thu Apr 10 01:58:40 2008 @@ -278,6 +278,7 @@ </container> <container style="screenlet-body"> <container> + <link text="${uiLabelMap.AccountingCompleteTransaction}" style="buttontext" target="completeAcctgTransEntries?acctgTransId=${acctgTransId}&organizationPartyId=${organizationPartyId}"/> <link text="${uiLabelMap.AccountingVerifyTransaction}" style="buttontext" target="postAcctgTrans?acctgTransId=${acctgTransId}&organizationPartyId=${organizationPartyId}&verifyOnly=Y"/> <link text="${uiLabelMap.AccountingPostTransaction}" style="buttontext" target="postAcctgTrans?acctgTransId=${acctgTransId}&organizationPartyId=${organizationPartyId}"/> </container> Modified: ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml (original) +++ ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml Thu Apr 10 01:58:40 2008 @@ -62,15 +62,16 @@ <field name="submitButton" title="${uiLabelMap.AccountingCreateAssignment}"><submit button-type="button"/></field> </form> - <form name="PartyAcctgPreference" type="single" target="createPartyAcctgPreference" default-service-name="createPartyAcctgPreference" default-map-name="partyAcctgPreference" - header-row-style="header-row" default-table-style="basic-table"> + <form name="PartyAcctgPreference" type="single" target="createPartyAcctgPreference" default-service-name="createPartyAcctgPreference" default-map-name="agregatedPartyAcctgPreference" + header-row-style="header-row" default-table-style="basic-table"> <alt-target use-when="partyAcctgPreference!=null" target="updatePartyAcctgPreference"/> <auto-fields-service service-name="createPartyAcctgPreference"/> <field name="organizationPartyId"><hidden value="${parameters.organizationPartyId}"/></field> <!-- the partyId is always displayed --> <field name="partyId" title="${uiLabelMap.AccountingOrganizationPartyId}"><display/></field> <!-- if there is no partyAcctgPreference yet, then we show drop-downs for the fields and a submit button --> - <field name="fiscalYearStartMonth" use-when="partyAcctgPreference==null"> + <field name="fiscalYearStartMonth" use-when="partyAcctgPreference==null" + tooltip="${uiLabelMap.${bsh: if(agregatedPartyAcctgPreference.get("fiscalYearStartMonth")!=null)return "AccountingInheritedValue"; else return "";}}"> <drop-down> <option key="1" description="${uiLabelMap.AccountingFiscalMonth01}"/> <option key="2" description="${uiLabelMap.AccountingFiscalMonth02}"/> @@ -86,7 +87,8 @@ <option key="12" description="${uiLabelMap.AccountingFiscalMonth12}"/> </drop-down> </field> - <field name="fiscalYearStartDay" use-when="partyAcctgPreference==null"> + <field name="fiscalYearStartDay" use-when="partyAcctgPreference==null" + tooltip="${uiLabelMap.${bsh: if(agregatedPartyAcctgPreference.get("fiscalYearStartDay")!=null) return "AccountingInheritedValue"; else return "";}}"> <drop-down> <option key="1"/><option key="2"/><option key="3"/><option key="4"/><option key="5"/> <option key="6"/><option key="7"/><option key="8"/><option key="9"/><option key="10"/> @@ -97,8 +99,8 @@ <option key="31"/> </drop-down> </field> - - <field name="taxFormId" use-when="partyAcctgPreference==null"> + <field name="taxFormId" use-when="partyAcctgPreference==null" + tooltip="${uiLabelMap.${bsh: if(agregatedPartyAcctgPreference.get("taxFormId")!=null) return "AccountingInheritedValue"; else return "";}}"> <drop-down> <entity-options entity-name="Enumeration" description="${description}" key-field-name="enumId"> <entity-constraint name="enumTypeId" operator="equals" value="TAX_FORMS"/> @@ -106,7 +108,8 @@ </entity-options> </drop-down> </field> - <field name="cogsMethodId" use-when="partyAcctgPreference==null"> + <field name="cogsMethodId" use-when="partyAcctgPreference==null" + tooltip="${uiLabelMap.${bsh: if(agregatedPartyAcctgPreference.get("cogsMethodId")!=null) return "AccountingInheritedValue"; else return "";}}"> <drop-down> <entity-options entity-name="Enumeration" description="${description}" key-field-name="enumId"> <entity-constraint name="enumTypeId" operator="equals" value="COGS_METHODS"/> @@ -114,16 +117,21 @@ </entity-options> </drop-down> </field> - <field name="baseCurrencyUomId" use-when="partyAcctgPreference==null"> - <drop-down no-current-selected-key="${defaultCurrencyUomId}"> + <field name="baseCurrencyUomId" use-when="partyAcctgPreference==null" + tooltip="${uiLabelMap.${bsh: if(agregatedPartyAcctgPreference.get("baseCurrencyUomId")!=null) return "AccountingInheritedValue"; else return "";}}"> + <drop-down> <entity-options key-field-name="uomId" description="${abbreviation} - ${description}" entity-name="Uom"> <entity-constraint name="uomTypeId" operator="equals" value="CURRENCY_MEASURE"/> <entity-order-by field-name="abbreviation"/> </entity-options> </drop-down> </field> - <field name="invoiceIdPrefix" use-when="partyAcctgPreference==null"><text maxlength="10" size="5"/></field> - <field name="invoiceSequenceEnumId" use-when="partyAcctgPreference==null"> + <field name="invoiceIdPrefix" use-when="partyAcctgPreference==null" + tooltip="${uiLabelMap.${bsh: if(agregatedPartyAcctgPreference.get("invoiceIdPrefix")!=null) return "AccountingInheritedValue"; else return "";}}"> + <text maxlength="10" size="5"/> + </field> + <field name="invoiceSequenceEnumId" use-when="partyAcctgPreference==null" + tooltip="${uiLabelMap.${bsh: if(agregatedPartyAcctgPreference.get("invoiceSequenceEnumId")!=null) return "AccountingInheritedValue"; else return "";}}"> <drop-down> <entity-options entity-name="Enumeration" description="${description}" key-field-name="enumId"> <entity-constraint name="enumTypeId" operator="equals" value="INVOICE_SEQMD"/> @@ -131,14 +139,18 @@ </entity-options> </drop-down> </field> - <field name="useInvoiceIdForReturns" use-when="partyAcctgPreference==null"> + <field name="useInvoiceIdForReturns" use-when="partyAcctgPreference==null" + tooltip="${uiLabelMap.${bsh: if(agregatedPartyAcctgPreference.get("useInvoiceIdForReturns")!=null) return "AccountingInheritedValue"; else return "";}}"> <drop-down allow-empty="true"> <option key="Y" description="${uiLabelMap.CommonY}"/><option key="N" description="${uiLabelMap.CommonN}"/> </drop-down> </field> - - <field name="quoteIdPrefix" use-when="partyAcctgPreference==null"><text maxlength="10" size="5"/></field> - <field name="quoteSequenceEnumId" use-when="partyAcctgPreference==null"> + <field name="quoteIdPrefix" use-when="partyAcctgPreference==null" + tooltip="${uiLabelMap.${bsh: if(agregatedPartyAcctgPreference.get("quoteIdPrefix")!=null) return "AccountingInheritedValue"; else return "";}}"> + <text maxlength="10" size="5"/> + </field> + <field name="quoteSequenceEnumId" use-when="partyAcctgPreference==null" + tooltip="${uiLabelMap.${bsh: if(agregatedPartyAcctgPreference.get("quoteSequenceEnumId")!=null) return "AccountingInheritedValue"; else return "";}}"> <drop-down> <entity-options entity-name="Enumeration" description="${description}" key-field-name="enumId"> <entity-constraint name="enumTypeId" operator="equals" value="QUOTE_SEQMD"/> @@ -146,8 +158,12 @@ </entity-options> </drop-down> </field> - <field name="orderIdPrefix" use-when="partyAcctgPreference==null"><text maxlength="10" size="5"/></field> - <field name="orderSequenceEnumId" use-when="partyAcctgPreference==null"> + <field name="orderIdPrefix" use-when="partyAcctgPreference==null" + tooltip="${uiLabelMap.${bsh: if(agregatedPartyAcctgPreference.get("orderIdPrefix")!=null) return "AccountingInheritedValue"; else return "";}}"> + <text maxlength="10" size="5"/> + </field> + <field name="orderSequenceEnumId" use-when="partyAcctgPreference==null" + tooltip="${uiLabelMap.${bsh: if(agregatedPartyAcctgPreference.get("orderSequenceEnumId")!=null) return "AccountingInheritedValue"; else return "";}}"> <drop-down> <entity-options entity-name="Enumeration" description="${description}" key-field-name="enumId"> <entity-constraint name="enumTypeId" operator="equals" value="ORDER_SEQMD"/> @@ -159,41 +175,124 @@ <field name="updateButton" use-when="partyAcctgPreference!=null" title="${uiLabelMap.CommonUpdate}"><submit/></field> <!-- otherwise, we just display the fields. there is no submit button because we shouldn't try to create it again and don't support an update option right now--> - <field name="fiscalYearStartMonth" use-when="partyAcctgPreference!=null"><display/></field> - <field name="fiscalYearStartDay" use-when="partyAcctgPreference!=null"><display/></field> - <field name="taxFormId" use-when="partyAcctgPreference!=null"><display-entity entity-name="Enumeration" key-field-name="enumId"/></field> - <field name="cogsMethodId" use-when="partyAcctgPreference!=null"><display-entity entity-name="Enumeration" key-field-name="enumId"/></field> - <field name="baseCurrencyUomId" use-when="partyAcctgPreference!=null"><display/></field> - <field name="invoiceIdPrefix" use-when="partyAcctgPreference!=null"><display/></field> - <field name="invoiceSequenceEnumId" use-when="partyAcctgPreference!=null"><display-entity entity-name="Enumeration" key-field-name="enumId"/></field> - <field name="useInvoiceIdForReturns" use-when="partyAcctgPreference!=null"><display/></field> - - <field name="quoteSequenceEnumId" use-when="partyAcctgPreference!=null"><display-entity entity-name="Enumeration" key-field-name="enumId"/></field> - <field name="quoteIdPrefix" use-when="partyAcctgPreference!=null"><display/></field> - <field name="lastQuoteNumber" use-when="partyAcctgPreference!=null"><display/></field> - <field name="orderSequenceEnumId" use-when="partyAcctgPreference!=null"><display-entity entity-name="Enumeration" key-field-name="enumId"/></field> - <field name="orderIdPrefix" use-when="partyAcctgPreference!=null"><display/></field> - <field name="lastOrderNumber" use-when="partyAcctgPreference!=null"><display/></field> - <!-- - <field name="quoteSequenceEnumId" type="id-ne"/> - <field name="quoteIdPrefix" type="very-short"/> - <field name="lastQuoteNumber" type="numeric"/> - <field name="orderSequenceEnumId" type="id-ne"/> - <field name="orderIdPrefix" type="very-short"/> - <field name="lastOrderNumber" type="numeric"/> ---> + <field name="fiscalYearStartMonth" use-when="partyAcctgPreference!=null" tooltip="${bsh: + if(partyAcctgPreference.get("fiscalYearStartMonth")==null&&agregatedPartyAcctgPreference.get("fiscalYearStartMonth")!=null) + return "AccountingInheritedValue"; + else return "";}"> + <display/> + </field> + <field name="fiscalYearStartDay" use-when="partyAcctgPreference!=null" tooltip="${uiLabelMap.${bsh: + if(partyAcctgPreference.get("fiscalYearStartDay")==null&&agregatedPartyAcctgPreference.get("fiscalYearStartDay")!=null) + return "AccountingInheritedValue"; + else return "";}}"> + <display/> + </field> + <field name="taxFormId" use-when="partyAcctgPreference!=null" tooltip="${uiLabelMap.${bsh: + if(partyAcctgPreference.get("taxFormId")==null&&agregatedPartyAcctgPreference.get("taxFormId")!=null) + return "AccountingInheritedValue"; + else return "";}}"> + <display-entity entity-name="Enumeration" key-field-name="enumId"/> + </field> + <field name="cogsMethodId" use-when="partyAcctgPreference!=null" tooltip="${uiLabelMap.${bsh: + if(partyAcctgPreference.get("cogsMethodId")==null&&agregatedPartyAcctgPreference.get("cogsMethodId")!=null) + return "AccountingInheritedValue"; + else return "";}}"> + <display-entity entity-name="Enumeration" key-field-name="enumId"/> + </field> + <field name="baseCurrencyUomId" use-when="partyAcctgPreference!=null" tooltip="${uiLabelMap.${bsh: + if(partyAcctgPreference.get("baseCurrencyUomId")==null&&agregatedPartyAcctgPreference.get("baseCurrencyUomId")!=null) + return "AccountingInheritedValue"; + else return "";}}"> + <display/> + </field> + <field name="invoiceIdPrefix" use-when="partyAcctgPreference!=null" tooltip="${uiLabelMap.${bsh: + if(partyAcctgPreference.get("invoiceIdPrefix")==null&&agregatedPartyAcctgPreference.get("invoiceIdPrefix")!=null) + return "AccountingInheritedValue"; + else return "";}}"> + <display/> + </field> + <field name="invoiceSequenceEnumId" use-when="partyAcctgPreference!=null" tooltip="${uiLabelMap.${bsh: + if(partyAcctgPreference.get("invoiceSequenceEnumId")==null&&agregatedPartyAcctgPreference.get("invoiceSequenceEnumId")!=null) + return "AccountingInheritedValue"; + else return "";}}"> + <display-entity entity-name="Enumeration" key-field-name="enumId"/> + </field> + <field name="useInvoiceIdForReturns" use-when="partyAcctgPreference!=null" tooltip="${uiLabelMap.${bsh: + if(partyAcctgPreference.get("useInvoiceIdForReturns")==null&&agregatedPartyAcctgPreference.get("useInvoiceIdForReturns")!=null) + return "AccountingInheritedValue"; + else return "";}}"> + <display/> + </field> + <field name="quoteSequenceEnumId" use-when="partyAcctgPreference!=null" tooltip="${uiLabelMap.${bsh: + if(partyAcctgPreference.get("quoteSequenceEnumId")==null&&agregatedPartyAcctgPreference.get("quoteSequenceEnumId")!=null) + return "AccountingInheritedValue"; + else return "";}}"> + <display-entity entity-name="Enumeration" key-field-name="enumId"/> + </field> + <field name="quoteIdPrefix" use-when="partyAcctgPreference!=null" tooltip="${uiLabelMap.${bsh: + if(partyAcctgPreference.get("quoteIdPrefix")==null&&agregatedPartyAcctgPreference.get("quoteIdPrefix")!=null) + return "AccountingInheritedValue"; + else return "";}}"> + <display/> + </field> + <field name="lastQuoteNumber" use-when="partyAcctgPreference!=null" tooltip="${uiLabelMap.${bsh: + if(partyAcctgPreference.get("lastQuoteNumber")==null&&agregatedPartyAcctgPreference.get("lastQuoteNumber")!=null) + return "AccountingInheritedValue"; + else return "";}}"> + <display/> + </field> + <field name="orderSequenceEnumId" use-when="partyAcctgPreference!=null" tooltip="${uiLabelMap.${bsh: + if(partyAcctgPreference.get("orderSequenceEnumId")==null&&agregatedPartyAcctgPreference.get("orderSequenceEnumId")!=null) + return "AccountingInheritedValue"; + else return "";}}"> + <display-entity entity-name="Enumeration" key-field-name="enumId"/> + </field> + <field name="orderIdPrefix" use-when="partyAcctgPreference!=null" tooltip="${uiLabelMap.${bsh: + if(partyAcctgPreference.get("orderIdPrefix")==null&&agregatedPartyAcctgPreference.get("orderIdPrefix")!=null) + return "AccountingInheritedValue"; + else return "";}}"> + <display/> + </field> + <field name="lastOrderNumber" use-when="partyAcctgPreference!=null" tooltip="${uiLabelMap.${bsh: + if(partyAcctgPreference.get("lastOrderNumber")==null&&agregatedPartyAcctgPreference.get("lastOrderNumber")!=null) + return "AccountingInheritedValue"; + else return "";}}"> + <display/> + </field> + <!-- these 2 are ONLY displayed, never allow manual editing --> - <field name="lastInvoiceNumber"><display/></field> - <field name="lastInvoiceRestartDate"><display/></field> + <field name="lastInvoiceNumber" tooltip="${uiLabelMap.${bsh: + if((partyAcctgPreference==null&&agregatedPartyAcctgPreference.get("lastInvoiceNumber")!=null) || + (partyAcctgPreference!=null&&partyAcctgPreference.get("lastInvoiceNumber")==null&&agregatedPartyAcctgPreference.get("lastInvoiceNumber")!=null)) + return "AccountingInheritedValue"; + else return "";}}"> + <display/> + </field> + <field name="lastInvoiceRestartDate" tooltip="${uiLabelMap.${bsh: + if((partyAcctgPreference==null&&agregatedPartyAcctgPreference.get("lastInvoiceRestartDate")!=null) || + (partyAcctgPreference!=null&&partyAcctgPreference.get("lastInvoiceRestartDate")==null&&agregatedPartyAcctgPreference.get("lastInvoiceRestartDate")!=null)) + return "AccountingInheritedValue"; + else return "";}}"> + <display/> + </field> - <field name="refundPaymentMethodId"> + <!-- these 2 are always can be updated --> + <field name="refundPaymentMethodId" tooltip="${uiLabelMap.${bsh: + if((partyAcctgPreference==null&&agregatedPartyAcctgPreference.get("refundPaymentMethodId")!=null) || + (partyAcctgPreference!=null&&partyAcctgPreference.get("refundPaymentMethodId")==null&&agregatedPartyAcctgPreference.get("refundPaymentMethodId")!=null)) + return "AccountingInheritedValue"; + else return "";}}"> <drop-down> <entity-options entity-name="PaymentMethod" description="${description}" key-field-name="paymentMethodId"> <entity-constraint name="partyId" operator="equals" env-name="organizationPartyId"/> </entity-options> </drop-down> </field> - <field name="errorGlJournalId"> + <field name="errorGlJournalId" tooltip="${uiLabelMap.${bsh: + if((partyAcctgPreference==null&&agregatedPartyAcctgPreference.get("errorGlJournalId")!=null) || + (partyAcctgPreference!=null&&partyAcctgPreference.get("errorGlJournalId")==null&&agregatedPartyAcctgPreference.get("errorGlJournalId")!=null)) + return "AccountingInheritedValue"; + else return "";}}"> <drop-down allow-empty="true"> <entity-options entity-name="GlJournal" key-field-name="glJournalId" description="${glJournalName} [${glJournalId}]"> <entity-constraint name="organizationPartyId" operator="equals" env-name="organizationPartyId"/> Modified: ofbiz/trunk/applications/accounting/widget/GlSetupScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlSetupScreens.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/GlSetupScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/GlSetupScreens.xml Thu Apr 10 01:58:40 2008 @@ -224,9 +224,13 @@ <set field="labelTitleProperty" value="${uiLabelMap.AccountingPreference}"/> <set field="tabButtonItem" value="PartyAcctgPreference"/> <set field="organizationPartyId" from-field="parameters.organizationPartyId"/> + <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD"/> <set field="partyId" from-field="parameters.organizationPartyId"/> - <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD" /> <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference"/> + <service service-name="getPartyAccountingPreferences" result-map-name="result"> + <field-map field-name="organizationPartyId"/> + </service> + <set field="agregatedPartyAcctgPreference" from-field="result.partyAccountingPreference"/> </actions> <widgets> <decorator-screen name="CommonAdminDecorator"> @@ -237,12 +241,8 @@ <label text="${uiLabelMap.AccountingPreference}"/> </container> </container> - <container style="screenlet-body"> - <section> - <widgets> - <include-form name="PartyAcctgPreference" location="component://accounting/widget/GlSetupForms.xml"/> - </widgets> - </section> + <container style="screenlet-body"> + <include-form name="PartyAcctgPreference" location="component://accounting/widget/GlSetupForms.xml"/> </container> </container> </decorator-section> Modified: ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml Thu Apr 10 01:58:40 2008 @@ -280,11 +280,11 @@ <set field="tabButtonItem" value="OrganizationAccountingReports"/> <set field="tabButtonItem2" value="TrialBalance"/> <set field="organizationPartyId" from-field="parameters.organizationPartyId"/> - <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference" auto-field-map="false"> - <field-map field-name="partyId" env-name="organizationPartyId"/> - </entity-one> + <service service-name="getPartyAccountingPreferences" result-map-name="result"> + <field-map field-name="organizationPartyId"/> + </service> + <set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/> <set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> - <entity-condition entity-name="GlAccountOrganization" list-name="trialBalances" filter-by-date="true"> <condition-list> <condition-expr field-name="organizationPartyId" operator="equals" env-name="organizationPartyId"/> @@ -324,9 +324,10 @@ <set field="tabButtonItem" value="OrganizationAccountingReports"/> <set field="tabButtonItem2" value="IncomeStatement"/> <set field="organizationPartyId" from-field="parameters.organizationPartyId"/> - <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference" auto-field-map="false"> - <field-map field-name="partyId" env-name="organizationPartyId"/> - </entity-one> + <service service-name="getPartyAccountingPreferences" result-map-name="result"> + <field-map field-name="organizationPartyId"/> + </service> + <set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/> <set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> <set field="glAccountTotalsList" from-field="parameters.glAccountTotalsList"/> </actions> @@ -376,9 +377,10 @@ <set field="tabButtonItem" value="OrganizationAccountingReports"/> <set field="tabButtonItem2" value="BalanceSheet"/> <set field="organizationPartyId" from-field="parameters.organizationPartyId"/> - <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference" auto-field-map="false"> - <field-map field-name="partyId" env-name="organizationPartyId"/> - </entity-one> + <service service-name="getPartyAccountingPreferences" result-map-name="result"> + <field-map field-name="organizationPartyId"/> + </service> + <set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/> <set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> <set field="assetBalancesList" from-field="parameters.assetBalancesList"/> <set field="liabilityBalancesList" from-field="parameters.liabilityBalancesList"/> @@ -451,9 +453,10 @@ <set field="tabButtonItem" value="OrganizationAccountingReports"/> <set field="tabButtonItem2" value="ComparativeBalanceSheet"/> <set field="organizationPartyId" from-field="parameters.organizationPartyId"/> - <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference" auto-field-map="false"> - <field-map field-name="partyId" env-name="organizationPartyId"/> - </entity-one> + <service service-name="getPartyAccountingPreferences" result-map-name="result"> + <field-map field-name="organizationPartyId"/> + </service> + <set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/> <set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> <set field="assetBalancesList" from-field="parameters.assetBalancesList"/> <set field="liabilityBalancesList" from-field="parameters.liabilityBalancesList"/> Modified: ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml (original) +++ ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml Thu Apr 10 01:58:40 2008 @@ -1576,6 +1576,9 @@ <value xml:lang="th">à¸à¸±à¸à¸«à¸²à¸à¸²à¸£à¸à¸±à¸à¹à¸à¹à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸£à¸²à¸¢à¸à¸²à¸£à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸£à¸à¸´à¸à¸à¹à¸à¸à¸µà¹à¸¡à¸¥</value> <value xml:lang="zh">åå¨è®¢åçµåé®ä»¶è系信æ¯æ¶åºç°é®é¢</value> </property> + <property key="OrderProblemsWithGetPartyAcctgPreferences"> + <value xml:lang="en"> Problems with getting PartyAcctgPreference. </value> + </property> <property key="OrderProblemsWithPaymentTypeLookup"> <value xml:lang="en"> Problems with PaymentType lookup. </value> <value xml:lang="es"> Problemas con la consulta del tipo de pago.</value> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml (original) +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml Thu Apr 10 01:58:40 2008 @@ -67,9 +67,10 @@ <set-nonpk-fields map-name="parameters" value-name="newEntity"/> <!-- If PartyAcctgPreference.useInvoiceIdForReturns is Y, get the ID from the getNextInvoiceId service --> - <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference" auto-field-map="false"> - <field-map field-name="partyId" env-name="parameters.toPartyId"/> - </entity-one> + <set field="partyAccountingPreferencesCallMap.organizationPartyId" from-field="parameters.toPartyId"/> + <call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap"> + <result-to-field result-name="partyAccountingPreference" field-name="partyAcctgPreference"/> + </call-service> <if-compare field-name="partyAcctgPreference.useInvoiceIdForReturns" operator="equals" value="Y"> <set field="getNextInvoiceIdMap.partyId" from-field="parameters.toPartyId"/> <call-service service-name="getNextInvoiceId" in-map-name="getNextInvoiceIdMap"> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Thu Apr 10 01:58:40 2008 @@ -920,11 +920,15 @@ Debug.logError("No payToPartyId found for orderId " + orderId, module); } else { GenericValue orgAcctgPref = null; + Map acctgPreferencesResult = null; try { - orgAcctgPref = delegator.findByPrimaryKeyCache("PartyAcctgPreference", UtilMisc.toMap("partyId", productStore.get("payToPartyId"))); - } catch( GenericEntityException e ) { - Debug.logError("Error retrieving PartyAcctgPreference for partyId " + productStore.get("payToPartyId"), module); + acctgPreferencesResult = dispatcher.runSync("getPartyAccountingPreferences", UtilMisc.toMap("organizationPartyId", productStore.get("payToPartyId"), "userLogin", userLogin)); + } catch (GenericServiceException e){ + Debug.logError(e, "Error retrieving PartyAcctgPreference for partyId " + productStore.get("payToPartyId"), module); + return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderProblemsWithGetPartyAcctgPreferences", locale)); } + orgAcctgPref = (GenericValue) acctgPreferencesResult.get("partyAccountingPreference"); + if (UtilValidate.isNotEmpty(orgAcctgPref)) { try { refundPaymentMethod = orgAcctgPref.getRelatedOne("PaymentMethod"); Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml Thu Apr 10 01:58:40 2008 @@ -174,9 +174,10 @@ <!-- if inventoryItem's currencyUomId is empty, get the currencyUomId from the party accounting preferences of the owner of the inventory item --> <if-empty field-name="inventoryItem.currencyUomId"> - <entity-one entity-name="PartyAcctgPreference" value-name="accPref"> - <field-map field-name="partyId" env-name="inventoryItem.ownerPartyId"/> - </entity-one> + <set field="partyAccountingPreferencesCallMap.organizationPartyId" from-field="inventoryItem.ownerPartyId"/> + <call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap"> + <result-to-field result-name="partyAccountingPreference" field-name="accPref"/> + </call-service> <set field="inventoryItem.currencyUomId" from-field="accPref.baseCurrencyUomId"/> <if-empty field-name="inventoryItem.currencyUomId"> <property-to-field resource="general" property="currency.uom.id.default" field-name="inventoryItem.currencyUomId"/> Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/receiveInventory.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/receiveInventory.bsh?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/receiveInventory.bsh (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/receiveInventory.bsh Thu Apr 10 01:58:40 2008 @@ -38,7 +38,12 @@ ownerAcctgPref = null; if (facility != null) { owner = facility.getRelatedOne("OwnerParty"); - if (owner != null) ownerAcctgPref = owner.getRelatedOne("PartyAcctgPreference"); + if (owner != null) { + result = dispatcher.runSync("getPartyAccountingPreferences", UtilMisc.toMap("organizationPartyId", owner.getString("partyId"), "userLogin", request.getAttribute("userLogin"))); + if (!ServiceUtil.isError(result) && result.get("partyAccountingPreference") != null) { + ownerAcctgPref = result.get("partyAccountingPreference"); + } + } } purchaseOrder = null; Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh?rev=646697&r1=646696&r2=646697&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh Thu Apr 10 01:58:40 2008 @@ -91,7 +91,10 @@ if (! UtilValidate.isEmpty(facility)) { owner = facility.getRelatedOne("OwnerParty"); if (! UtilValidate.isEmpty(owner)) { - ownerAcctgPref = owner.getRelatedOne("PartyAcctgPreference"); + result = dispatcher.runSync("getPartyAccountingPreferences", UtilMisc.toMap("organizationPartyId", owner.getString("partyId"), "userLogin", request.getAttribute("userLogin"))); + if (!ServiceUtil.isError(result) && result.get("partyAccountingPreference") != null) { + ownerAcctgPref = result.get("partyAccountingPreference"); + } } if (! UtilValidate.isEmpty(ownerAcctgPref)) { baseCurrencyUomId = ownerAcctgPref.get("baseCurrencyUomId"); |
Free forum by Nabble | Edit this page |