SBarnes wrote:Is there any way or an event for debtor import screen or inventory import screen to be able to through plugin code to pre-process the fields so say for example someone has accidently formatted say RRP as $699.00 so that you can change it into 699.00?
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic JiwaBusinessLogic, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
if (JiwaBusinessLogic is JiwaFinancials.Jiwa.JiwaInventory.Import.InventoryImport)
{
JiwaFinancials.Jiwa.JiwaInventory.Import.InventoryImport inventoryImport = (JiwaFinancials.Jiwa.JiwaInventory.Import.InventoryImport)JiwaBusinessLogic;
inventoryImport.DestinationProperties.ReadEnd += DestinationProperties_ReadEnd; // We need to re-add our destination property if the collection is ever re-read.
}
}
private void DestinationProperties_ReadEnd(object sender, System.EventArgs e)
{
JiwaFinancials.Jiwa.JiwaInventory.Import.DestinationPropertyCollection destinationPropertyCollection = (JiwaFinancials.Jiwa.JiwaInventory.Import.DestinationPropertyCollection)sender;
destinationPropertyCollection["Inventory.RRPPrice"].SetterMethod = delegate(JiwaFinancials.Jiwa.JiwaInventory.Inventory inventory, string value, string rowData, string[] row, int rowNo, JiwaFinancials.Jiwa.JiwaInventory.Import.Mapping
mapping)
{
inventory.RRPPrice = decimal.Parse(value.Replace("$", ""));
};
}
Return to Technical and or Programming
Users browsing this forum: No registered users and 5 guests