﻿<?xml version="1.0" encoding="utf-16"?>
<JiwaDocument xmlns:jiwa="http://www.jiwa.com.au/xml/schemas" Type="JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin">
  <RecID>e7606031-f9ce-4979-ba95-b45c51f06fa0</RecID>
  <Name>Mirror Inventory Items</Name>
  <Description>Mirrors inventory items into another Jiwa database.  As items are created or modified, this plugin will replicate the changes to another database.

The database to mirror to is stored in system settings, as is the username and password to use to interact with the mirror database.

Where possible, referential data required missing in the mirror database will be created - this includes:
Inventory Classifications
Inventory Categories
Inventory Price Groups
Debtor Classifications
Debtor Price Groups
Regions
Creditors
Creditor Warehouses</Description>
  <IsEnabled>true</IsEnabled>
  <IsIsolatedToOwnAppDomain>false</IsIsolatedToOwnAppDomain>
  <ExecutionOrder>0</ExecutionOrder>
  <Author>Jiwa Financials</Author>
  <Version />
  <Code>using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using JiwaFinancials.Jiwa;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Drawing;

public class FormPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaFormPlugin
{

    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void SetupBeforeHandlers(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
    }

    public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
    }

}

public class BusinessLogicPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogicPlugin
{

    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic JiwaBusinessLogic, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
		JiwaFinancials.Jiwa.JiwaInventory.Inventory inventory = (JiwaFinancials.Jiwa.JiwaInventory.Inventory)JiwaBusinessLogic;
		inventory.SaveEnding += Inventory_SaveEnding;
    }
	
	public void Inventory_SaveEnding(object sender, System.EventArgs e)
	{
		JiwaFinancials.Jiwa.JiwaInventory.Inventory inventory = (JiwaFinancials.Jiwa.JiwaInventory.Inventory)sender;
		
		string mirrorDatabaseName = (string)JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData("Mirror Inventory Items", "MirrorDatabaseName", "");
		if (mirrorDatabaseName.Trim().Length &gt; 0) {			
			string databaseSessionID = JiwaFinancials.Jiwa.JiwaApplication.Session.Instance.SessionID;
			JiwaFinancials.Jiwa.JiwaInventory.XML.Inventory inventoryPoco = inventory.Serialise();
			
			string mirrorDatabaseSessionID = System.Guid.NewGuid().ToString();
			string mirrorDatabaseServerName = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ServerName;			
			string mirrorDatabaseUserName = (string)JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData("Mirror Inventory Items", "MirrorDatabaseUser", "");
			string mirrorDatabasePassword = (string)JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData("Mirror Inventory Items", "MirrorDatabasePassword", "");
			
			try {
				JiwaFinancials.Jiwa.JiwaApplication.Session.Instance.SessionID = mirrorDatabaseSessionID;	
				try {
					//JiwaFinancials.Jiwa.JiwaApplication.Manager.get_Instances(mirrorDatabaseSessionID).Logon(mirrorDatabaseServerName, mirrorDatabaseName, JiwaFinancials.Jiwa.JiwaODBC.database.AuthenticationModes.JiwaAuthentication, mirrorDatabaseUserName, mirrorDatabasePassword);
					JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Logon(mirrorDatabaseServerName, mirrorDatabaseName, JiwaFinancials.Jiwa.JiwaODBC.database.AuthenticationModes.JiwaAuthentication, mirrorDatabaseUserName, mirrorDatabasePassword);
					
					// See if the classification exists in the mirror database, if not then create it.
					CreateMissingClassification(inventory);
					
					// See if the categories exist in the mirror database, if not then create them.
					CreateMissingCategories(inventory);
					
					// See if the Price Group exists in the mirror database, if not then create it.
					CreateMissingPriceGroup(inventory);
					
					// See if the Debtor classifications exist in the mirror database, if not then create them.
					CreateMissingDebtorClassifications(inventory);
					
					// See if the regions referenced exist in the mirror database, if not then create them.
					CreateMissingRegions(inventory);
					
					// See if the creditors referenced exist in the mirror database, if not then create them.
					CreateMissingCreditors(inventory);
					
					JiwaFinancials.Jiwa.JiwaInventory.Inventory mirrorInventory = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic&lt;JiwaFinancials.Jiwa.JiwaInventory.Inventory&gt;(null);									
					
					if (inventory.InsertFlag) {
						// set the inventory ID to null for a new item so when we deserialise in the mirror database it doesn't try to read and throw an exception
						inventoryPoco.InventoryID = null;
					}
					
					// set the RecID to null for all new documents, so the deserialise doesn't try to find an existing document in the mirror database with that RecID.
					// Note the poco lists are 0 based, but the business logic JiwaCollections are 1 based.
					for (int i = 1; i &lt;= inventory.Documents.Count; i++) {
						if (inventory.Documents[i].InsertFlag) {
							inventoryPoco.Documents[i - 1].RecID = null;
						}
					}									
					
					// set the RecID to null for all new debtor classification prices, so the deserialise doesn't try to find an existing price in the mirror database with that RecID.
					// Note the poco lists are 0 based, but the business logic JiwaCollections are 1 based.
					for (int i = 1; i &lt;= inventory.DebtorClassPrices.Count; i++) {
						if (inventory.DebtorClassPrices[i].InsertFlag) {
							inventoryPoco.DebtorClassPrices[i - 1].RecID = null;
						}
					}	
					
					// set the RecID to null for all new debtor price group prices, so the deserialise doesn't try to find an existing price in the mirror database with that RecID.
					// Note the poco lists are 0 based, but the business logic JiwaCollections are 1 based.
					for (int i = 1; i &lt;= inventory.DebtorPriceGroupInventorySpecificPrices.Count; i++) {
						if (inventory.DebtorPriceGroupInventorySpecificPrices[i].InsertFlag) {
							inventoryPoco.DebtorPriceGroupInventorySpecificPrices[i - 1].RecID = null;
						}
					}
					
					// set the RecID to null for all new regions, so the deserialise doesn't try to find an existing region in the mirror database with that RecID.
					// Note the poco lists are 0 based, but the business logic JiwaCollections are 1 based.
					for (int i = 1; i &lt;= inventory.Regions.Count; i++) {
						if (inventory.Regions[i].InsertFlag) {
							inventoryPoco.Regions[i - 1].RegionID = null;
						}
						
						// Now do suppliers
						for (int j = 1; j &lt;= inventory.Regions[i].Suppliers.Count; j++) {
							if (inventory.Regions[i].Suppliers[j].InsertFlag) {
								inventoryPoco.Regions[i - 1].Suppliers[j - 1].RecID = null;
								
								// Now do supplier warehouses
								for (int k = 1; k &lt;= inventory.Regions[i].Suppliers[j].SupplierWarehouses.Count; k++) {
									if (inventory.Regions[i].Suppliers[j].SupplierWarehouses[k].InsertFlag) {
										inventoryPoco.Regions[i - 1].Suppliers[j - 1].SupplierWarehouses[k - 1].RecID = null;
									}
								}
							}
						}
					}
					
					// set the RecID to null for all new alternate children, so the deserialise doesn't try to find an existing alternate child in the mirror database with that RecID.
					// Note the poco lists are 0 based, but the business logic JiwaCollections are 1 based.
					for (int i = 1; i &lt;= inventory.AlternateChildren.Count; i++) {
						if (inventory.AlternateChildren[i].InsertFlag) {
							inventoryPoco.AlternateChildren[i - 1].RecID = null;
						}
					}
					
					// set the RecID to null for all new components, so the deserialise doesn't try to find an existing component in the mirror database with that RecID.
					// Note the poco lists are 0 based, but the business logic JiwaCollections are 1 based.
					for (int i = 1; i &lt;= inventory.Components.Count; i++) {
						if (inventory.Components[i].InsertFlag) {
							inventoryPoco.Components[i - 1].RecID = null;
						}
					}
					
					// set the RecID to null for all new upsells, so the deserialise doesn't try to find an existing upsell in the mirror database with that RecID.
					// Note the poco lists are 0 based, but the business logic JiwaCollections are 1 based.
					for (int i = 1; i &lt;= inventory.UpSells.Count; i++) {
						if (inventory.UpSells[i].InsertFlag) {
							inventoryPoco.UpSells[i - 1].RecID = null;
						}
					}
					
					mirrorInventory.Deserialise(inventoryPoco);			
					
					if (inventory.InsertFlag) {
						// now set the id we previously nulled
						mirrorInventory.InventoryID = inventory.InventoryID;
					}
					
					// Remove any deleted documents
					for (int i = 1; i &lt;= inventory.Documents.DeletedCollection.Count; i++) {
						JiwaFinancials.Jiwa.JiwaApplication.Documents.Document deletedDocument = (JiwaFinancials.Jiwa.JiwaApplication.Documents.Document)inventory.Documents.DeletedCollection[i];						
						JiwaFinancials.Jiwa.JiwaApplication.Documents.Document mirrorDocument = mirrorInventory.Documents[deletedDocument.RecID];
						
						if (mirrorDocument != null) {
							mirrorInventory.Documents.Remove(mirrorDocument);
						}						
					}
					
					// Now set the RecID of the inserted documents to be that of the RecID from the source inventory item					
					for (int i = 1; i &lt;= inventory.Documents.Count; i++) {
						if (inventory.Documents[i].InsertFlag) {
							mirrorInventory.Documents[i].RecID = inventory.Documents[i].RecID;
						}						
					}
					
					// Remove any deleted debtor classification prices
					for (int i = 1; i &lt;= inventory.DebtorClassPrices.DeletedCollection.Count; i++) {
						JiwaFinancials.Jiwa.JiwaInventory.DebtorClassificationInventorySpecific deletedDebtorClassPrice = (JiwaFinancials.Jiwa.JiwaInventory.DebtorClassificationInventorySpecific)inventory.DebtorClassPrices.DeletedCollection[i];
						JiwaFinancials.Jiwa.JiwaInventory.DebtorClassificationInventorySpecific mirrorDebtorClassPrice = mirrorInventory.DebtorClassPrices[deletedDebtorClassPrice.RecID];
						
						if (mirrorDebtorClassPrice != null) {
							mirrorInventory.DebtorClassPrices.Remove(mirrorDebtorClassPrice);
						}						
					}
					
					// Now set the RecID of the inserted debtor classification prices to be that of the RecID from the source inventory item					
					for (int i = 1; i &lt;= inventory.DebtorClassPrices.Count; i++) {
						if (inventory.DebtorClassPrices[i].InsertFlag) {
							mirrorInventory.DebtorClassPrices[i].RecID = inventory.DebtorClassPrices[i].RecID;
						}						
					}
					
					// Remove any deleted debtor price group prices
					for (int i = 1; i &lt;= inventory.DebtorPriceGroupInventorySpecificPrices.DeletedCollection.Count; i++) {
						JiwaFinancials.Jiwa.JiwaInventory.DebtorPriceGroupInventorySpecific deletedDebtorPriceGroupPrice = (JiwaFinancials.Jiwa.JiwaInventory.DebtorPriceGroupInventorySpecific)inventory.DebtorPriceGroupInventorySpecificPrices.DeletedCollection[i];
						JiwaFinancials.Jiwa.JiwaInventory.DebtorPriceGroupInventorySpecific mirrorDebtorPriceGroupPrice = mirrorInventory.DebtorPriceGroupInventorySpecificPrices[deletedDebtorPriceGroupPrice.RecID];
						
						if (mirrorDebtorPriceGroupPrice != null) {
							mirrorInventory.DebtorPriceGroupInventorySpecificPrices.Remove(mirrorDebtorPriceGroupPrice);
						}						
					}
					
					// Now set the RecID of the inserted debtor debtor price group prices to be that of the RecID from the source inventory item					
					for (int i = 1; i &lt;= inventory.DebtorPriceGroupInventorySpecificPrices.Count; i++) {
						if (inventory.DebtorPriceGroupInventorySpecificPrices[i].InsertFlag) {
							mirrorInventory.DebtorPriceGroupInventorySpecificPrices[i].RecID = inventory.DebtorPriceGroupInventorySpecificPrices[i].RecID;
						}						
					}
					
					// Remove any deleted regions
					for (int i = 1; i &lt;= inventory.Regions.DeletedCollection.Count; i++) {
						JiwaFinancials.Jiwa.JiwaInventory.Region deletedRegion = (JiwaFinancials.Jiwa.JiwaInventory.Region)inventory.Regions.DeletedCollection[i];
						JiwaFinancials.Jiwa.JiwaInventory.Region mirrorRegion = mirrorInventory.Regions[deletedRegion.RecID];
						
						if (mirrorRegion != null) {
							mirrorInventory.Regions.Remove(mirrorRegion);							
						}																		
					}
					
					// Remove any deleted suppliers
					for (int i = 1; i &lt;= inventory.Regions.Count; i++) {
						JiwaFinancials.Jiwa.JiwaInventory.Region mirrorRegion = mirrorInventory.Regions[i];
						
						if (mirrorRegion != null) {
							for (int j = 1; j &lt;= inventory.Regions[i].Suppliers.DeletedCollection.Count; j++) {
								JiwaFinancials.Jiwa.JiwaInventory.Supplier deletedSupplier = (JiwaFinancials.Jiwa.JiwaInventory.Supplier)inventory.Regions[i].Suppliers.DeletedCollection[j];
								JiwaFinancials.Jiwa.JiwaInventory.Supplier mirrorSupplier = mirrorInventory.Regions[i].Suppliers[j];
								
								if (mirrorSupplier != null) {
									mirrorInventory.Regions[i].Suppliers.Remove(mirrorSupplier);							
								}
							}
						}																		
					}
					
					// Now set the RecID of the inserted regions to be that of the RecID from the source inventory item					
					for (int i = 1; i &lt;= inventory.Regions.Count; i++) {
						if (inventory.Regions[i].InsertFlag) {
							mirrorInventory.Regions[i].RecID = inventory.Regions[i].RecID;													
						}
						
						// Now do suppliers
						for (int j = 1; j &lt;= inventory.Regions[i].Suppliers.Count; j++) {
							if (inventory.Regions[i].Suppliers[j].InsertFlag) {
								mirrorInventory.Regions[i].Suppliers[j].RecID = inventory.Regions[i].Suppliers[j].RecID;																
							}
							
							// Now do supplier warehouses
							for (int k = 1; k &lt;= inventory.Regions[i].Suppliers[j].SupplierWarehouses.Count; k++) {
								if (inventory.Regions[i].Suppliers[j].SupplierWarehouses[k].InsertFlag) {
									mirrorInventory.Regions[i].Suppliers[j].SupplierWarehouses[k].RecID = inventory.Regions[i].Suppliers[j].SupplierWarehouses[k].RecID;
								}
							}
						}												
					}
					
					// Remove any deleted alternate children
					for (int i = 1; i &lt;= inventory.AlternateChildren.DeletedCollection.Count; i++) {
						JiwaFinancials.Jiwa.JiwaInventory.AlternateChild deletedAlternateChild = (JiwaFinancials.Jiwa.JiwaInventory.AlternateChild)inventory.AlternateChildren.DeletedCollection[i];						
						JiwaFinancials.Jiwa.JiwaInventory.AlternateChild mirrorAlternateChild = mirrorInventory.AlternateChildren[deletedAlternateChild.RecID];
						
						if (mirrorAlternateChild != null) {
							mirrorInventory.AlternateChildren.Remove(mirrorAlternateChild);
						}						
					}
					
					// Now set the RecID of the inserted alternate children to be that of the RecID from the source inventory item					
					for (int i = 1; i &lt;= inventory.AlternateChildren.Count; i++) {
						if (inventory.AlternateChildren[i].InsertFlag) {
							mirrorInventory.AlternateChildren[i].RecID = inventory.AlternateChildren[i].RecID;
						}						
					}
					
					// Remove any deleted components
					for (int i = 1; i &lt;= inventory.Components.DeletedCollection.Count; i++) {
						JiwaFinancials.Jiwa.JiwaInventory.Component deletedComponent = (JiwaFinancials.Jiwa.JiwaInventory.Component)inventory.Components.DeletedCollection[i];						
						JiwaFinancials.Jiwa.JiwaInventory.Component mirrorComponent = mirrorInventory.Components[deletedComponent.RecID];
						
						if (mirrorComponent != null) {
							mirrorInventory.Components.Remove(mirrorComponent);
						}						
					}
					
					// Now set the RecID of the inserted components to be that of the RecID from the source inventory item					
					for (int i = 1; i &lt;= inventory.Components.Count; i++) {
						if (inventory.Components[i].InsertFlag) {
							mirrorInventory.Components[i].RecID = inventory.Components[i].RecID;
						}						
					}
					
					// Remove any deleted UpSells
					for (int i = 1; i &lt;= inventory.UpSells.DeletedCollection.Count; i++) {
						JiwaFinancials.Jiwa.JiwaInventory.Upsell deletedUpsell = (JiwaFinancials.Jiwa.JiwaInventory.Upsell)inventory.UpSells.DeletedCollection[i];						
						JiwaFinancials.Jiwa.JiwaInventory.Upsell mirrorUpsell = mirrorInventory.UpSells[deletedUpsell.RecID];
						
						if (mirrorUpsell != null) {
							mirrorInventory.UpSells.Remove(mirrorUpsell);
						}						
					}
					
					// Now set the RecID of the inserted Upsells to be that of the RecID from the source inventory item					
					for (int i = 1; i &lt;= inventory.UpSells.Count; i++) {
						if (inventory.UpSells[i].InsertFlag) {
							mirrorInventory.UpSells[i].RecID = inventory.UpSells[i].RecID;
						}						
					}
					
					mirrorInventory.Save();
				}
				finally {
					JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.LogOff();
				}
			}
			finally {
				JiwaFinancials.Jiwa.JiwaApplication.Session.Instance.SessionID = databaseSessionID;
			}
		}
	}	
	
	public void CreateMissingClassification(JiwaFinancials.Jiwa.JiwaInventory.Inventory Inventory)
	{
		JiwaFinancials.Jiwa.JiwaInventory.Configuration.Classification.Classification classification = JiwaFinancials.Jiwa.JiwaApplication.BusinessLogicFactory.Instance.CreateBusinessLogic&lt;JiwaFinancials.Jiwa.JiwaInventory.Configuration.Classification.Classification&gt;(null);
		try {
			classification.Read(Inventory.Classification.ClassificationID);						
		} 
		catch (JiwaFinancials.Jiwa.JiwaApplication.Exceptions.RecordNotFoundException ex) {
			// Classification does not exist in the mirror database, create it by copying the default and then overriding the ID and description.
			JiwaFinancials.Jiwa.JiwaApplication.Entities.Inventory.Classification defaultClassification = new JiwaFinancials.Jiwa.JiwaApplication.Entities.Inventory.Classification();
			defaultClassification.ReadDefaultRecord();
			
			classification.Read(defaultClassification.ClassificationID);
			classification.Copy();
			classification.RecID = Inventory.Classification.ClassificationID;
			classification.Description = Inventory.Classification.Description;
			classification.IsDefault = Inventory.Classification.IsDefault;
			classification.Save();
		}
	}
	
	public void CreateMissingCategories(JiwaFinancials.Jiwa.JiwaInventory.Inventory Inventory)
	{
		JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Categories categories = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic&lt;JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Categories&gt;(null);
		categories.Read();
		Boolean found;
		
		// Category 1
		found = false;
		foreach (JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category1 category in categories.Category1Collection) {
			if (category.RecID == Inventory.Category1.RecID) {
				found = true;
				break;
			}
		}
		
		if (! found) {
			JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category1 category = new JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category1();						
			category.RecID = Inventory.Category1.RecID;
			category.Description = Inventory.Category1.Description;
			categories.Category1Collection.Add(category);
		}
		
		// Category 2
		found = false;
		foreach (JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category2 category in categories.Category2Collection) {
			if (category.RecID == Inventory.Category2.RecID) {
				found = true;
				break;
			}
		}
		
		if (! found) {
			JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category2 category = new JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category2();						
			category.RecID = Inventory.Category2.RecID;
			category.Description = Inventory.Category2.Description;
			categories.Category2Collection.Add(category);
		}
		
		// Category 3
		found = false;
		foreach (JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category3 category in categories.Category3Collection) {
			if (category.RecID == Inventory.Category3.RecID) {
				found = true;
				break;
			}
		}
		
		if (! found) {
			JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category3 category = new JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category3();						
			category.RecID = Inventory.Category3.RecID;
			category.Description = Inventory.Category3.Description;
			categories.Category3Collection.Add(category);
		}
		
		// Category 4
		found = false;
		foreach (JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category4 category in categories.Category4Collection) {
			if (category.RecID == Inventory.Category4.RecID) {
				found = true;
				break;
			}
		}
		
		if (! found) {
			JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category4 category = new JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category4();						
			category.RecID = Inventory.Category4.RecID;
			category.Description = Inventory.Category4.Description;
			categories.Category4Collection.Add(category);
		}
		
		// Category 5
		found = false;
		foreach (JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category5 category in categories.Category5Collection) {
			if (category.RecID == Inventory.Category5.RecID) {
				found = true;
				break;
			}
		}
		
		if (! found) {
			JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category5 category = new JiwaFinancials.Jiwa.JiwaInventory.Configuration.Category.Category5();						
			category.RecID = Inventory.Category5.RecID;
			category.Description = Inventory.Category5.Description;
			categories.Category5Collection.Add(category);
		}
		
		categories.Save();
	}
	
	public void CreateMissingPriceGroup(JiwaFinancials.Jiwa.JiwaInventory.Inventory Inventory)
	{		
		JiwaFinancials.Jiwa.JiwaInventory.Configuration.PricingGroup.PricingGroupCollection priceGroups = new JiwaFinancials.Jiwa.JiwaInventory.Configuration.PricingGroup.PricingGroupCollection();
		priceGroups.Read();
	
		JiwaFinancials.Jiwa.JiwaInventory.Configuration.PricingGroup.PricingGroup pricingGroup = priceGroups[Inventory.PricingGroup.RecID];
		if (pricingGroup == null) {
			pricingGroup = new JiwaFinancials.Jiwa.JiwaInventory.Configuration.PricingGroup.PricingGroup();
			pricingGroup.RecID = Inventory.PricingGroup.RecID;
			pricingGroup.Description = Inventory.PricingGroup.Description;
			priceGroups.Add(pricingGroup);
			priceGroups.Save();
		}		
	}
	
	public void CreateMissingDebtorClassifications(JiwaFinancials.Jiwa.JiwaInventory.Inventory Inventory)
	{
		JiwaFinancials.Jiwa.JiwaDebtors.Configuration.Classification.Classification debtorClassification = JiwaFinancials.Jiwa.JiwaApplication.BusinessLogicFactory.Instance.CreateBusinessLogic&lt;JiwaFinancials.Jiwa.JiwaDebtors.Configuration.Classification.Classification&gt;(null);
		
		foreach (JiwaFinancials.Jiwa.JiwaInventory.DebtorClassificationInventorySpecific debtorClassPrice in Inventory.DebtorClassPrices) {
			try {
				debtorClassification.Read(debtorClassPrice.DebtorClassification.RecID);
			}
			catch (JiwaFinancials.Jiwa.JiwaApplication.Exceptions.RecordNotFoundException) {
				// Classification does not exist in the mirror database, create it by copying the default and then overriding the ID and description.
				JiwaFinancials.Jiwa.JiwaApplication.Entities.Debtor.Classification defaultClassification = new JiwaFinancials.Jiwa.JiwaApplication.Entities.Debtor.Classification();
				defaultClassification.ReadDefaultRecord();
				
				debtorClassification.Read(defaultClassification.RecID);
				debtorClassification.Copy();
				debtorClassification.RecID = debtorClassPrice.DebtorClassification.RecID;
				debtorClassification.Description = debtorClassPrice.DebtorClassification.Description;
				debtorClassification.Save();
			}
			
		}
	}
	
	public void CreateMissingRegions(JiwaFinancials.Jiwa.JiwaInventory.Inventory Inventory)
	{
		JiwaFinancials.Jiwa.JiwaInventory.Configuration.Regions.Region region = JiwaFinancials.Jiwa.JiwaApplication.BusinessLogicFactory.Instance.CreateBusinessLogic&lt;JiwaFinancials.Jiwa.JiwaInventory.Configuration.Regions.Region&gt;(null);
		
		foreach (JiwaFinancials.Jiwa.JiwaInventory.Region inventoryRegion in Inventory.Regions) {
			try {
				region.Read(inventoryRegion.IN_Region_RecID);
			}
			catch (JiwaFinancials.Jiwa.JiwaApplication.Exceptions.RecordNotFoundException) {
				// region does not exist in the mirror database, create it by copying the default and then overriding the ID and description.
				JiwaFinancials.Jiwa.JiwaApplication.Entities.Region defaultRegion = new JiwaFinancials.Jiwa.JiwaApplication.Entities.Region();
				defaultRegion.ReadDefault();
				
				region.Read(defaultRegion.RecID);
				region.Copy();
				region.RecID = inventoryRegion.IN_Region_RecID;
				region.Name = inventoryRegion.Name;
				region.IsDefault = inventoryRegion.DefaultRegion;
				region.Save();
			}			
		}
	}
	
	public void CreateMissingCreditors(JiwaFinancials.Jiwa.JiwaInventory.Inventory Inventory)
	{
		JiwaFinancials.Jiwa.JiwaCreditors.Creditor creditor = JiwaFinancials.Jiwa.JiwaApplication.BusinessLogicFactory.Instance.CreateBusinessLogic&lt;JiwaFinancials.Jiwa.JiwaCreditors.Creditor&gt;(null);
		
		foreach (JiwaFinancials.Jiwa.JiwaInventory.Region inventoryRegion in Inventory.Regions) {
			foreach (JiwaFinancials.Jiwa.JiwaInventory.Supplier supplier in inventoryRegion.Suppliers) {
				try {
					creditor.Read(supplier.Creditor.CreditorID);
					Boolean found;
					// Add any new warehouses
					foreach (JiwaFinancials.Jiwa.JiwaInventory.SupplierWarehouse supplierWarehouse in supplier.SupplierWarehouses) {
						found = false;
						foreach (JiwaFinancials.Jiwa.JiwaCreditors.WarehouseAddress warehouseAddress in creditor.WarehouseAddresses) {							
							if (warehouseAddress.RecID == supplierWarehouse.Warehouse.WarehouseID) {
								found = true;
								break;
							}
						}
						
						if (! found) {
							JiwaFinancials.Jiwa.JiwaCreditors.WarehouseAddress creditorWarehouse = new JiwaFinancials.Jiwa.JiwaCreditors.WarehouseAddress();
							creditorWarehouse.RecID = supplierWarehouse.Warehouse.WarehouseID;
							creditorWarehouse.Description = supplierWarehouse.Warehouse.Description;
							creditorWarehouse.Address1 = supplierWarehouse.Warehouse.Address1;
							creditorWarehouse.Address2 = supplierWarehouse.Warehouse.Address2;
							creditorWarehouse.Address3 = supplierWarehouse.Warehouse.Address3;
							creditorWarehouse.Address4 = supplierWarehouse.Warehouse.Address4;
							creditorWarehouse.Postcode = supplierWarehouse.Warehouse.PostCode;
							creditorWarehouse.Country = supplierWarehouse.Warehouse.Country;						
							creditorWarehouse.CourierDetails = supplierWarehouse.Warehouse.CourierDetails;
							creditorWarehouse.Notes = supplierWarehouse.Warehouse.Notes;
							
							creditor.WarehouseAddresses.Add(creditorWarehouse);
						}
					}
					
					creditor.Save();
				}
				catch (JiwaFinancials.Jiwa.JiwaApplication.Exceptions.RecordNotFoundException) {
					// create the supplier
					creditor.CreateNew();
					creditor.RecID = supplier.Creditor.CreditorID;
					creditor.AccountNo = supplier.Creditor.AccountNo;
					creditor.Name = supplier.Creditor.Name;
					
					foreach (JiwaFinancials.Jiwa.JiwaInventory.SupplierWarehouse supplierWarehouse in supplier.SupplierWarehouses) {
						JiwaFinancials.Jiwa.JiwaCreditors.WarehouseAddress creditorWarehouse = new JiwaFinancials.Jiwa.JiwaCreditors.WarehouseAddress();
						creditorWarehouse.RecID = supplierWarehouse.Warehouse.WarehouseID;
						creditorWarehouse.Description = supplierWarehouse.Warehouse.Description;
						creditorWarehouse.Address1 = supplierWarehouse.Warehouse.Address1;
						creditorWarehouse.Address2 = supplierWarehouse.Warehouse.Address2;
						creditorWarehouse.Address3 = supplierWarehouse.Warehouse.Address3;
						creditorWarehouse.Address4 = supplierWarehouse.Warehouse.Address4;
						creditorWarehouse.Postcode = supplierWarehouse.Warehouse.PostCode;
						creditorWarehouse.Country = supplierWarehouse.Warehouse.Country;						
						creditorWarehouse.CourierDetails = supplierWarehouse.Warehouse.CourierDetails;
						creditorWarehouse.Notes = supplierWarehouse.Warehouse.Notes;
						
						creditor.WarehouseAddresses.Add(creditorWarehouse);
					}
					
					creditor.Save();
				}
			}
		}
	}
	
}

public class ApplicationManagerPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaApplicationManagerPlugin
{

    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void Setup(JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
    }

}

public class CustomFieldPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaCustomFieldPlugin
{

    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void FormatCell(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaCustomFieldValues HostObject, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
    {
    }

    public void ReadData(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaCustomFieldValues HostObject, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
    {
    }

    public void ButtonClicked(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaCustomFieldValues HostObject, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
    {
    }

}

public class LineCustomFieldPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaLineCustomFieldPlugin
{

    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void FormatCell(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaLineCustomFieldValues HostItem, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
    {
    }

    public void ReadData(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaLineCustomFieldValues HostItem, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
    {
    }

    public void ButtonClicked(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaLineCustomFieldValues HostItem, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
    {
    }

}

public class SystemSettingPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaSystemSettingPlugin
{

    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void FormatCell(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.SystemSettings.Setting SystemSetting)
    {
    }

    public void ReadData(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Row, JiwaFinancials.Jiwa.JiwaApplication.SystemSettings.Setting SystemSetting)
    {
    }

    public void ButtonClicked(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.SystemSettings.Setting SystemSetting)
    {
    }

}

public class ScheduledExecutionPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaScheduledExecutionPlugin
{


    public void Execute(JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin, JiwaFinancials.Jiwa.JiwaApplication.Schedule.Schedule Schedule)
    {
    }


    public void OnServiceStart(JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
    }


    public void OnServiceStopping(JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
    }
}
</Code>
  <ExceptionPolicy>Report</ExceptionPolicy>
  <Language>CSharp</Language>
  <BusinessLogicCollection>
    <BusinessLogic>
      <RecID>739bb56e-929c-4f46-8bfd-b5c926f1b640</RecID>
      <Description>Inventory Maintenance</Description>
      <ClassName>JiwaFinancials.Jiwa.JiwaInventory.Inventory</ClassName>
      <Assembly>JiwaInventory, Version=7.0.118.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</Assembly>
    </BusinessLogic>
  </BusinessLogicCollection>
  <ReferenceCollection>
    <Reference>
      <RecID>b21e4927-83da-4a3a-98dd-01077d4004b3</RecID>
      <AssemblyFullName>JiwaApplication, Version=7.0.118.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaApplication.dll</AssemblyName>
      <AssemblyLocation>C:\JiwaTFS\Jiwa 6\Jiwa\Built Files\JiwaApplication.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>d2c5a9d9-6ba1-4612-ba0d-06a419a466c2</RecID>
      <AssemblyFullName>mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>mscorlib.dll</AssemblyName>
      <AssemblyLocation>C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>bd0791db-b858-4272-89a6-a0616776ce9f</RecID>
      <AssemblyFullName>Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>Microsoft.VisualBasic.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualBasic\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>4982f41e-a9d5-45a1-b6b1-a063904bee82</RecID>
      <AssemblyFullName>System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>303d1b3d-9811-4f5f-91b1-435c2480cc03</RecID>
      <AssemblyFullName>System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Windows.Forms.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>95b26aab-e571-4f4c-90bc-0eb924158b9b</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinToolbars.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinToolbars.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinToolbars.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinToolbars.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>41f23417-5b20-4752-9682-d917843f830b</RecID>
      <AssemblyFullName>Infragistics4.Win.Misc.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.Misc.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.Misc.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.Misc.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>71f17071-c9d3-4433-9bde-4e9be9abe4aa</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinStatusBar.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinStatusBar.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinStatusBar.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinStatusBar.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a8097960-c3c4-4bf6-a08f-5869d4e64878</RecID>
      <AssemblyFullName>Infragistics4.Win.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>6414959f-b426-4e02-aae8-3c411f066c55</RecID>
      <AssemblyFullName>FarPoint.Win.Spread, Version=7.35.20132.1, Culture=neutral, PublicKeyToken=327c3516b1b18457</AssemblyFullName>
      <AssemblyName>FarPoint.Win.Spread.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\FarPoint.Win.Spread\7.35.20132.1__327c3516b1b18457\FarPoint.Win.Spread.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>5d2c25a4-6ab0-4a96-9b25-aeefd28d6fbf</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinTabControl.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinTabControl.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinTabControl.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinTabControl.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9abfc88c-faed-489d-90fb-766fa9043cd0</RecID>
      <AssemblyFullName>System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>System.Drawing.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>100da166-0a1a-4c1a-944f-2c8cd2c72021</RecID>
      <AssemblyFullName>Microsoft.SqlServer.Smo, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91</AssemblyFullName>
      <AssemblyName>Microsoft.SqlServer.Smo.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\Microsoft.SqlServer.Smo\12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Smo.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b8cbd0bc-2bfa-49da-b63a-2ed1e8babee5</RecID>
      <AssemblyFullName>System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Data.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>ce8a796e-2ed7-417e-9c0a-cb6aa8c9a3e9</RecID>
      <AssemblyFullName>JiwaODBC, Version=7.0.118.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaODBC.dll</AssemblyName>
      <AssemblyLocation>C:\JiwaTFS\Jiwa 6\Jiwa\Built Files\JiwaODBC.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>2f6cb80f-c921-498a-b5b6-388a86738a66</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinEditors.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinEditors.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinEditors.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinEditors.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>985eec62-ded8-4532-a4ba-d8d26b4c6187</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinExplorerBar.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinExplorerBar.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinExplorerBar.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinExplorerBar.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>20bba9f1-8bdf-4a58-824a-61b34c76dbb8</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinTree.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinTree.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinTree.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinTree.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>28876c64-6410-4d30-8654-0c99ffd7e5ab</RecID>
      <AssemblyFullName>System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Xml.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>adda8f6e-55f5-4d06-b7ae-10d71e42e035</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinListView.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinListView.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinListView.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinListView.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>0c09d5fc-498c-4b8c-af7a-500148eb03e6</RecID>
      <AssemblyFullName>ActiproSoftware.SyntaxEditor.WinForms, Version=12.1.304.0, Culture=neutral, PublicKeyToken=c27e062d3c1a4763</AssemblyFullName>
      <AssemblyName>ActiproSoftware.SyntaxEditor.WinForms.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\ActiproSoftware.SyntaxEditor.WinForms\12.1.304.0__c27e062d3c1a4763\ActiproSoftware.SyntaxEditor.WinForms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b8ef5114-f16d-4e9d-ad52-2f9620cd96a7</RecID>
      <AssemblyFullName>ZetaHtmlEditControl, Version=1.1.0.3, Culture=neutral, PublicKeyToken=2e2e5ba5da72b6c0</AssemblyFullName>
      <AssemblyName>ZetaHtmlEditControl.dll</AssemblyName>
      <AssemblyLocation>C:\JiwaTFS\Jiwa 6\Jiwa\Built Files\ZetaHtmlEditControl.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>186c9a0b-c344-4098-ba87-c766d68fe02f</RecID>
      <AssemblyFullName>ActiproSoftware.SyntaxEditor.Addons.DotNet.WinForms, Version=12.1.304.0, Culture=neutral, PublicKeyToken=c27e062d3c1a4763</AssemblyFullName>
      <AssemblyName>ActiproSoftware.SyntaxEditor.Addons.DotNet.WinForms.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\ActiproSoftware.SyntaxEditor.Addons.DotNet.WinForms\12.1.304.0__c27e062d3c1a4763\ActiproSoftware.SyntaxEditor.Addons.DotNet.WinForms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>450208b5-03f0-46dd-bada-c5c7a9fa22f4</RecID>
      <AssemblyFullName>CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.CrystalReports.Engine.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\CrystalDecisions.CrystalReports.Engine\13.0.2000.0__692fbea5521e1304\CrystalDecisions.CrystalReports.Engine.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>218aa38f-0097-4e3e-8fc2-91a1689a8550</RecID>
      <AssemblyFullName>CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.Shared.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\CrystalDecisions.Shared\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Shared.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>4c034039-d801-43a6-8ce5-dc8f7bc8df47</RecID>
      <AssemblyFullName>CrystalDecisions.Windows.Forms, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.Windows.Forms.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\CrystalDecisions.Windows.Forms\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Windows.Forms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>91c29e0e-e69f-4e42-9144-70fd120f1d78</RecID>
      <AssemblyFullName>Infragistics4.Win.AppStylistSupport.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.AppStylistSupport.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.AppStylistSupport.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.AppStylistSupport.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>1aff7067-2491-49e8-8562-ba2fb31abd91</RecID>
      <AssemblyFullName>JiwaLib, Version=7.0.118.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaLib.dll</AssemblyName>
      <AssemblyLocation>C:\JiwaTFS\Jiwa 6\Jiwa\Built Files\JiwaLib.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>d0420be5-520b-4a5f-ac8e-5e5a900df87d</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinSchedule.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinSchedule.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinSchedule.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinSchedule.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>7bd15f16-f7d7-404f-8586-9dc99636505f</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinGrid.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinGrid.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinGrid.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinGrid.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>36fc4bdc-7833-4e76-801d-ec7fd68a6bd0</RecID>
      <AssemblyFullName>System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Runtime.Serialization.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b68c189e-0719-41aa-86a6-4079f6540d00</RecID>
      <AssemblyFullName>Infragistics4.Shared.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Shared.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Shared.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Shared.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>cb9a7524-2c54-4466-ac6e-ee5bdab9626f</RecID>
      <AssemblyFullName>Microsoft.SqlServer.ConnectionInfo, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91</AssemblyFullName>
      <AssemblyName>Microsoft.SqlServer.ConnectionInfo.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\Microsoft.SqlServer.ConnectionInfo\12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.ConnectionInfo.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>d2e8c280-1004-4474-9c72-14c2a3f62d30</RecID>
      <AssemblyFullName>mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>mscorlib.dll</AssemblyName>
      <AssemblyLocation>C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>ccc8d010-77a7-4bd4-8520-34fa604389c3</RecID>
      <AssemblyFullName>System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Data.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>ae90730f-cf58-49e0-a222-2c59d7f99ab2</RecID>
      <AssemblyFullName>System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Windows.Forms.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>ee534594-68c2-4544-816c-fbf72d217f9a</RecID>
      <AssemblyFullName>System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>System.Drawing.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>0a2ad575-199a-43f6-b22f-1d24bdcf2bfb</RecID>
      <AssemblyFullName>System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>dc3568b2-9c3d-42fa-b3f1-7d768b2215a4</RecID>
      <AssemblyFullName>System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Core.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>d1921da3-5491-4946-b020-0fef93fe01a5</RecID>
      <AssemblyFullName>Microsoft.SqlServer.Dac, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>Microsoft.SqlServer.Dac.dll</AssemblyName>
      <AssemblyLocation>C:\JiwaTFS\Jiwa 6\Jiwa\Built Files\Microsoft.SqlServer.Dac.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>504bf6c1-e5f5-40b2-a5ed-71c75e2107f8</RecID>
      <AssemblyFullName>JiwaEncryption, Version=7.0.118.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaEncryption.dll</AssemblyName>
      <AssemblyLocation>C:\JiwaTFS\Jiwa 6\Jiwa\Built Files\JiwaEncryption.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>12d8d237-900d-4153-b816-18869aca9af0</RecID>
      <AssemblyFullName>JiwaSendEmail, Version=7.0.118.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaSendEmail.dll</AssemblyName>
      <AssemblyLocation>C:\JiwaTFS\Jiwa 6\Jiwa\Built Files\JiwaSendEmail.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>19329dce-ca42-48f6-88ae-87ab65f34d81</RecID>
      <AssemblyFullName>CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.ReportAppServer.ClientDoc.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.ClientDoc\13.0.2000.0__692fbea5521e1304\CrystalDecisions.ReportAppServer.ClientDoc.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>91363a3a-3298-4f14-b0b3-b6826bfffef5</RecID>
      <AssemblyFullName>CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.ReportAppServer.Controllers.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.Controllers\13.0.2000.0__692fbea5521e1304\CrystalDecisions.ReportAppServer.Controllers.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>dc36d01c-3cea-4ebb-9f60-360f25e9ab84</RecID>
      <AssemblyFullName>CrystalDecisions.ReportAppServer.ReportDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.ReportAppServer.ReportDefModel.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.ReportDefModel\13.0.2000.0__692fbea5521e1304\CrystalDecisions.ReportAppServer.ReportDefModel.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>f41d642c-9fcd-4cc1-ab16-a67a9f7450d2</RecID>
      <AssemblyFullName>FarPoint.Win, Version=7.35.20132.1, Culture=neutral, PublicKeyToken=327c3516b1b18457</AssemblyFullName>
      <AssemblyName>FarPoint.Win.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\FarPoint.Win\7.35.20132.1__327c3516b1b18457\FarPoint.Win.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>1cd3c3df-f0c6-4d90-bc97-8f8bdfb48346</RecID>
      <AssemblyFullName>ActiproSoftware.Shared.WinForms, Version=12.1.304.0, Culture=neutral, PublicKeyToken=c27e062d3c1a4763</AssemblyFullName>
      <AssemblyName>ActiproSoftware.Shared.WinForms.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\ActiproSoftware.Shared.WinForms\12.1.304.0__c27e062d3c1a4763\ActiproSoftware.Shared.WinForms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>5ba3b38c-cc4d-4522-ae6a-1212574d1ea3</RecID>
      <AssemblyFullName>System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>System.Security.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Security\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>11b5d3e2-df12-4cc0-a0ec-f60ec4033a56</RecID>
      <AssemblyFullName>JiwaInventory, Version=7.0.118.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaInventory.dll</AssemblyName>
      <AssemblyLocation>C:\JiwaTFS\Jiwa 6\Jiwa\Built Files\JiwaInventory.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>62ed1a66-8f24-4aa3-b471-e3eaa9811010</RecID>
      <AssemblyFullName>JiwaJournalSets, Version=7.0.118.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaJournalSets.dll</AssemblyName>
      <AssemblyLocation>C:\JiwaTFS\Jiwa 6\Jiwa\Built Files\JiwaJournalSets.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>eea74ed5-f780-4215-b8a9-024a6835bf3f</RecID>
      <AssemblyFullName>LumenWorks.Framework.IO, Version=7.0.118.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>LumenWorks.Framework.IO.dll</AssemblyName>
      <AssemblyLocation>C:\JiwaTFS\Jiwa 6\Jiwa\Built Files\LumenWorks.Framework.IO.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>54c7c381-a950-443d-81b8-6fc5529d4adc</RecID>
      <AssemblyFullName>JiwaDebtors, Version=7.0.118.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaDebtors.dll</AssemblyName>
      <AssemblyLocation>C:\JiwaTFS\Jiwa 6\Jiwa\Built Files\JiwaDebtors.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>8ed820b3-a437-4501-b69c-980a58ba90d6</RecID>
      <AssemblyFullName>JiwaCreditors, Version=7.0.118.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaCreditors.dll</AssemblyName>
      <AssemblyLocation>C:\JiwaTFS\Jiwa 6\Jiwa\Built Files\JiwaCreditors.dll</AssemblyLocation>
    </Reference>
  </ReferenceCollection>
  <SystemSettingCollection>
    <SystemSetting>
      <RecID>a652ff0c624040e8b783</RecID>
      <IDKey>MirrorDatabaseName</IDKey>
      <Description>The name of the database to mirror inventory items to</Description>
      <DisplayOrder>1</DisplayOrder>
      <CellType>Text</CellType>
      <Contents>JiwaDemoMirror</Contents>
      <DisplayContents>JiwaDemoMirror</DisplayContents>
    </SystemSetting>
    <SystemSetting>
      <RecID>c9045dbb3ea44ef4b8cb</RecID>
      <IDKey>MirrorDatabaseUser</IDKey>
      <Description>The Jiwa username to use in the mirror database</Description>
      <DisplayOrder>2</DisplayOrder>
      <CellType>Text</CellType>
      <Contents>Admin</Contents>
      <DisplayContents>Admin</DisplayContents>
    </SystemSetting>
    <SystemSetting>
      <RecID>03d2a1b7899c4a38b742</RecID>
      <IDKey>MirrorDatabasePassword</IDKey>
      <Description>The Jiwa password to use in the mirror database</Description>
      <DisplayOrder>3</DisplayOrder>
      <CellType>Text</CellType>
      <Contents>password</Contents>
      <DisplayContents>password</DisplayContents>
    </SystemSetting>
  </SystemSettingCollection>
</JiwaDocument>