Author: jacopoc
Date: Wed Dec 12 02:08:05 2007 New Revision: 603530 URL: http://svn.apache.org/viewvc?rev=603530&view=rev Log: Misc bug fixes and improvements after a first cursory test of the new posting services. Now the secas that trigger them are enabled because, with the new seed data, they shoudn't cause any issue. Modified: ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml ofbiz/trunk/applications/accounting/ofbiz-component.xml ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml Modified: ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml?rev=603530&r1=603529&r2=603530&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml (original) +++ ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml Wed Dec 12 02:08:05 2007 @@ -141,6 +141,8 @@ <PaymentMethodType paymentMethodTypeId="EXT_PAYPAL" glAccountId="122000"/> <PaymentMethodType paymentMethodTypeId="EXT_WORLDPAY" glAccountId="122000"/> + <CostComponentCalc costComponentCalcId="EXAMPLE_COST" costGlAccountTypeId="OPERATING_EXPENSE"/> + <!-- General Ledger Setup for the "Company" organization for "Company" --> <!-- GL journal for suspended transactions (failed post) --> @@ -165,6 +167,8 @@ <GlAccountOrganization organizationPartyId="Company" glAccountId="122300" fromDate="2001-01-01 00:00:00.0"/> <GlAccountOrganization organizationPartyId="Company" glAccountId="122500" fromDate="2001-01-01 00:00:00.0"/> <GlAccountOrganization organizationPartyId="Company" glAccountId="140000" fromDate="2001-01-01 00:00:00.0"/> + <GlAccountOrganization organizationPartyId="Company" glAccountId="141000" fromDate="2001-01-01 00:00:00.0"/> + <GlAccountOrganization organizationPartyId="Company" glAccountId="142000" fromDate="2001-01-01 00:00:00.0"/> <GlAccountOrganization organizationPartyId="Company" glAccountId="210000" fromDate="2001-01-01 00:00:00.0"/> <GlAccountOrganization organizationPartyId="Company" glAccountId="213000" fromDate="2001-01-01 00:00:00.0"/> <GlAccountOrganization organizationPartyId="Company" glAccountId="213200" fromDate="2001-01-01 00:00:00.0"/> @@ -187,6 +191,7 @@ <GlAccountOrganization organizationPartyId="Company" glAccountId="514000" fromDate="2001-01-01 00:00:00.0"/> <GlAccountOrganization organizationPartyId="Company" glAccountId="515000" fromDate="2001-01-01 00:00:00.0"/> <GlAccountOrganization organizationPartyId="Company" glAccountId="516100" fromDate="2001-01-01 00:00:00.0"/> + <GlAccountOrganization organizationPartyId="Company" glAccountId="600000" fromDate="2001-01-01 00:00:00.0"/> <GlAccountOrganization organizationPartyId="Company" glAccountId="601300" fromDate="2001-01-01 00:00:00.0"/> <GlAccountOrganization organizationPartyId="Company" glAccountId="601400" fromDate="2001-01-01 00:00:00.0"/> <GlAccountOrganization organizationPartyId="Company" glAccountId="625000" fromDate="2001-01-01 00:00:00.0"/> @@ -200,6 +205,8 @@ <GlAccountTypeDefault organizationPartyId="Company" glAccountTypeId="INTRSTINC_RECEIVABLE" glAccountId="121800"/> <GlAccountTypeDefault organizationPartyId="Company" glAccountTypeId="INVENTORY_XFER_OUT" glAccountId="125000"/> <GlAccountTypeDefault organizationPartyId="Company" glAccountTypeId="INVENTORY_ACCOUNT" glAccountId="140000"/> + <GlAccountTypeDefault organizationPartyId="Company" glAccountTypeId="RAWMAT_INVENTORY" glAccountId="141000"/> + <GlAccountTypeDefault organizationPartyId="Company" glAccountTypeId="WIP_INVENTORY" glAccountId="142000"/> <GlAccountTypeDefault organizationPartyId="Company" glAccountTypeId="PREPAID_EXPENSES" glAccountId="150000"/> <GlAccountTypeDefault organizationPartyId="Company" glAccountTypeId="ACCOUNTS_PAYABLE" glAccountId="210000"/> <GlAccountTypeDefault organizationPartyId="Company" glAccountTypeId="CUSTOMER_CREDIT" glAccountId="213000"/> @@ -210,6 +217,7 @@ <GlAccountTypeDefault organizationPartyId="Company" glAccountTypeId="SALES_ACCOUNT" glAccountId="400000"/> <GlAccountTypeDefault organizationPartyId="Company" glAccountTypeId="COGS_ACCOUNT" glAccountId="500000"/> <GlAccountTypeDefault organizationPartyId="Company" glAccountTypeId="INV_ADJ_VAL" glAccountId="515000"/> + <GlAccountTypeDefault organizationPartyId="Company" glAccountTypeId="OPERATING_EXPENSE" glAccountId="600000"/> <GlAccountTypeDefault organizationPartyId="Company" glAccountTypeId="TAX_ACCOUNT" glAccountId="900000"/> <!-- mappings for payments --> Modified: ofbiz/trunk/applications/accounting/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/ofbiz-component.xml?rev=603530&r1=603529&r2=603530&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/ofbiz-component.xml (original) +++ ofbiz/trunk/applications/accounting/ofbiz-component.xml Wed Dec 12 02:08:05 2007 @@ -68,7 +68,7 @@ <service-resource type="group" loader="main" location="servicedef/groups.xml"/> <service-resource type="eca" loader="main" location="servicedef/secas.xml"/> <service-resource type="eca" loader="main" location="servicedef/secas_payment.xml"/> - <!--<service-resource type="eca" loader="main" location="servicedef/secas_ledger.xml"/>--> + <service-resource type="eca" loader="main" location="servicedef/secas_ledger.xml"/> <test-suite loader="main" location="testdef/accountingtests.xml"/> 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=603530&r1=603529&r2=603530&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 Wed Dec 12 02:08:05 2007 @@ -281,51 +281,62 @@ <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> - <!-- if the amount field is empty, then determine it from the origAmount and origCurrencyUomId fields: - if origCurrencyUomId is different from the base currency of the organization, then the amount value will be converted --> - <if-empty field-name="acctgTransEntry.amount"> - <if-not-empty field-name="acctgTransEntry.origAmount"> - <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> - <if-empty field-name="acctgTransEntry.origCurrencyUomId"> - <set field="acctgTransEntry.origCurrencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> - </if-empty> - <set field="acctgTransEntry.currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> - <if-compare-field field-name="acctgTransEntry.origCurrencyUomId" operator="not-equals" to-field-name="acctgTransEntry.currencyUomId"> - <clear-field field-name="convertUomInMap"/> - <set field="convertUomInMap.originalValue" from-field="acctgTransEntry.origAmount"/> - <set field="convertUomInMap.uomId" from-field="acctgTransEntry.origCurrencyUomId"/> - <set field="convertUomInMap.uomIdTo" from-field="acctgTransEntry.currencyUomId"/> - <!-- TODO: set the optional asOfDate input parameter --> - <call-service service-name="convertUom" in-map-name="convertUomInMap"> - <result-to-field result-name="convertedValue" field-name="acctgTransEntry.amount"/> - </call-service> - <else> - <set field="acctgTransEntry.amount" from-field="acctgTransEntry.origAmount"/> - </else> - </if-compare-field> - </if-not-empty> - </if-empty> - <!-- 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="parameters.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.invoiceId" from-field="parameters.invoiceId"/> - <set field="getGlAccountFromAccountTypeInMap.paymentId" from-field="parameters.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"/> + <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> + <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> + <!-- if the amount field is empty, then determine it from the origAmount and origCurrencyUomId fields: + if origCurrencyUomId is different from the base currency of the organization, then the amount value will be converted --> + <if-empty field-name="acctgTransEntry.amount"> + <if-not-empty field-name="acctgTransEntry.origAmount"> + <if-empty field-name="acctgTransEntry.origCurrencyUomId"> + <set field="acctgTransEntry.origCurrencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> + </if-empty> + <set field="acctgTransEntry.currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> + <if-compare-field field-name="acctgTransEntry.origCurrencyUomId" operator="not-equals" to-field-name="acctgTransEntry.currencyUomId"> + <clear-field field-name="convertUomInMap"/> + <set field="convertUomInMap.originalValue" from-field="acctgTransEntry.origAmount"/> + <set field="convertUomInMap.uomId" from-field="acctgTransEntry.origCurrencyUomId"/> + <set field="convertUomInMap.uomIdTo" from-field="acctgTransEntry.currencyUomId"/> + <!-- TODO: set the optional asOfDate input parameter --> + <call-service service-name="convertUom" in-map-name="convertUomInMap"> + <result-to-field result-name="convertedValue" field-name="acctgTransEntry.amount"/> + </call-service> + <else> + <set field="acctgTransEntry.amount" from-field="acctgTransEntry.origAmount"/> + </else> + </if-compare-field> + </if-not-empty> + </if-empty> + <!-- 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="parameters.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.invoiceId" from-field="parameters.invoiceId"/> + <set field="getGlAccountFromAccountTypeInMap.paymentId" from-field="parameters.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> + <set field="normalizedAcctgTransEntries[]" from-field="acctgTransEntry"/> + </else> </if-empty> - <set field="normalizedAcctgTransEntries[]" from-field="acctgTransEntry"/> </else> </if-empty> </iterate> @@ -470,7 +481,7 @@ </and> </or> <not><if-empty field-name="parameters.invoiceId"/></not> - <not><if-empty field-name="parameters.acctgTransTypeId"/></not> + <not><if-empty field-name="parameters.glAccountTypeId"/></not> </and> </condition> <then> @@ -485,7 +496,7 @@ </if-not-empty> </if-not-empty> <entity-one entity-name="InvoiceItemTypeGlAccount" value-name="invoiceItemTypeGlAccount"> - <field-map field-name="invoiceItemTypeId" env-name="parameters.acctgTransTypeId"/> + <field-map field-name="invoiceItemTypeId" env-name="parameters.glAccountTypeId"/> <field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/> </entity-one> <if-not-empty field-name="invoiceItemTypeGlAccount.glAccountId"> @@ -493,7 +504,7 @@ <return/> </if-not-empty> <entity-one entity-name="InvoiceItemType" value-name="invoiceItemType"> - <field-map field-name="invoiceItemTypeId" env-name="parameters.acctgTransTypeId"/> + <field-map field-name="invoiceItemTypeId" env-name="parameters.glAccountTypeId"/> </entity-one> <if-not-empty field-name="invoiceItemType.defaultGlAccountId"> <field-to-result field-name="invoiceItemType.defaultGlAccountId" result-name="glAccountId"/> @@ -828,6 +839,7 @@ <set field="debitEntry.origCurrencyUomId" from-field="facility.currencyUomId"/> <set field="acctgTransEntries[]" from-field="debitEntry" type="Object"/> <!-- Set header fields (AcctgTrans) --> + <set field="createAcctgTransAndEntriesInMap.glFiscalTypeId" value="ACTUAL"/> <set field="createAcctgTransAndEntriesInMap.workEffortId" from-field="parameters.workEffortId"/> <set field="createAcctgTransAndEntriesInMap.acctgTransTypeId" value="MANUFACTURING"/> <set field="createAcctgTransAndEntriesInMap.acctgTransEntries" from-field="acctgTransEntries"/> Modified: ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml?rev=603530&r1=603529&r2=603530&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml (original) +++ ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml Wed Dec 12 02:08:05 2007 @@ -43,7 +43,7 @@ <action service="createAcctgTransForWorkEffortInventoryProduced" mode="sync"/> </eca> - <eca service="createWorkEffortInventoryProduced" event="commit"> + <eca service="createCostComponent" event="commit"> <condition field-name="workEffortId" operator="is-not-empty"/> <condition field-name="costComponentTypeId" operator="not-equals" value="ACTUAL_MAT_COST"/> <action service="createAcctgTransForWorkEffortCost" mode="sync"/> |
Free forum by Nabble | Edit this page |