Author: adrianc
Date: Tue Aug 12 10:00:35 2008
New Revision: 685226
URL:
http://svn.apache.org/viewvc?rev=685226&view=revLog:
Added the ability to turn off auto-creation of fixed assets when 'asset usage' type product is created.
Modified:
ofbiz/trunk/applications/accounting/config/AccountingConfig.properties
ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/RentalServices.xml
Modified: ofbiz/trunk/applications/accounting/config/AccountingConfig.properties
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingConfig.properties?rev=685226&r1=685225&r2=685226&view=diff==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingConfig.properties (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingConfig.properties Tue Aug 12 10:00:35 2008
@@ -27,3 +27,6 @@
#value YY: do not show the option box to the user and do only invoice processing
#value NN: do not show the option box to the user and do only invoiceitem processing
invoiceProcessing=YY
+
+# Automatically create a fixed asset when an 'asset usage' type product is created?
+accounting.fixedasset.autocreate=Y
Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/RentalServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/RentalServices.xml?rev=685226&r1=685225&r2=685226&view=diff==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/RentalServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/RentalServices.xml Tue Aug 12 10:00:35 2008
@@ -22,6 +22,10 @@
xsi:noNamespaceSchemaLocation="
http://ofbiz.apache.org/dtds/simple-methods.xsd">
<simple-method method-name="createFixedAssetAndLinkToProduct" short-description="Create an FixedAsset and link the asset to the product, used when a asset usage product is created">
+ <property-to-field field-name="autoCreate" resource="AccountingConfig" property="accounting.fixedasset.autocreate" no-locale="true"/>
+ <if-compare field="autoCreate" value="Y" operator="not-equals">
+ <return/>
+ </if-compare>
<check-permission permission="CATALOG" action="_UPDATE">
<fail-message message="Security Error: to run createFixedAssetAndLinkToProduct you must have the CATALOG_UPDATE or CATALOG_ADMIN permission"/>
</check-permission>
@@ -34,6 +38,7 @@
<if-not-empty field="parameters.internalName">
<set field="createFixedAsset.fixedAssetName" from-field="parameters.internalName"/>
</if-not-empty>
+ <set field="createFixedAsset.instanceOfProductId" from-field="parameters.productId"/>
<call-service service-name="createFixedAsset" in-map-name="createFixedAsset">
<result-to-field result-name="fixedAssetId" field-name="newLink.fixedAssetId"/>
</call-service>