<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/
|
| $Source: /home/cvs/merchant/Merchant/features/not/not_db.mv,v $
|
| Prefix         : MER-NOT-DB-
| Next Error Code: 14   
| Next Text ID   : 3    
|
</MvCOMMENT>

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

	<MvIF EXPR = "{ l.ok }">
		<MvCREATE NAME = "Notes"
					DATABASE = "{ g.MerchantPath $ 'notes.dbf' }"
					FIELDS = "	id 			NUMBER,
								label		CHAR( 100 ),
								note		MEMO">

		<MvIF EXPR = "{ MvCREATE_Error }">
			<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-DB-00001', MvCREATE_Error ) }">
		<MvELSE>
			<MvASSIGN NAME = "g._DB_Tasks_Open" VALUE = 1>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvMAKEINDEX NAME = "Notes"
						 INDEXFILE = "{ g.MerchantPath $ 'note_id.mvx' }"
						 EXPRESSION = "{ Notes.d.id }"
						 FLAGS = "unique, ascending">
			<MvIF EXPR = "{ MvMAKEINDEX_Error }">
				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-DB-00002', MvMAKEINDEX_Error ) }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.ok" VALUE = "{ Key_Insert( 'Notes' ) }">
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvCLOSE NAME = "Notes">
			<MvASSIGN NAME = "g._DB_Notes_Open" VALUE = 0>
		</MvIF>
	</MvIF>

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

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

	<MvIF EXPR = "{ l.ok }">
		<MvCREATE NAME = "RemoteNotificationSettings"
				  DATABASE = "{ g.MerchantPath $ 'rn_set.dbf' }"
				  FIELDS = "security	BOOL,
							updates		BOOL,
							offers		BOOL,
							o_lupdate	CHAR( 10 ),
							poll		CHAR( 1 ),
							lastpoll	NUMBER,
							lastreply	NUMBER,
							pollurl		CHAR( 254 )">
		<MvIF EXPR = "{ MvCREATE_Error }">
			<MvDO FILE = "{ g.Library_Filename_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-DB-00009', MvCREATE_Error ) }">
		</MvIF>

		<MvIF EXPR = "{ l.ok }">	
			<MvASSIGN NAME = "RemoteNotificationSettings.d.security" 	VALUE = "">
			<MvASSIGN NAME = "RemoteNotificationSettings.d.updates" 	VALUE = "">
			<MvASSIGN NAME = "RemoteNotificationSettings.d.offers" 		VALUE = "">
			<MvASSIGN NAME = "RemoteNotificationSettings.d.o_lupdate" 	VALUE = "">
			<MvASSIGN NAME = "RemoteNotificationSettings.d.poll" 		VALUE = "">
			<MvASSIGN NAME = "RemoteNotificationSettings.d.lastpoll" 	VALUE = "">
			<MvASSIGN NAME = "RemoteNotificationSettings.d.lastreply" 	VALUE = "">
			<MvASSIGN NAME = "RemoteNotificationSettings.d.pollurl" 	VALUE = "">

			<MvADD NAME = "RemoteNotificationSettings">
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvCLOSE NAME = "RemoteNotificationSettings">
			<MvASSIGN NAME = "g._DB_NoteSettings_Open" VALUE = 0>
		</MvIF>
	</MvIF>

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

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

	<MvIF EXPR = "{ l.ok }">
		<MvCREATE NAME = "StoreNotes"
					DATABASE = "{ g._DB_Store_Directory $ 'snotes.dbf' }"
					FIELDS = "	id 			NUMBER,
								scode		CHAR( 50 ),
								label		CHAR( 100 ),
								note		MEMO">

		<MvIF EXPR = "{ MvCREATE_Error }">
			<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-DB-00003', MvCREATE_Error ) }">
		<MvELSE>
			<MvASSIGN NAME = "g._DB_Tasks_Open" VALUE = 1>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvMAKEINDEX NAME = "StoreNotes"
						 INDEXFILE = "{ g._DB_Store_Directory $ 'snote_id.mvx' }"
						 EXPRESSION = "{ StoreNotes.d.id }"
						 FLAGS = "unique, ascending">
			<MvIF EXPR = "{ MvMAKEINDEX_Error }">
				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-DB-00004', MvMAKEINDEX_Error ) }">
			</MvIF>
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.ok" VALUE = "{ StoreKey_Insert( 'StoreNotes', 1 ) }">
		</MvIF>

		<MvIF EXPR = "{ l.ok }">
			<MvCLOSE NAME = "StoreNotes">
			<MvASSIGN NAME = "g._DB_StoreNotes_Open" VALUE = 0>
		</MvIF>
	</MvIF>

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

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

	<MvASSIGN NAME = "l.deleted" VALUE = "{ fdelete( g.MerchantPath $ 'rn_set.dbf' ) }">
	<MvASSIGN NAME = "l.deleted" VALUE = "{ fdelete( g.MerchantPath $ 'notes.dbf' ) }">
	<MvASSIGN NAME = "l.deleted" VALUE = "{ fdelete( g.MerchantPath $ 'notes.dbt' ) }">
	<MvASSIGN NAME = "l.deleted" VALUE = "{ fdelete( g.MerchantPath $ 'note_id.mvx' ) }">

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

<MvFUNCTION NAME = "NOT_DeleteStoreData" PARAMETERS = "directory" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvASSIGN NAME = "l.deleted" VALUE = "{ fdelete( l.directory $ 'snotes.dbf' ) }">
	<MvASSIGN NAME = "l.deleted" VALUE = "{ fdelete( l.directory $ 'snotes.dbt' ) }">
	<MvASSIGN NAME = "l.deleted" VALUE = "{ fdelete( l.directory $ 'snote_id.mvx' ) }">

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

<MvFUNCTION NAME = "NOT_Domain_Pack" STANDARDOUTPUTLEVEL = "" ERROROUTPUTLEVEL = "syntax, expression">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.ok" VALUE = "{ _DB_Open_NotificationSettings() }">
		<MvIF EXPR = "{ l.ok }">
			<MvPACK NAME = "RemoteNotificationSettings">
			<MvIF EXPR = "{ MvPACK_Error }">
				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-DB-00010', MvPACK_Error ) }">
			<MvELSE>
				<MvCLOSE NAME = "RemoteNotificationSettings">
				<MvASSIGN NAME = "g._DB_NoteSettings_Open" VALUE = 0>
			</MvIF>
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.ok" VALUE = "{ _DB_Open_Notes() }">
		<MvIF EXPR = "{ l.ok }">
			<MvPACK NAME = "Notes">
			<MvIF EXPR = "{ MvPACK_Error }">
				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-DB-00011', MvPACK_Error ) }">
			<MvELSE>
				<MvCLOSE NAME = "Notes">
				<MvASSIGN NAME = "g._DB_Notes_Open" VALUE = 0>
			</MvIF>
		</MvIF>
	</MvIF>

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

<MvFUNCTION NAME = "NOT_Store_Pack" STANDARDOUTPUTLEVEL = "" ERROROUTPUTLEVEL = "syntax, expression">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.ok" VALUE = "{ _DB_Open_StoreNotes() }">
		<MvIF EXPR = "{ l.ok }">
			<MvPACK NAME = "StoreNotes">
			<MvIF EXPR = "{ MvPACK_Error }">
				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-DB-00012', MvPACK_Error ) }">
			<MvELSE>
				<MvCLOSE NAME = "StoreNotes">
				<MvASSIGN NAME = "g._DB_StoreNotes_Open" VALUE = 0>
			</MvIF>
		</MvIF>
	</MvIF>

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

<MvFUNCTION NAME = "_DB_Open_NotificationSettings" STANDARDOUTPUTLEVEL = "" ERROROUTPUTLEVEL = "syntax, expression">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ NOT g._DB_NoteSettings_Open }">
		<MvOPEN NAME = "RemoteNotificationSettings" 
				DATABASE = "{ g.MerchantPath $ 'rn_set.dbf' }">
		<MvIF EXPR = "{ MvOPEN_Error }">
			<MvDO FILE = "{ g.Library_Filename_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-DB-00013', MvOPEN_Error ) }">
		<MvELSE>
			<MvASSIGN NAME = "g._DB_NoteSettings_Open" VALUE = 1>			
		</MvIF>	
	</MvIF>

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

<MvFUNCTION NAME = "Domain_NoteSettings_Update" PARAMETERS = "security, updates, offers, poll, url" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	
	<MvIF EXPR = "{ _DB_Open_NotificationSettings() }">
		<MvASSIGN NAME = "RemoteNotificationSettings.d.security" 	VALUE = "{ l.security }">
		<MvASSIGN NAME = "RemoteNotificationSettings.d.updates" 	VALUE = "{ l.updates }">
		<MvASSIGN NAME = "RemoteNotificationSettings.d.offers"		VALUE = "{ l.offers }">
		<MvASSIGN NAME = "RemoteNotificationSettings.d.poll"		VALUE = "{ l.poll }">
		<MvASSIGN NAME = "RemoteNotificationSettings.d.pollurl"		VALUE = "{ l.url }">

		<MvUPDATE NAME = "RemoteNotificationSettings">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "NoteSettings_UpdateLastPoll" PARAMETERS = "date" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	
	<MvIF EXPR = "{ _DB_Open_NotificationSettings() }">
		<MvASSIGN NAME = "RemoteNotificationSettings.d.lastpoll"		VALUE = "{ l.date }">

		<MvUPDATE NAME = "RemoteNotificationSettings">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "NoteSettings_UpdateLastReply" PARAMETERS = "date" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = 1>
	
	<MvIF EXPR = "{ _DB_Open_NotificationSettings() }">
		<MvASSIGN NAME = "RemoteNotificationSettings.d.lastreply" VALUE = "{ l.date }">

		<MvUPDATE NAME = "RemoteNotificationSettings">
	</MvIF>
	
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "_DB_Open_Notes" STANDARDOUTPUTLEVEL = "" ERROROUTPUTLEVEL = "syntax, expression">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ NOT g._DB_Notes_Open }">
		<MvOPEN NAME = "Notes" 
				DATABASE = "{ g.MerchantPath $ 'notes.dbf' }" 
				INDEXES = "{ g.MerchantPath $ 'note_id.mvx' }">
		<MvIF EXPR = "{ MvOPEN_Error }">
			<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-DB-00005', MvOPEN_Error ) }">
		<MvELSE>
			<MvFILTER NAME = "Notes" FILTER = "{ NOT Notes.d.deleted }">
			<MvASSIGN NAME = "g._DB_Notes_Open" VALUE = 1>
		</MvIF>
	</MvIF>

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

<MvFUNCTION NAME = "_DB_Open_StoreNotes" STANDARDOUTPUTLEVEL = "" ERROROUTPUTLEVEL = "syntax, expression">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ NOT g._DB_StoreNotes_Open }">
		<MvOPEN NAME = "StoreNotes" 
				DATABASE = "{ g._DB_Store_Directory $ 'snotes.dbf' }" 
				INDEXES = "{ g._DB_Store_Directory $ 'snote_id.mvx' }">
		<MvIF EXPR = "{ MvOPEN_Error }">
			<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-DB-00006', MvOPEN_Error ) }">
		<MvELSE>
			<MvFILTER NAME = "StoreNotes" FILTER = "{ NOT StoreNotes.d.deleted }">
			<MvASSIGN NAME = "g._DB_StoreNotes_Open" VALUE = 1>
		</MvIF>
	</MvIF>

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

<MvFUNCTION NAME = "Notes_Insert" PARAMETERS = "label, note" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = "{ _DB_Open_Notes() }">

	<MvIF EXPR = "{ l.ok }">
		<MvDO FILE = "{ g.Module_Library_DB }" NAME = "Notes.d.id" VALUE = "{ Key_Generate( 'Notes' ) }">
		<MvASSIGN NAME = "Notes.d.label" 		VALUE = "{ l.label }">
		<MvASSIGN NAME = "Notes.d.note" 		VALUE = "{ l.note }">
		
		<MvADD NAME = "Notes">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ Notes.d.id }">
</MvFUNCTION>

<MvFUNCTION NAME = "StoreNotes_Insert" PARAMETERS = "scode, label, note" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = "{ _DB_Open_StoreNotes() }">

	<MvIF EXPR = "{ l.ok }">
		<MvPRIMARY NAME = "StoreNotes" INDEX = "{ g._DB_Store_Directory $ 'snote_id.mvx' }">
		<MvDO FILE = "{ g.Module_Library_DB }" NAME = "StoreNotes.d.id" VALUE = "{ StoreKey_Generate( 'StoreNotes' ) }">
		<MvASSIGN NAME = "StoreNotes.d.scode" 		VALUE = "{ l.scode }">
		<MvASSIGN NAME = "StoreNotes.d.label" 		VALUE = "{ l.label }">
		<MvASSIGN NAME = "StoreNotes.d.note" 		VALUE = "{ l.note }">
		
		<MvADD NAME = "StoreNotes">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ StoreNotes.d.id }">
</MvFUNCTION>

<MvFUNCTION NAME = "StoreNotes_Delete" PARAMETERS = "id" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = "{ _DB_Open_StoreNotes() }">
	<MvIF EXPR = "{ l.ok }">
		<MvPRIMARY NAME = "StoreNotes" INDEX = "{ g._DB_Store_Directory $ 'snote_id.mvx' }">
		<MvFIND NAME = "StoreNotes" VALUE = "{ l.id }" EXACT>
		<MvIF EXPR = "{ StoreNotes.d.EOF }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-NOT-DB-00001">
				<MvLOCALIZED-TOKEN NAME = "note" VALUE = "{ encodeentities( l.id ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Note '%note%' not found</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-DB-00007', l.error ) }">
		<MvELSE>
			<MvDELETE NAME = "StoreNotes">
		</MvIF>
	</MvIF>

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

<MvFUNCTION NAME = "Note_Delete" PARAMETERS = "id" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = "{ _DB_Open_Notes() }">
	<MvIF EXPR = "{ l.ok }">
		<MvPRIMARY NAME = "Notes" INDEX = "{ g.MerchantPath $ 'note_id.mvx' }">
		<MvFIND NAME = "Notes" VALUE = "{ l.id }" EXACT>
		<MvIF EXPR = "{ Notes.d.EOF }">
			<MvLOCALIZED NAME = "l.error" ID = "MER-NOT-DB-00002">
				<MvLOCALIZED-TOKEN NAME = "note" VALUE = "{ encodeentities( l.id ) }">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Note '%note%' not found</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-DB-00008', l.error ) }">
		<MvELSE>
			<MvDELETE NAME = "Notes">
		</MvIF>
	</MvIF>

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

<MvFUNCTION NAME = "Find_StoreNoteID" PARAMETERS = "id" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.found" VALUE = 0>
	
	<MvIF EXPR = "{ _DB_Open_StoreNotes() }">
		<MvPRIMARY NAME = "StoreNotes" INDEX = "{ g._DB_Store_Directory $ 'snote_id.mvx' }">
		<MvFIND NAME = "StoreNotes" VALUE = "{ l.id }" EXACT>
		<MvIF EXPR = "{ NOT StoreNotes.d.EOF }">
			<MvASSIGN NAME = "l.found" VALUE = "{ StoreNotes.d.id }">
		</MvIF>
	</MvIF>

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

<MvFUNCTION NAME = "Find_NoteID" PARAMETERS = "id" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.found" VALUE = 0>
	
	<MvIF EXPR = "{ _DB_Open_Notes() }">
		<MvPRIMARY NAME = "Notes" INDEX = "{ g.MerchantPath $ 'note_id.mvx' }">
		<MvFIND NAME = "Notes" VALUE = "{ l.id }" EXACT>
		<MvIF EXPR = "{ NOT Notes.d.EOF }">
			<MvASSIGN NAME = "l.found" VALUE = "{ Notes.d.id }">
		</MvIF>
	</MvIF>

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

<MvFUNCTION NAME = "Notes_FindFirst_StoreNote" PARAMETERS = "store" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.found" VALUE = 0>
	<MvIF EXPR = "{ _DB_Open_StoreNotes() }">
		<MvPRIMARY NAME = "StoreNotes" INDEX = "{ g._DB_Store_Directory $ 'snote_id.mvx' }">
		<MvGO NAME = "StoreNotes" ROW = "top">
		<MvIF EXPR = "{ NOT StoreNotes.d.EOF }">
			<MvIF EXPR = "{ l.store EQ StoreNotes.d.scode }">
				<MvASSIGN NAME = "l.found" VALUE = 1>				
			</MvIF>
		</MvIF>
	</MvIF>

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

<MvFUNCTION NAME = "Notes_FindNext_StoreNote" PARAMETERS = "store" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.found" VALUE = 0>

	<MvSKIP NAME = "StoreNotes" ROWS = 1>

	<MvIF EXPR = "{ NOT StoreNotes.d.EOF }">
		<MvIF EXPR = "{ l.store EQ StoreNotes.d.scode }">
			<MvASSIGN NAME = "l.found" VALUE = 1>				
		</MvIF>
	</MvIF>

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

<MvFUNCTION NAME = "Notes_FindFirst_Store" PARAMETERS = "" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.found" VALUE = 0>
	<MvIF EXPR = "{ _DB_Open_StoreNotes() }">
		<MvPRIMARY NAME = "StoreNotes" INDEX = "{ g._DB_Store_Directory $ 'snote_id.mvx' }">
		<MvGO NAME = "StoreNotes" ROW = "top">
		<MvIF EXPR = "{ NOT StoreNotes.d.EOF }">
			<MvASSIGN NAME = "l.found" VALUE = 1>				
		</MvIF>
	</MvIF>

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

<MvFUNCTION NAME = "Notes_FindNext_Store" PARAMETERS = "" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.found" VALUE = 0>

	<MvSKIP NAME = "StoreNotes" ROWS = 1>
	<MvIF EXPR = "{ NOT StoreNotes.d.EOF }">
		<MvASSIGN NAME = "l.found" VALUE = 1>				
	</MvIF>

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

<MvFUNCTION NAME = "Notes_FindFirst_Domain" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.found" VALUE = 0>
	<MvIF EXPR = "{ _DB_Open_Notes() }">
		<MvPRIMARY NAME = "Notes" INDEX = "{ g.MerchantPath $ 'note_id.mvx' }">
		<MvGO NAME = "Notes" ROW = "top">

		<MvIF EXPR = "{ ( NOT Notes.d.EOF ) AND ( g.Admin_User_Administrator ) }">
			<MvASSIGN NAME = "l.found" VALUE = 1>				
		</MvIF>
	</MvIF>

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

<MvFUNCTION NAME = "Notes_FindNext_Domain" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.found" VALUE = 0>

	<MvSKIP NAME = "Notes" ROWS = 1>
	<MvIF EXPR = "{ NOT Notes.d.EOF }">
		<MvIF EXPR = "{ g.Admin_User_Administrator }">
			<MvASSIGN NAME = "l.found" VALUE = 1>				
		</MvIF>
	</MvIF>

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