<MvCOMMENT>
|
| Miva Merchant v4.x
|
| This file and the source codes contained herein are the property
| of Miva Corporation.  Use of this file is restricted to the specific
| terms and conditions in the License Agreement associated with this
| file.  Distribution of this file or portions of this file for uses
| not covered by the License Agreement is not allowed without a written
| agreement signed by an officer of Miva Corporation.
|
| Copyright 1998-2001 Miva Corporation.  All rights reserved.
| http://www.miva.com/
|
| Inventory Control - Admin Functions
| $Source: /home/cvs/merchant/Merchant/features/inv/inv_ad.mv,v $
|
| Prefix         : MER-INV-
| Next Error Code: 1    
| Next Text ID   : 94   
|
</MvCOMMENT>

<MvFUNCTION NAME = "INV_LeftNavigation" STANDARDOUTPUTLEVEL = "compresswhitespace">
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_view" VALUE = "{ CanI( 'INVT', 1, 0, 0, 0 ) }">

	<MvIF EXPR = "{ can_view }">
		<MvLOCALIZED NAME = "l.label" ID = "MER-INV-00000">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Inventory</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvCOMMENT> Inventory </MvCOMMENT>
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.navigation" VALUE = "{LeftNavigation_Dot( 2, 'Screen=INVT&Store_Code=' $ encodeattribute( Stores.d.code ), 'Main', l.label ) }">
	</MvIF>
</MvFUNCTION>

<MvFUNCTION NAME = "INV_Validate_InventorySettings" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = "1">
	<MvASSIGN NAME = "g.Store_Inventory_In_Message_Short" VALUE = "{ ltrim( rtrim( g.Store_Inventory_In_Message_Short ) ) }">
	<MvASSIGN NAME = "g.Store_Inventory_In_Message_Long" VALUE = "{ ltrim( rtrim( g.Store_Inventory_In_Message_Long ) ) }">
	<MvASSIGN NAME = "g.Store_Inventory_Low_Level" VALUE = "{ ltrim( rtrim( g.Store_Inventory_Low_Level ) ) }">
	<MvASSIGN NAME = "g.Store_Inventory_Low_Message_Short" VALUE = "{ ltrim( rtrim( g.Store_Inventory_Low_Message_Short ) ) }">
	<MvASSIGN NAME = "g.Store_Inventory_Low_Message_Long" VALUE = "{ ltrim( rtrim( g.Store_Inventory_Low_Message_Long ) ) }">
	<MvASSIGN NAME = "g.Store_Inventory_Out_Level" VALUE = "{ ltrim( rtrim( g.Store_Inventory_Out_Level ) ) }">
	<MvASSIGN NAME = "g.Store_Inventory_Out_Message_Short" VALUE = "{ ltrim( rtrim( g.Store_Inventory_Out_Message_Short ) ) }">
	<MvASSIGN NAME = "g.Store_Inventory_Out_Message_Long" VALUE = "{ ltrim( rtrim( g.Store_Inventory_Out_Message_Long ) ) }">
	<MvASSIGN NAME = "g.Store_Inventory_Limited_Message" VALUE = "{ ltrim( rtrim( g.Store_Inventory_Limited_Message ) ) }">

	<MvASSIGN NAME = "g.Store_Inventory_Email_From" VALUE = "{ ltrim( rtrim( g.Store_Inventory_Email_From ) ) }">
	<MvASSIGN NAME = "g.Store_Inventory_Email_To" VALUE = "{ ltrim( rtrim( g.Store_Inventory_Email_To ) ) }">
	<MvASSIGN NAME = "g.Store_Inventory_Email_CC" VALUE = "{ ltrim( rtrim( g.Store_Inventory_Email_CC ) ) }">
	<MvASSIGN NAME = "g.Store_Inventory_Email_Subject" VALUE = "{ ltrim( rtrim( g.Store_Inventory_Email_Subject ) ) }">
	<MvASSIGN NAME = "g.Store_Inventory_Email_Message" VALUE = "{ ltrim( rtrim( g.Store_Inventory_Email_Message ) ) }">

	<MvIF EXPR = "{ NOT len(g.Store_Inventory_In_Message_Short) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00001">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify an In Stock Message (Short)</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ FieldError( 'SETT', 'Store_Inventory_In_Message_Short', l.error ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>
	
	<MvIF EXPR = "{ NOT len(g.Store_Inventory_In_Message_Long) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00002">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify an In Stock Message (Long)</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ FieldError( 'SETT', 'Store_Inventory_In_Message_Long', l.error ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>
	
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ Validate_WholeNumber_Required( g.Store_Inventory_Low_Level ) }">
	<MvIF EXPR = "{ NOT l.valid }">
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ FieldError( 'SETT', 'Store_Inventory_Low_Level', g.Validation_Message ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>
	
	<MvIF EXPR = "{ NOT len(g.Store_Inventory_Low_Message_Short) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00004">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a Low Stock Message (Short)</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ FieldError( 'SETT', 'Store_Inventory_Low_Message_Short', l.error ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>
	
	<MvIF EXPR = "{ NOT len(g.Store_Inventory_Low_Message_Long) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00005">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a Low Stock Message (Long)</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ FieldError( 'SETT', 'Store_Inventory_Low_Message_Long', l.error ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>
	
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ Validate_WholeNumber_Required( g.Store_Inventory_Out_Level ) }">
	<MvIF EXPR = "{ NOT l.valid }">
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ FieldError( 'SETT', 'Store_Inventory_Out_Level', g.Validation_Message ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>
	
	<MvIF EXPR = "{ NOT len(g.Store_Inventory_Out_Message_Short) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00007">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a Out of Stock Message (Short)</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ FieldError( 'SETT', 'Store_Inventory_Out_Message_Short', l.error ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>
	
	<MvIF EXPR = "{ NOT len(g.Store_Inventory_Out_Message_Long) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00008">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a Out of Stock Message (Long)</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.ok" VALUE = "{ FieldError( 'SETT', 'Store_Inventory_Out_Message_Long', l.error ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>
	
	<MvIF EXPR = "{ NOT len(g.Store_Inventory_Limited_Message) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00009">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a Limited Stock Message</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.ok" VALUE = "{ FieldError( 'SETT', 'Store_Inventory_Limited_Message', l.error ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>

	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ Validate_Email( g.Store_Inventory_Email_From ) }">
	<MvIf EXPR = "{ NOT l.valid }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00010">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify an email address</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.ok" VALUE = "{ FieldError( 'EMAL', 'Store_Inventory_Email_From', l.error ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>

	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ Validate_Email( g.Store_Inventory_Email_To ) }">
	<MvIf EXPR = "{ NOT l.valid }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00011">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify an email address</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ FieldError( 'EMAL', 'Store_Inventory_Email_To', l.error ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>


	<MvIF EXPR = "{ len(g.Store_Inventory_Email_CC) }">
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ Validate_Email( g.Store_Inventory_Email_CC ) }">
		<MvIf EXPR = "{ NOT l.valid }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00012">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify an email address</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ FieldError( 'EMAL', 'Store_Inventory_Email_CC', l.error ) }">
			<MvFUNCTIONRETURN VALUE = 0>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ NOT len(g.Store_Inventory_Email_Subject) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00013">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a subject</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ FieldError( 'EMAL', 'Store_Inventory_Email_Subject', l.error ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>

	<MvIF EXPR = "{ NOT len(g.Store_Inventory_Email_Message) }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00014">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please specify a message</MvLOCALIZED-TEXT>
		</MvLOCALIZED>

		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ FieldError( 'EMAL', 'Store_Inventory_Email_Message', l.error ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ 1 }">
</MvFUNCTION>

<MvFUNCTION NAME = "INV_Action_UpdateInventorySettings" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = "{ INV_Validate_InventorySettings() }">
	
	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.ok" VALUE = "{ INV_InventorySettings_Update( g.Store_Inventory_Active, g.Store_Inventory_In_Message_Short, g.Store_Inventory_In_Message_Long, g.Store_Inventory_Track_Low, g.Store_Inventory_Low_Level, g.Store_Inventory_Low_Message_Short, g.Store_Inventory_Low_Message_Long, g.Store_Inventory_Track_Out, g.Store_Inventory_Out_Level, g.Store_Inventory_Hide_Out, g.Store_Inventory_Out_Message_Short, g.Store_Inventory_Out_Message_Long, g.Store_Inventory_Limited_Message, g.Store_Inventory_Email_On_Low, g.Store_Inventory_Email_On_Out, g.Store_Inventory_Email_From, g.Store_Inventory_Email_To, g.Store_Inventory_Email_CC, g.Store_Inventory_Email_Subject, g.Store_Inventory_Email_Message) }">
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvLOCALIZED NAME = "g.Message" ID = "MER-INV-00015">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Inventory updated</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ 1 }">
</MvFUNCTION>

<MvFUNCTION NAME = "INV_Validate_InventoryProductSettings" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = "1">
	
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ Validate_WholeNumber_Positive_Optional( g.Store_InventoryProduct_Increase ) }">
	<MvIF EXPR = "{ NOT l.valid }">
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.ok" VALUE = "{ FieldError( 'INVT', 'Store_InventoryProduct_Increase', g.Validation_Message ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>

	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ Validate_WholeNumber_Positive_Optional( g.Store_InventoryProduct_Decrease ) }">
	<MvIF EXPR = "{ NOT l.valid }">
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.ok" VALUE = "{ FieldError( 'INVT', 'Store_InventoryProduct_Decrease', g.Validation_Message ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>
	
	<MvIF EXPR = "{ ( g.Store_InventoryProduct_Increase NE 0 ) AND ( g.Store_InventoryProduct_Decrease NE 0 )}">
		<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00020">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">You may not both increase and decrease inventory at the same time</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.ok" VALUE = "{ FieldError( 'INVT', 'Store_InventoryProduct_Increase', l.error ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>
	
	
	<MvIF EXPR = "{ len( g.Store_InventoryProduct_Low_Level ) }">
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ Validate_WholeNumber_Optional( g.Store_InventoryProduct_Low_Level ) }">
		<MvIF EXPR = "{ NOT l.valid }">
			<MvDO FILE = "{ g.Module_Admin }" NAME = "l.ok" VALUE = "{ FieldError( 'INVT', 'Store_InventoryProduct_Low_Level', g.Validation_Message ) }">
			<MvFUNCTIONRETURN VALUE = 0>
		</MvIF>
	<MvELSE>
		<MvIF EXPR = "{ NOT g.Store_InventoryProduct_Low_Level_Default }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00022">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a number or check Default</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvDO FILE = "{ g.Module_Admin }" NAME = "l.ok" VALUE = "{ FieldError( 'INVT', 'Store_InventoryProduct_Low_Level', l.error ) }">
			<MvFUNCTIONRETURN VALUE = 0>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ len( g.Store_InventoryProduct_Out_Level ) }">
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ Validate_WholeNumber_Optional( g.Store_InventoryProduct_Out_Level ) }">
		<MvIF EXPR = "{ NOT l.valid }">
			<MvDO FILE = "{ g.Module_Admin }" NAME = "l.ok" VALUE = "{ FieldError( 'INVT', 'Store_InventoryProduct_Out_Level', g.Validation_Message ) }">
			<MvFUNCTIONRETURN VALUE = 0>
		</MvIF>
	<MvELSE>
		<MvIF EXPR = "{ NOT g.Store_InventoryProduct_Out_Level_Default }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-INV-00024">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter a number or check Default</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			<MvDO FILE = "{ g.Module_Admin }" NAME = "l.ok" VALUE = "{ FieldError( 'INVT', 'Store_InventoryProduct_Out_Level', l.error ) }">
			<MvFUNCTIONRETURN VALUE = 0>
		</MvIF>
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>


<MvFUNCTION NAME = "INV_Action_UpdateInventoryProductSettings" PARAMETERS = "prod_id" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = "1">
	<MvIF EXPR = "{ INV_Validate_InventoryProductSettings() }">
		<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.found" VALUE = "{ INV_InventoryProductSettings_Find_ProdID( l.prod_id ) }">
		<MvIF EXPR = "{ l.found }">
			<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.ok" VALUE = "{ INV_InventoryProductSettings_Update( l.prod_id, g.Store_InventoryProduct_Active, g.Store_InventoryProduct_In_Message_Short, g.Store_InventoryProduct_In_Message_Long, g.Store_InventoryProduct_Track_Low, g.Store_InventoryProduct_Low_Level_Default, g.Store_InventoryProduct_Low_Level, g.Store_InventoryProduct_Low_Message_Short, g.Store_InventoryProduct_Low_Message_Long, g.Store_InventoryProduct_Track_Out, g.Store_InventoryProduct_Out_Level_Default, g.Store_InventoryProduct_Out_Level, g.Store_InventoryProduct_Hide_Out, g.Store_InventoryProduct_Out_Message_Short, g.Store_InventoryProduct_Out_Message_Long, g.Store_InventoryProduct_Limited_Message) }">
		<MvELSE>
			<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.ok" VALUE = "{ INV_InventoryProductSettings_Insert( l.prod_id, g.Store_InventoryProduct_Active, g.Store_InventoryProduct_In_Message_Short, g.Store_InventoryProduct_In_Message_Long, g.Store_InventoryProduct_Track_Low, g.Store_InventoryProduct_Low_Level_Default, g.Store_InventoryProduct_Low_Level, g.Store_InventoryProduct_Low_Message_Short, g.Store_InventoryProduct_Low_Message_Long, g.Store_InventoryProduct_Track_Out, g.Store_InventoryProduct_Out_Level_Default, g.Store_InventoryProduct_Out_Level, g.Store_InventoryProduct_Hide_Out, g.Store_InventoryProduct_Out_Message_Short, g.Store_InventoryProduct_Out_Message_Long, g.Store_InventoryProduct_Limited_Message) }">
		</MvIF>
		<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.ok" VALUE = "{ INV_InventoryProductCounts_Adjust( l.prod_id, g.Store_InventoryProduct_Increase - g.Store_InventoryProduct_Decrease ) }"> 		
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "INV_Screen_Inventory" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_add" VALUE = "{ CanI( 'INVT', 0, 1, 0, 0 ) }">
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_modify" VALUE = "{ CanI( 'INVT', 0, 0, 1, 0 ) }">
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.can_delete" VALUE = "{ CanI( 'INVT', 0, 0, 0, 1 ) }">

	<MvIF EXPR = "{ g.Load_Fields }">
		<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.ok" VALUE = "{ INV_InventorySettings_Find() }">
		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "g.Store_Inventory_Active" VALUE = "{ InventorySettings.d.active }">
			<MvASSIGN NAME = "g.Store_Inventory_In_Message_Short" VALUE = "{ InventorySettings.d.in_short }">
			<MvASSIGN NAME = "g.Store_Inventory_In_Message_Long" VALUE = "{ InventorySettings.d.in_long }">
			<MvASSIGN NAME = "g.Store_Inventory_Track_Low" VALUE = "{ InventorySettings.d.low_track }">
			<MvASSIGN NAME = "g.Store_Inventory_Low_Level" VALUE = "{ InventorySettings.d.low_level }">
			<MvASSIGN NAME = "g.Store_Inventory_Low_Message_Short" VALUE = "{ InventorySettings.d.low_short }">
			<MvASSIGN NAME = "g.Store_Inventory_Low_Message_Long" VALUE = "{ InventorySettings.d.low_long }">
			<MvASSIGN NAME = "g.Store_Inventory_Track_Out" VALUE = "{ InventorySettings.d.out_track }">
			<MvASSIGN NAME = "g.Store_Inventory_Out_Level" VALUE = "{ InventorySettings.d.out_level }">
			<MvASSIGN NAME = "g.Store_Inventory_Hide_Out" VALUE = "{ InventorySettings.d.out_hide }">
			<MvASSIGN NAME = "g.Store_Inventory_Out_Message_Short" VALUE = "{ InventorySettings.d.out_short }">
			<MvASSIGN NAME = "g.Store_Inventory_Out_Message_Long" VALUE = "{ InventorySettings.d.out_long }">
			<MvASSIGN NAME = "g.Store_Inventory_Limited_Message" VALUE = "{ InventorySettings.d.ltd_long }">

			<MvASSIGN NAME = "g.Store_Inventory_Email_On_Low" VALUE = "{ InventorySettings.d.eml_low }">
			<MvASSIGN NAME = "g.Store_Inventory_Email_On_Out" VALUE = "{ InventorySettings.d.eml_out }">
			<MvASSIGN NAME = "g.Store_Inventory_Email_From" VALUE = "{ InventorySettings.d.eml_from }">
			<MvASSIGN NAME = "g.Store_Inventory_Email_To" VALUE = "{ InventorySettings.d.eml_to }">
			<MvASSIGN NAME = "g.Store_Inventory_Email_CC" VALUE = "{ InventorySettings.d.eml_cc }">
			<MvASSIGN NAME = "g.Store_Inventory_Email_Subject" VALUE = "{ InventorySettings.d.eml_sub }">
			<MvASSIGN NAME = "g.Store_Inventory_Email_Message" VALUE = "{ InventorySettings.d.eml_msg }">
		</MvIF>
	</MvIF>

	<MvLOCALIZED NAME = "l.title" ID = "MER-INV-00025">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Inventory</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.foo" VALUE = "{ BeginScreen( l.title, 'INVT', 'Help:invy.html' ) }">
	<INPUT TYPE = "hidden" NAME = "Have_List_Fields" VALUE = 1>

	<MvLOCALIZED NAME = "l.tab_list" ID = "MER-INV-00026">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">SETT:Inventory Settings,EMAL:Email Notification</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.foo" VALUE = "{ DrawTabs( 'SETT', l.tab_list ) }">

	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.foo" VALUE = "{ BeginContent() }">

	<MvHIDE FIELDS = "g.Edit_Inventory">
	
	<MvASSIGN NAME = "l.foo" VALUE = "{ INV_Screen_Inventory_Tab_Settings( l.can_add, l.can_modify, l.can_delete ) }">
	<MvASSIGN NAME = "l.foo" VALUE = "{ INV_Screen_Inventory_Tab_Email( l.can_add, l.can_modify, l.can_delete ) }">

	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.foo" VALUE = "{ EndContent() }">

	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.foo" VALUE = "{ DrawButtons( 'INVT:[UPDATE]:INVT:0:1:0' ) }">

	<MvDO FILE = "{ g.Module_Admin }" NAME = "l.foo" VALUE = "{ EndScreen() }">

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "INV_Screen_Inventory_Tab_Settings" PARAMETERS = "can_add, can_modify, can_delete" STANDARDOUTPUTLEVEL = "TEXT,HTML,COMPRESSWHITESPACE">
	<MvASSIGN NAME = "l.ok" VALUE = "1">

	<MvIF EXPR = "{ g.Tab EQ 'SETT' }">
		<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD VALIGN = "top" NOWRAP>
				&nbsp;
			</TD><TD WIDTH = "100%" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED NAME = "l.prompt" ID = "MER-INV-00027">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Track Inventory</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Store_Inventory_Active, 'Store_Inventory_Active', 'Yes', l.prompt ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00028">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">In Stock Message (Short):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "50" NAME ="Store_Inventory_In_Message_Short" VALUE = "{ encodeentities( g.Store_Inventory_In_Message_Short ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00029">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">In Stock Message (Long):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<TEXTAREA NAME = "Store_Inventory_In_Message_Long" ROWS = 10 COLS = 58 WRAP = "off"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Store_Inventory_In_Message_Long ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				&nbsp;
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.prompt" ID = "MER-INV-00030">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Track Low Stock Level</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Store_Inventory_Track_Low, 'Store_Inventory_Track_Low', 'Yes', l.prompt ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00031">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Low Stock Level:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B><BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "10" NAME ="Store_Inventory_Low_Level" VALUE = "{ encodeentities( g.Store_Inventory_Low_Level ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00032">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Low Stock Message (Short):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B><BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "50" NAME ="Store_Inventory_Low_Message_Short" VALUE = "{ encodeentities( g.Store_Inventory_Low_Message_Short ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00033">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Low Stock Message (Long):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B><BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<TEXTAREA NAME = "Store_Inventory_Low_Message_Long" ROWS = 10 COLS = 58 WRAP = "off"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Store_Inventory_Low_Message_Long ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				&nbsp;
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.prompt" ID = "MER-INV-00034">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Track Out of Stock Level</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Store_Inventory_Track_Out, 'Store_Inventory_Track_Out', 'Yes', l.prompt ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				&nbsp;
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.prompt" ID = "MER-INV-00035">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Hide Out of Stock Products</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Store_Inventory_Hide_Out, 'Store_Inventory_Hide_Out', 'Yes', l.prompt ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00036">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Out of Stock Level:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B><BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "10" NAME ="Store_Inventory_Out_Level" VALUE = "{ encodeentities( g.Store_Inventory_Out_Level ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00037">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Out of Stock Message (Short):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B><BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "50" NAME ="Store_Inventory_Out_Message_Short" VALUE = "{ encodeentities( g.Store_Inventory_Out_Message_Short ) }">
				</FONT>
			</TD></TR>
			
			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00038">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Out of Stock Message (Long):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B><BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<TEXTAREA NAME = "Store_Inventory_Out_Message_Long" ROWS = 10 COLS = 58 WRAP = "off"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Store_Inventory_Out_Message_Long ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00039">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Limited Stock Message:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B><BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<TEXTAREA NAME = "Store_Inventory_Limited_Message" ROWS = 10 COLS = 58 WRAP = "off"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Store_Inventory_Limited_Message ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
				</FONT>
			</TD></TR>
			<MvEVAL EXPR = "{ _INV_Display_Token_List() }">

		</TABLE>
	<MvELSE>
		<MvHIDE FIELDS = "g.Store_Inventory_Active, g.Store_Inventory_In_Message_Short, g.Store_Inventory_In_Message_Long, g.Store_Inventory_Track_Low, g.Store_Inventory_Low_Level, g.Store_Inventory_Low_Message_Short, g.Store_Inventory_Low_Message_Long, g.Store_Inventory_Track_Out, g.Store_Inventory_Hide_Out, g.Store_Inventory_Out_Level, g.Store_Inventory_Out_Message_Short, g.Store_Inventory_Out_Message_Long, g.Store_Inventory_Limited_Message">
	</MvIF>
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "INV_Screen_Inventory_Tab_Email" PARAMETERS = "can_add, can_modify, can_delete" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = "1">
	<MvIF EXPR = "{ g.Tab EQ 'EMAL' }">

		<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					&nbsp;
				</FONT>
			</TD><TD WIDTH = "100%" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED NAME = "l.prompt" ID = "MER-INV-00040">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Send Email When Stock is Low</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Store_Inventory_Email_On_Low, 'Store_Inventory_Email_On_Low', 'Yes', l.prompt ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					&nbsp;
				</FONT>
			</TD><TD WIDTH = "100%" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED NAME = "l.prompt" ID = "MER-INV-00041">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Send Email When Stock is Out</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Store_Inventory_Email_On_Out, 'Store_Inventory_Email_On_Out', 'Yes', l.prompt ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00042">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">From:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B><BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "50" NAME ="Store_Inventory_Email_From" VALUE = "{ encodeentities( g.Store_Inventory_Email_From ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00043">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">To:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B><BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "50" NAME ="Store_Inventory_Email_To" VALUE = "{ encodeentities( g.Store_Inventory_Email_To ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-INV-00044">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">CC:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "50" NAME ="Store_Inventory_Email_CC" VALUE = "{ encodeentities( g.Store_Inventory_Email_CC ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00045">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Subject:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B><BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "50" NAME ="Store_Inventory_Email_Subject" VALUE = "{ encodeentities( g.Store_Inventory_Email_Subject ) }">
				</FONT>
			</TD></TR>


			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00046">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Email Message:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B><BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<TEXTAREA NAME = "Store_Inventory_Email_Message" ROWS = 10 COLS = 58 WRAP = "off"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Store_Inventory_Email_Message ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
				</FONT>
			</TD></TR>
			<MvEVAL EXPR = "{ _INV_Display_Token_List() }">
		</TABLE>
	<MvELSE>
		<MvHIDE FIELDS = "g.Store_Inventory_Email_On_Low, g.Store_Inventory_Email_On_Out, g.Store_Inventory_Email_From, g.Store_Inventory_Email_To, g.Store_Inventory_Email_CC, g.Store_Inventory_Email_Subject, g.Store_Inventory_Email_Message">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "INV_ProductEditScreen_InventoryTabs" PARAMETERS = "" STANDARDOUTPUTLEVEL = "text,html,compresswhitespace">
	<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.can_view" VALUE = "{ CanI( g.Admin_User_Administrator, g.Admin_User_ID, 'INVT', 1, 0, 0, 0 ) }">
	<MvIF EXPR = "{ l.can_view }">
		<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.found" VALUE = "{ INV_InventorySettings_Find() }">
		<MvIF EXPR = "{ InventorySettings.d.active }">
			<MvFUNCTIONRETURN VALUE = "INVT:Inventory">
		<MvELSE>
			<MvFUNCTIONRETURN VALUE = "">
		</MvIF>
	</MvIF>
</MvFUNCTION>

<MvFUNCTION NAME = "INV_ProductEditScreen_LoadInventory" PARAMETERS = "prod_id" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = "1">
	
	<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.found" VALUE = "{ INV_InventoryProductSettings_Find_ProdID( l.prod_id ) }">
	<MvIF EXPR = "{ l.found }">
		<MvASSIGN NAME = "Store_InventoryProduct_Active" VALUE = "{ InventoryProductSettings.d.active }">
		<MvASSIGN NAME = "Store_InventoryProduct_Increase" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_Decrease" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_In_Message_Short" VALUE = "{ InventoryProductSettings.d.in_short }">
		<MvASSIGN NAME = "Store_InventoryProduct_In_Message_Long" VALUE = "{ InventoryProductSettings.d.in_long }">
		<MvASSIGN NAME = "Store_InventoryProduct_Track_Low" VALUE = "{ InventoryProductSettings.d.low_track }">
		<MvASSIGN NAME = "Store_InventoryProduct_Low_Level_Default" VALUE = "{ InventoryProductSettings.d.low_lvl_d }">
		<MvASSIGN NAME = "Store_InventoryProduct_Low_Level" VALUE = "{ InventoryProductSettings.d.low_level }">
		<MvASSIGN NAME = "Store_InventoryProduct_Low_Message_Short" VALUE = "{ InventoryProductSettings.d.low_short }">
		<MvASSIGN NAME = "Store_InventoryProduct_Low_Message_Long" VALUE = "{ InventoryProductSettings.d.low_long }">
		<MvASSIGN NAME = "Store_InventoryProduct_Track_Out" VALUE = "{ InventoryProductSettings.d.out_track }">
		<MvASSIGN NAME = "Store_InventoryProduct_Hide_Out" VALUE = "{ InventoryProductSettings.d.out_hide }">
		<MvASSIGN NAME = "Store_InventoryProduct_Out_Level" VALUE = "{ InventoryProductSettings.d.out_level }">
		<MvASSIGN NAME = "Store_InventoryProduct_Out_Level_Default" VALUE = "{ InventoryProductSettings.d.out_lvl_d }">
		<MvASSIGN NAME = "Store_InventoryProduct_Out_Message_Short" VALUE = "{ InventoryProductSettings.d.out_short }">
		<MvASSIGN NAME = "Store_InventoryProduct_Out_Message_Long" VALUE = "{ InventoryProductSettings.d.out_long }">
		<MvASSIGN NAME = "Store_InventoryProduct_Limited_Message" VALUE = "{ InventoryProductSettings.d.ltd_long }">
	<MvELSE>
		<MvASSIGN NAME = "Store_InventoryProduct_Active" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_Increase" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_Decrease" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_In_Message_Short" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_In_Message_Long" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_Track_Low" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_Low_Level" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_Low_Level_Default" VALUE = "Yes">
		<MvASSIGN NAME = "Store_InventoryProduct_Low_Message_Short" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_Low_Message_Long" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_Track_Out" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_Hide_Out" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_Out_Level" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_Out_Level_Default" VALUE = "Yes">
		<MvASSIGN NAME = "Store_InventoryProduct_Out_Message_Short" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_Out_Message_Long" VALUE = "">
		<MvASSIGN NAME = "Store_InventoryProduct_Limited_Message" VALUE = "">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "INV_Screen_Product_Tab_Inventory" PARAMETERS = "can_add, can_modify, can_delete" STANDARDOUTPUTLEVEL = "text,html,compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = "1">

	<MvIF EXPR = "{ g.Tab EQ 'INVT' }">
		<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					&nbsp;
				</FONT>
			</TD><TD WIDTH = "100%" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED NAME = "l.prompt" ID = "MER-INV-00047">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Track Product</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
					<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Store_InventoryProduct_Active, 'Store_InventoryProduct_Active', 'Yes', l.prompt ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-INV-00048">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Current Stock:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.count" VALUE = "{ INV_InventoryProductCount( Products.d.id ) }">
					<MvIF EXPR = "{ len( l.count ) EQ 0 }">
						<MvLOCALIZED ID = "MER-INV-00048"><I>
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">none</MvLOCALIZED-TEXT>
						</MvLOCALIZED></I>
					<MvELSE>
						<MvEVAL EXPR = "{ l.count }">
					</MvIF>
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-INV-00049">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Increase Stock By:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "10" NAME ="Store_InventoryProduct_Increase" VALUE = "{ encodeentities( g.Store_InventoryProduct_Increase ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-INV-00050">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Decrease Stock By:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "10" NAME ="Store_InventoryProduct_Decrease" VALUE = "{ encodeentities( g.Store_InventoryProduct_Decrease ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-INV-00051">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">In Stock Message (Short):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "50" NAME ="Store_InventoryProduct_In_Message_Short" VALUE = "{ encodeentities( g.Store_InventoryProduct_In_Message_Short ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-INV-00052">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">In Stock Message (Long):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<TEXTAREA NAME = "Store_InventoryProduct_In_Message_Long" ROWS = 10 COLS = 58 WRAP = "off"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Store_InventoryProduct_In_Message_Long ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00053">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Track Low Stock Level:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvASSIGN NAME = "l.foo" VALUE = "{ _INV_DrawYesNoDefault( g.Store_InventoryProduct_Track_Low, 'Store_InventoryProduct_Track_Low') }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00054">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Low Stock Level:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B><BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<INPUT TYPE = "text" SIZE = "10" NAME ="Store_InventoryProduct_Low_Level" VALUE = "{ encodeentities( g.Store_InventoryProduct_Low_Level ) }">
				<MvLOCALIZED ID = "MER-INV-00092">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">or</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvLOCALIZED NAME = "l.prompt" ID = "MER-INV-00055">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Use Default</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Store_InventoryProduct_Low_Level_Default, 'Store_InventoryProduct_Low_Level_Default', 'Yes', l.prompt ) }">
				</B></FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-INV-00056">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Low Stock Message (Short):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "50" NAME ="Store_InventoryProduct_Low_Message_Short" VALUE = "{ encodeentities( g.Store_InventoryProduct_Low_Message_Short ) }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-INV-00057">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Low Stock Message (Long):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<TEXTAREA NAME = "Store_InventoryProduct_Low_Message_Long" ROWS = 10 COLS = 58 WRAP = "off"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Store_InventoryProduct_Low_Message_Long ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00058">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Track Out of Stock Level:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvASSIGN NAME = "l.foo" VALUE = "{ _INV_DrawYesNoDefault( g.Store_InventoryProduct_Track_Out, 'Store_InventoryProduct_Track_Out') }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00059">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Hide Out of Stock Products:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvASSIGN NAME = "l.foo" VALUE = "{ _INV_DrawYesNoDefault( g.Store_InventoryProduct_Hide_Out, 'Store_InventoryProduct_Hide_Out') }">
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-INV-00060">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Out of Stock Level:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B><BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<INPUT TYPE = "text" SIZE = "10" NAME ="Store_InventoryProduct_Out_Level" VALUE = "{ encodeentities( g.Store_InventoryProduct_Out_Level ) }">
				<MvLOCALIZED ID = "MER-INV-00093">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">or</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvLOCALIZED NAME = "l.prompt" ID = "MER-INV-00061">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Use Default</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Store_InventoryProduct_Out_Level_Default, 'Store_InventoryProduct_Out_Level_Default', 'Yes', l.prompt ) }">
				</B></FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-INV-00062">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Out of Stock Message (Short):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<INPUT TYPE = "text" SIZE = "50" NAME ="Store_InventoryProduct_Out_Message_Short" VALUE = "{ encodeentities( g.Store_InventoryProduct_Out_Message_Short ) }">
				</FONT>
			</TD></TR>
			
			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-INV-00063">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Out of Stock Message (Long):</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<TEXTAREA NAME = "Store_InventoryProduct_Out_Message_Long" ROWS = 10 COLS = 58 WRAP = "off"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Store_InventoryProduct_Out_Message_Long ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
				</FONT>
			</TD></TR>

			<TR><TD VALIGN = "top" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-INV-00064">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Limited Stock Message:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				<BR></FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<TEXTAREA NAME = "Store_InventoryProduct_Limited_Message" ROWS = 10 COLS = 58 WRAP = "off"><MIVA STANDARDOUTPUTLEVEL = "text, html"><MvEVAL EXPR = "{ encodeentities( g.Store_InventoryProduct_Limited_Message ) }"><MIVA STANDARDOUTPUTLEVEL = "text, html, compresswhitespace"></TEXTAREA>
				</FONT>
			</TD></TR>
			<MvEVAL EXPR = "{ _INV_Display_Token_List() }">
		</TABLE>
	<MvELSE>
		<MvHIDE FIELDS = "g.Store_InventoryProduct_Active, g.Store_InventoryProduct_Increase, g.Store_InventoryProduct_Decrease, g.Store_InventoryProduct_In_Message_Short, g.Store_InventoryProduct_In_Message_Long, g.Store_InventoryProduct_Track_Low, g.Store_InventoryProduct_Low_Level, g.Store_InventoryProduct_Low_Level_Default, g.Store_InventoryProduct_Low_Message_Short, g.Store_InventoryProduct_Low_Message_Long, g.Store_InventoryProduct_Track_Out, g.Store_InventoryProduct_Hide_Out, g.Store_InventoryProduct_Out_Level, g.Store_InventoryProduct_Out_Level_Default, g.Store_InventoryProduct_Out_Message_Short, g.Store_InventoryProduct_Out_Message_Long, g.Store_InventoryProduct_Limited_Message">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "_INV_DrawYesNoDefault" PARAMETERS = "value, field_name" STANDARDOUTPUTLEVEL = "text,html,compresswhitespace">
	<MvLOCALIZED NAME = "l.default" ID = "MER-INV-00065">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Default</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvLOCALIZED NAME = "l.yes" ID = "MER-INV-00066">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Yes</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvLOCALIZED NAME = "l.no" ID = "MER-INV-00067">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">No</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	
	<SELECT NAME = "{ l.field_name }">
		<MvIF EXPR = "{ l.value EQ '' }">
			<OPTION VALUE = "" SELECTED><MvEVAL EXPR = "{l.default}"></OPTION>
		<MvELSE>
			<OPTION VALUE = ""><MvEVAL EXPR = "{l.default}"></OPTION>
		</MvIF>
		<MvIF EXPR = "{ l.value EQ 'y' }">
			<OPTION VALUE = "y" SELECTED><MvEVAL EXPR = "{l.yes}"></OPTION>
		<MvELSE>
			<OPTION VALUE = "y"><MvEVAL EXPR = "{l.yes}"></OPTION>
		</MvIF>
		<MvIF EXPR = "{ l.value EQ 'n' }">
			<OPTION VALUE = "n" SELECTED><MvEVAL EXPR = "{l.no}"></OPTION>
		<MvELSE>
			<OPTION VALUE = "n"><MvEVAL EXPR = "{l.no}"></OPTION>
		</MvIF>
	</SELECT>
</MvFUNCTION>

<MvFUNCTION NAME = "_INV_Display_Token_List" STANDARDOUTPUTLEVEL = "text,html,compresswhitespace">
	<TR><TD COLSPAN = 2>
		<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-INV-00068">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">Available Tokens:</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</FONT>
			</TD><TD NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-INV-00069">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US"><B>%%product_name%%</B></MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</FONT>
			</TD><TD WIDTH = "100%">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-INV-00070">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">The product's name</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</FONT>
			</TD></TR>

			<TR><TD>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					&nbsp;
				</FONT>
			</TD><TD>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-INV-00072">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US"><B>%%product_code%%</B></MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</FONT>
			</TD><TD>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-INV-00073">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">The product's code</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</FONT>
			</TD></TR>

			<TR><TD>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					&nbsp;
				</FONT>
			</TD><TD>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-INV-00075">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US"><B>%%inv_instock%%</B></MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</FONT>
			</TD><TD>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-INV-00076">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">The quantity in stock (current stock - low stock level)</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</FONT>
			</TD></TR>

			<TR><TD>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					&nbsp;
				</FONT>
			</TD><TD>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-INV-00078">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US"><B>%%inv_available%%</B></MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</FONT>
			</TD><TD>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-INV-00079">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">The quantity available to buy (current stock - out of stock level)</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</FONT>
			</TD></TR>

			<TR><TD>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					&nbsp;
				</FONT>
			</TD><TD>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-INV-00081">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US"><B>%%inv_level%%</B></MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</FONT>
			</TD><TD>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<MvLOCALIZED ID = "MER-INV-00082">
						<MvLOCALIZED-TEXT LANGUAGE = "en-US">The current stock level code: in, low, or out</MvLOCALIZED-TEXT>
					</MvLOCALIZED>
				</FONT>
			</TD></TR>
		</TABLE>
	</TD></TR>

</MvFUNCTION>


<MvFUNCTION NAME = "INV_Provision_Update_InventorySettings" PARAMETERS = "version, store_code, delimiter, data" STANDARDOUTPUTLEVEL = "">
	<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.ok" VALUE = "{ INV_InventorySettings_Find() }">

	<MvASSIGN NAME = "l.ok" VALUE = "1">
			
	<MvASSIGN NAME = "l.pos" VALUE = "1">

	<MvASSIGN NAME = "l.active" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.in_short" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.in_long" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.low_track" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.low_level" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.low_short" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.low_long" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.out_track" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.out_level" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.out_hide" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.out_short" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.out_long" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.ltd_long" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_low" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_out" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_from" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_to" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_cc" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_sub" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_msg			" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">

	<MvIF EXPR = "{ len( l.active ) }">
		<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "InventorySettings.d.active" VALUE = "{ PRV_Parse_Boolean( l.active ) }">
	</MvIF>
	<MvIF EXPR = "{ len( l.in_short ) }">
		<MvASSIGN NAME = "InventorySettings.d.in_short" VALUE = "{ l.in_short }">
	</MvIF>
	<MvIF EXPR = "{ len( l.in_long ) }">
		<MvASSIGN NAME = "InventorySettings.d.in_long" VALUE = "{ l.in_long }">
	</MvIF>
	<MvIF EXPR = "{ len( l.low_track ) }">
		<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "InventorySettings.d.low_track" VALUE = "{ PRV_Parse_Boolean( l.low_track ) }">
	</MvIF>
	<MvIF EXPR = "{ len( l.low_level ) }">
		<MvASSIGN NAME = "InventorySettings.d.low_level" VALUE = "{ l.low_level }">
	</MvIF>
	<MvIF EXPR = "{ len( l.low_short ) }">
		<MvASSIGN NAME = "InventorySettings.d.low_short" VALUE = "{ l.low_short }">
	</MvIF>
	<MvIF EXPR = "{ len( l.low_long ) }">
		<MvASSIGN NAME = "InventorySettings.d.low_long" VALUE = "{ l.low_long }">
	</MvIF>
	<MvIF EXPR = "{ len( l.out_track ) }">
		<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "InventorySettings.d.out_track" VALUE = "{ PRV_Parse_Boolean( l.out_track ) }">
	</MvIF>
	<MvIF EXPR = "{ len( l.out_level ) }">
		<MvASSIGN NAME = "InventorySettings.d.out_level" VALUE = "{ l.out_level }">
	</MvIF>
	<MvIF EXPR = "{ len( l.out_hide ) }">
		<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "InventorySettings.d.out_hide" VALUE = "{ PRV_Parse_Boolean( l.out_hide ) }">
	</MvIF>
	<MvIF EXPR = "{ len( l.out_short ) }">
		<MvASSIGN NAME = "InventorySettings.d.out_short" VALUE = "{ l.out_short }">
	</MvIF>
	<MvIF EXPR = "{ len( l.out_long ) }">
		<MvASSIGN NAME = "InventorySettings.d.out_long" VALUE = "{ l.out_long }">
	</MvIF>
	<MvIF EXPR = "{ len( l.ltd_long ) }">
		<MvASSIGN NAME = "InventorySettings.d.ltd_long" VALUE = "{ l.ltd_long }">
	</MvIF>
	<MvIF EXPR = "{ len( l.eml_low ) }">
		<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "InventorySettings.d.eml_low" VALUE = "{ PRV_Parse_Boolean( l.eml_low ) }">
	</MvIF>
	<MvIF EXPR = "{ len( l.eml_out ) }">
		<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "InventorySettings.d.eml_out" VALUE = "{ PRV_Parse_Boolean( l.eml_out ) }">
	</MvIF>
	<MvIF EXPR = "{ len( l.eml_from ) }">
		<MvASSIGN NAME = "InventorySettings.d.eml_from" VALUE = "{ l.eml_from }">
	</MvIF>
	<MvIF EXPR = "{ len( l.eml_to ) }">
		<MvASSIGN NAME = "InventorySettings.d.eml_to" VALUE = "{ l.eml_to }">
	</MvIF>
	<MvIF EXPR = "{ len( l.eml_cc ) }">
		<MvIF EXPR = "{ toupper( l.eml_cc ) EQ '#NONE#' }">
			<MvASSIGN NAME = "InventorySettings.d.eml_cc" VALUE = "">
		<MvELSE>
			<MvASSIGN NAME = "InventorySettings.d.eml_cc" VALUE = "{ l.eml_cc }">
		</MvIF>
	</MvIF>
	<MvIF EXPR = "{ len( l.eml_sub ) }">
		<MvASSIGN NAME = "InventorySettings.d.eml_sub" VALUE = "{ l.eml_sub }">
	</MvIF>
	<MvIF EXPR = "{ len( l.eml_msg ) }">
		<MvASSIGN NAME = "InventorySettings.d.eml_msg" VALUE = "{ l.eml_msg	}">
	</MvIF>

	<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.ok" VALUE = "{ INV_InventorySettings_Update( InventorySettings.d.active, InventorySettings.d.in_short, InventorySettings.d.in_long, InventorySettings.d.low_track, InventorySettings.d.low_level, InventorySettings.d.low_short, InventorySettings.d.low_long, InventorySettings.d.out_track, InventorySettings.d.out_level, InventorySettings.d.out_hide, InventorySettings.d.out_short, InventorySettings.d.out_long, InventorySettings.d.ltd_long, InventorySettings.d.eml_low, InventorySettings.d.eml_out, InventorySettings.d.eml_from, InventorySettings.d.eml_to, InventorySettings.d.eml_cc, InventorySettings.d.eml_sub, InventorySettings.d.eml_msg) }">

	<MvFUNCTIONRETURN VALUE = "l.ok">
</MvFUNCTION>

<MvFUNCTION NAME = "INV_Provision_Add_Update_InventoryProductSettings" PARAMETERS = "version, store_code, delimiter, data" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = "1">
			
	<MvASSIGN NAME = "l.pos" VALUE = "1">

	<MvASSIGN NAME = "l.product_code" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.stock" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.active" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.in_short" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.in_long" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.low_track" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.low_level" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.low_short" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.low_long" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.out_track" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.out_level" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.out_hide" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.out_short" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.out_long" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.ltd_long" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_low" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_out" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_from" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_to" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_cc" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_sub" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.eml_msg			" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	
	<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( l.product_code ) }">
	<MvIF EXPR = "{ NOT l.ok }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.found" VALUE = "{ INV_InventoryProductSettings_Find_ProdID( Products.d.id ) }">
	
	<MvIF EXPR = "{ l.found }">
		<MvIF EXPR = "{ len( l.active ) }">
			<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "InventoryProductSettings.d.active" VALUE = "{ PRV_Parse_Boolean( l.active ) }">
		</MvIF>

		<MvIF EXPR = "{ len( l.in_short ) }">
			<MvIF EXPR = "{ ( toupper( l.in_short ) EQ '#DEFAULT#' ) OR ( toupper( l.in_short ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "InventoryProductSettings.d.in_short" VALUE = "">
				<MvELSE>
				<MvASSIGN NAME = "InventoryProductSettings.d.in_short" VALUE = "{ l.in_short }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( l.in_long ) }">
			<MvIF EXPR = "{ ( toupper( l.in_long ) EQ '#DEFAULT#' ) OR ( toupper( l.in_long ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "InventoryProductSettings.d.in_long" VALUE = "">
			<MvELSE>
				<MvASSIGN NAME = "InventoryProductSettings.d.in_long" VALUE = "{ l.in_long }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( l.low_track ) }">
			<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "InventoryProductSettings.d.low_track" VALUE = "{ PRV_Parse_Tristate( l.low_track ) }">
		</MvIF>

		<MvIF EXPR = "{ len( l.low_level ) }">
			<MvIF EXPR = "{ ( toupper( l.low_level ) EQ '#DEFAULT#' ) }">
				<MvASSIGN NAME = "InventoryProductSettings.d.low_lvl_d" VALUE = "1">
				<MvASSIGN NAME = "InventoryProductSettings.d.low_level" VALUE = "0">
			<MvELSE>
				<MvASSIGN NAME = "InventoryProductSettings.d.low_level" VALUE = "{ l.low_level }">
				<MvASSIGN NAME = "InventoryProductSettings.d.low_lvl_d" VALUE = "0">
			</MvIF>
			<MvASSIGN NAME = "InventoryProductSettings.d.low_level" VALUE = "{ l.low_level }">
		</MvIF>

		<MvIF EXPR = "{ len( l.low_short ) }">
			<MvIF EXPR = "{ ( toupper( l.low_short ) EQ '#DEFAULT#' ) OR ( toupper( l.low_short ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "InventoryProductSettings.d.low_short" VALUE = "">
			<MvELSE>
				<MvASSIGN NAME = "InventoryProductSettings.d.low_short" VALUE = "{ l.low_short }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( l.low_long ) }">
			<MvIF EXPR = "{ ( toupper( l.low_long ) EQ '#DEFAULT#' ) OR ( toupper( l.low_long ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "InventoryProductSettings.d.low_long" VALUE = "">
			<MvELSE>
				<MvASSIGN NAME = "InventoryProductSettings.d.low_long" VALUE = "{ l.low_long }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( l.out_track ) }">
			<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "InventoryProductSettings.d.out_track" VALUE = "{ PRV_Parse_Tristate( l.out_track ) }">
		</MvIF>

		<MvIF EXPR = "{ len( l.out_level ) }">
			<MvIF EXPR = "{ ( toupper( l.out_level ) EQ '#DEFAULT#' ) }">
				<MvASSIGN NAME = "InventoryProductSettings.d.out_lvl_d" VALUE = "1">
				<MvASSIGN NAME = "InventoryProductSettings.d.out_level" VALUE = "0">
			<MvELSE>
				<MvASSIGN NAME = "InventoryProductSettings.d.out_level" VALUE = "{ l.out_level }">
				<MvASSIGN NAME = "InventoryProductSettings.d.out_lvl_d" VALUE = "0">
			</MvIF>

			<MvASSIGN NAME = "InventoryProductSettings.d.out_level" VALUE = "{ l.out_level }">
		</MvIF>

		<MvIF EXPR = "{ len( l.out_hide ) }">
			<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "InventoryProductSettings.d.out_hide" VALUE = "{ PRV_Parse_Tristate( l.out_hide ) }">
		</MvIF>

		<MvIF EXPR = "{ len( l.out_short ) }">
			<MvIF EXPR = "{ ( toupper( l.out_short ) EQ '#DEFAULT#' ) OR ( toupper( l.out_short ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "InventoryProductSettings.d.out_short" VALUE = "">
			<MvELSE>
				<MvASSIGN NAME = "InventoryProductSettings.d.out_short" VALUE = "{ l.out_short }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( l.out_long ) }">
			<MvIF EXPR = "{ ( toupper( l.out_long ) EQ '#DEFAULT#' ) OR ( toupper( l.out_long ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "InventoryProductSettings.d.out_long" VALUE = "">
			<MvELSE>
				<MvASSIGN NAME = "InventoryProductSettings.d.out_long" VALUE = "{ l.out_long }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( l.ltd_long ) }">
			<MvIF EXPR = "{ ( toupper( l.ltd_long ) EQ '#DEFAULT#' ) OR ( toupper( l.ltd_long ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "InventoryProductSettings.d.ltd_long" VALUE = "">
			<MvELSE>
				<MvASSIGN NAME = "InventoryProductSettings.d.ltd_long" VALUE = "{ l.ltd_long }">
			</MvIF>
		</MvIF>

		<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.ok" VALUE = "{ INV_InventoryProductSettings_Update( InventoryProductSettings.d.product_id, InventoryProductSettings.d.active, InventoryProductSettings.d.in_short, InventoryProductSettings.d.in_long, InventoryProductSettings.d.low_track, InventoryProductSettings.d.low_lvl_d, InventoryProductSettings.d.low_level, InventoryProductSettings.d.low_short, InventoryProductSettings.d.low_long, InventoryProductSettings.d.out_track, InventoryProductSettings.d.out_lvl_d, InventoryProductSettings.d.out_level, InventoryProductSettings.d.out_hide, InventoryProductSettings.d.out_short, InventoryProductSettings.d.out_long, InventoryProductSettings.d.ltd_long) }">
	<MvELSE>
		<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "l.active" VALUE = "{ PRV_Parse_Boolean( l.active ) }">
		<MvIF EXPR = "{ len( l.in_short ) }">
			<MvIF EXPR = "{ ( toupper( l.in_short ) EQ '#DEFAULT#' ) OR ( toupper( l.in_short ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "l.in_short" VALUE = "">
			<MvELSE>
				<MvASSIGN NAME = "l.in_short" VALUE = "{ l.in_short }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( l.in_long ) }">
			<MvIF EXPR = "{ ( toupper( l.in_long ) EQ '#DEFAULT#' ) OR ( toupper( l.in_long ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "l.in_long" VALUE = "">
			<MvELSE>
				<MvASSIGN NAME = "l.in_long" VALUE = "{ l.in_long }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( l.low_track ) }">
			<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "l.low_track" VALUE = "{ PRV_Parse_Tristate( l.low_track ) }">
		</MvIF>

		<MvIF EXPR = "{ len( l.low_level ) }">
			<MvIF EXPR = "{ ( toupper( l.low_level ) EQ '#DEFAULT#' ) }">
				<MvASSIGN NAME = "l.low_lvl_d" VALUE = "1">
				<MvASSIGN NAME = "l.low_level" VALUE = "0">
			<MvELSE>
				<MvASSIGN NAME = "l.low_lvl_d" VALUE = "0">
				<MvASSIGN NAME = "l.low_level" VALUE = "{ l.low_level }">
			</MvIF>
			<MvASSIGN NAME = "l.low_level" VALUE = "{ l.low_level }">
		</MvIF>

		<MvIF EXPR = "{ len( l.low_short ) }">
			<MvIF EXPR = "{ ( toupper( l.low_short ) EQ '#DEFAULT#' ) OR ( toupper( l.low_short ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "l.low_short" VALUE = "">
			<MvELSE>
				<MvASSIGN NAME = "l.low_short" VALUE = "{ l.low_short }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( l.low_long ) }">
			<MvIF EXPR = "{ ( toupper( l.low_long ) EQ '#DEFAULT#' ) OR ( toupper( l.low_long ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "l.low_long" VALUE = "">
			<MvELSE>
				<MvASSIGN NAME = "l.low_long" VALUE = "{ l.low_long }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( l.out_track ) }">
			<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "l.out_track" VALUE = "{ PRV_Parse_Tristate( l.out_track ) }">
		</MvIF>

		<MvIF EXPR = "{ len( l.out_level ) }">
			<MvIF EXPR = "{ ( toupper( l.out_level ) EQ '#DEFAULT#' ) }">
				<MvASSIGN NAME = "l.out_lvl_d" VALUE = "1">
				<MvASSIGN NAME = "l.out_level" VALUE = "0">
			<MvELSE>
				<MvASSIGN NAME = "l.out_lvl_d" VALUE = "0">
				<MvASSIGN NAME = "l.out_level" VALUE = "{ l.out_level }">
			</MvIF>
			<MvASSIGN NAME = "l.out_level" VALUE = "{ l.out_level }">
		</MvIF>

		<MvIF EXPR = "{ len( l.out_hide ) }">
			<MvDO FILE = "{ g.Module_Feature_PRV_AD }" NAME = "l.out_hide" VALUE = "{ PRV_Parse_Tristate( l.out_hide ) }">
		</MvIF>

		<MvIF EXPR = "{ len( l.out_short ) }">
			<MvIF EXPR = "{ ( toupper( l.out_short ) EQ '#DEFAULT#' ) OR ( toupper( l.out_short ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "l.out_short" VALUE = "">
			<MvELSE>
				<MvASSIGN NAME = "l.out_short" VALUE = "{ l.out_short }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( l.out_long ) }">
			<MvIF EXPR = "{ ( toupper( l.out_long ) EQ '#DEFAULT#' ) OR ( toupper( l.out_long ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "l.out_long" VALUE = "">
			<MvELSE>
				<MvASSIGN NAME = "l.out_long" VALUE = "{ l.out_long }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ len( l.ltd_long ) }">
			<MvIF EXPR = "{ ( toupper( l.ltd_long ) EQ '#DEFAULT#' ) OR ( toupper( l.ltd_long ) EQ '#NONE' ) }">
				<MvASSIGN NAME = "l.ltd_long" VALUE = "">
			<MvELSE>
				<MvASSIGN NAME = "l.ltd_long" VALUE = "{ l.ltd_long }">
			</MvIF>
		</MvIF>

		<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.ok" VALUE = "{ INV_InventoryProductSettings_Insert( Products.d.id, l.active, l.in_short, l.in_long, l.low_track, l.low_lvl_d, l.low_level, l.low_short, l.low_long, l.out_track, l.out_lvl_d,  l.out_level, l.out_hide, l.out_short, l.out_long, l.ltd_long) }">
	</MvIF>
	
	<MvIF EXPR = "{ l.ok AND len( l.stock ) AND ( l.stock NE 0 ) }">
		<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.ok" VALUE = "{ INV_InventoryProductCounts_Adjust( Products.d.id, l.stock ) }"> 		
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "l.ok">
</MvFUNCTION>

<MvFUNCTION NAME = "INV_Provision_Delete_InventoryProductSettings" PARAMETERS = "version, store_code, delimiter, data" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = "1">
			
	<MvASSIGN NAME = "l.pos" VALUE = "1">

	<MvASSIGN NAME = "l.product_code" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	
	<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.ok" VALUE = "{ Product_Find_Code( l.product_code ) }">
	<MvIF EXPR = "{ NOT l.ok }">
		<MvFUNCTIONRETURN VALUE = "0">
	</MvIF>
	
	<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.found" VALUE = "{ INV_InventoryProductSettings_Find_ProdID( Products.d.id ) }">
	
	<MvIF EXPR = "{ l.found }">
		<MvDO FILE = "{ g.Module_Feature_INV_DB }" NAME = "l.ok" VALUE = "{ INV_InventoryProductSettings_Delete( InventoryProductSettings.d.product_id ) }">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "l.ok">
</MvFUNCTION>

<MvFUNCTION NAME = "INV_Upgrade_Setup_State" STANDARDOUTPUTLEVEL = "">
	<MvCOMMENT>
	|
	| inv_set.dbf
	| *********************************************************************************************
	|
	| 4.00: Created
	|
	</MvCOMMENT>

	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Store_DB_New_Insert( 4.00, 'inv_set.dbf',
																	   'active		BOOL,
																		in_short	CHAR( 254 ),
																		in_long		MEMO,
																		low_track	BOOL,
																		low_level	NUMBER,
																		low_short	CHAR( 254 ),
																		low_long	MEMO,
																		out_track	BOOL,
																		out_level	NUMBER,
																		out_hide	BOOL,
																		out_short	CHAR( 254 ),
																		out_long	MEMO,
																		ltd_long	MEMO,
																		eml_low		BOOL,
																		eml_out		BOOL,
																		eml_from	CHAR( 254 ),
																		eml_to		CHAR( 254 ),
																		eml_cc		CHAR( 254 ),
																		eml_sub		CHAR( 254 ),
																		eml_msg		MEMO' ) }">

	<MvCOMMENT>
	|
	| inv_prd.dbf
	| *********************************************************************************************
	|
	| 4.00: Created
	|
	</MvCOMMENT>

	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Store_DB_New_Insert( 4.00, 'inv_prd.dbf',
																	   'product_id	NUMBER,
																		active		BOOL,
																		in_short	CHAR( 254 ),
																		in_long		MEMO,
																		low_track	CHAR( 1 ),
																		low_lvl_d	BOOL,
																		low_level	NUMBER,
																		low_short	CHAR( 254 ),
																		low_long	MEMO,
																		out_track	CHAR( 1 ),
																		out_lvl_d	BOOL,
																		out_level	NUMBER,
																		out_hide	CHAR( 1 ),
																		out_short	CHAR( 254 ),
																		out_long	MEMO,
																		ltd_long	MEMO' ) }">
	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Store_DB_Index_Insert( 4.00, 'InventoryProductSettings', 'inv_prd.dbf', 'inv_prd.mvx', 'InventoryProductSettings.d.product_id', 'unique, ascending' ) }">

	<MvCOMMENT>
	|
	| inv_cnt.dbf
	| *********************************************************************************************
	|
	| 4.00: Created
	|
	</MvCOMMENT>

	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Store_DB_New_Insert( 4.00, 'inv_cnt.dbf',
																	   'product_id	NUMBER,
																		inventory	NUMBER' ) }">
	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Store_DB_Index_Insert( 4.00, 'InventoryProductCounts', 'inv_cnt.dbf', 'inv_cnt.mvx', 'InventoryProductCounts.d.product_id', 'unique, ascending' ) }">
	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Domain_Privilege_New_Insert( 4.00, 'INVT' ) }">



</MvFUNCTION>

<MvFUNCTION NAME = "INV_Upgrade_Store_DB_New_InventorySettings" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "Temporary.d.active" VALUE = "0">
	<MvLOCALIZED NAME = "Temporary.d.in_short" ID = "MER-INV-00083">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">In Stock</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvLOCALIZED NAME = "Temporary.d.in_long" ID = "MER-INV-00084">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">%%inv_instock%% available for immediate delivery</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvASSIGN NAME = "Temporary.d.low_track" VALUE = "0">
	<MvASSIGN NAME = "Temporary.d.low_level" VALUE = "0">
	<MvLOCALIZED NAME = "Temporary.d.low_short" ID = "MER-INV-00085">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Backordered</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvLOCALIZED NAME = "Temporary.d.low_long" ID = "MER-INV-00086">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">
			Please Note: '%%product_name%%' is currently backordered. Please be aware that there may be a delay in shipping.
		</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvASSIGN NAME = "Temporary.d.out_track" VALUE = "0">
	<MvASSIGN NAME = "Temporary.d.out_level" VALUE = "0">
	<MvASSIGN NAME = "Temporary.d.out_hide" VALUE = "0">

	<MvLOCALIZED NAME = "Temporary.d.out_short" ID = "MER-INV-00087">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">Sold Out</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvLOCALIZED NAME = "Temporary.d.out_long" ID = "MER-INV-00088">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">
			Sorry, we are currently sold out of '%%product_name%%'. Please check back later.
		</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvLOCALIZED NAME = "Temporary.d.ltd_long" ID = "MER-INV-00089">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">
			Sorry, we do not have enough '%%product_name%%' to fill your order. Please adjust the quantity and try again. Quantity Available: %%inv_available%%. 
		</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvASSIGN NAME = "Temporary.d.eml_low" VALUE = "0">
	<MvASSIGN NAME = "Temporary.d.eml_out" VALUE = "0">
	<MvASSIGN NAME = "Temporary.d.eml_from" VALUE = "{ Upgrade_Domain.d.email }">
	<MvASSIGN NAME = "Temporary.d.eml_to" VALUE = "{ Upgrade_Domain.d.email }">
	<MvASSIGN NAME = "Temporary.d.eml_cc" VALUE = "">
	<MvLOCALIZED NAME = "Temporary.d.eml_sub" ID = "MER-INV-00090">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">%%product_name%% %%inv_level%%</MvLOCALIZED-TEXT>
	</MvLOCALIZED>
	<MvLOCALIZED NAME = "Temporary.d.eml_msg" ID = "MER-INV-00091">
		<MvLOCALIZED-TEXT LANGUAGE = "en-US">%%product_name%% %%inv_level%%</MvLOCALIZED-TEXT>
	</MvLOCALIZED>

	<MvADD NAME = "Temporary">
	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "INV_Upgrade_Store_DB_New_InventoryProductSettings">
	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "INV_Upgrade_Store_DB_New_InventoryProductCounts">
	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>


