Import Items/Product Part II

//INVENTTABLE—————————————————————————————-
_invTable.clear();
_invTable.BOMUnitId = ‘pc’;
if(conPeek(readCon, 4) == ‘No’)
{
_invTable.CostModel = 0;
}
else
{
_invTable.CostModel = 1;
}
if(conPeek(readCon, 5) == ‘No’)
{
_invTable.PurchModel = 0;
}
else
{
_invTable.PurchModel = 1;
}
_invTable.SalesModel = conPeek(readCon, 6);

_invTable.ItemId = conPeek(readCon, 1);
_invTable.ItemType = ItemType::Item;
_invTable.NameAlias = conPeek(readCon, 2);
_invTable.Product = _productID;

_invTable.SalesPercentMarkup = conPeek(readCon, 7);
_invTable.SalesPriceModelBasic = conPeek(readCon, 8);
_invTable.PmfProductType = conPeek(readCon, 9);
_invTable.PdsVendorCheckItem = PdsVendorCheckItem::NotAllowed;

_invTable.DefaultDimension = Dimensions::createDefaultDimensionString(_dimensionColumnValue, _dimensionColumnName);
_invTable.insert();
//END HERE

 

//ECORESSTORAGEDIMENSIONGROUPITEM—————————————————————————————-
_ecoResTrackDimGrpItem.clear();
_ecoResTrackDimGrpItem.ItemDataAreaId = ‘unim’;
_ecoResTrackDimGrpItem.ItemId = conPeek(readCon, 1);
_ecoResTrackDimGrpItem.TrackingDimensionGroup = EcoResTrackingDimensionGroup::findByDimensionGroupName(conPeek(readCon, 10)).RecId;
_ecoResTrackDimGrpItem.insert();
//END HERE

//ECORESTRACKINGDIMENSIONGROUPITEM—————————————————————————————-
_ecoResStrDimGrpItem.clear();
_ecoResStrDimGrpItem.ItemDataAreaId = ‘unim’;
_ecoResStrDimGrpItem.ItemId = conPeek(readCon, 1);
_ecoResStrDimGrpItem.StorageDimensionGroup = EcoResStorageDimensionGroup::findByDimensionGroupName(conPeek(readCon, 11)).RecId;
_ecoResStrDimGrpItem.insert();
//END HERE

//INVENTMODELGROUPITEM—————————————————————————————-
_invModelGrpItem.clear();
_invModelGrpItem.ItemDataAreaId = ‘unim’;
_invModelGrpItem.ItemId = conPeek(readCon, 1);
_invModelGrpItem.ModelGroupDataAreaId = ‘unim’;
_invModelGrpItem.ModelGroupId = conPeek(readCon, 12);
_invModelGrpItem.doInsert();
//END HERE

//INVENTITEMGROUPITEM—————————————————————————————-
_invItmGrpItem.clear();
_invItmGrpItem.ItemDataAreaId = ‘unim’;
_invItmGrpItem.ItemGroupDataAreaId = ‘unim’;
_invItmGrpItem.ItemGroupId = conPeek(readCon, 13);
_invItmGrpItem.ItemId = conPeek(readCon, 1);
_invItmGrpItem.doInsert();
//END HERE

//INVENTMODELGROUP—————————————————————————————-
_invTableModule.clear();
_invTableModule.EndDisc = NoYes::Yes;
_invTableModule.ItemId = conPeek(readCon, 1);
_invTableModule.ModuleType = ModuleInventPurchSales::Invent;
_invTableModule.UnitId = ‘pc’;
_invTableModule.Price = conPeek(readCon, 14);
_invTableModule.doInsert();

_invTableModule.clear();
_invTableModule.EndDisc = NoYes::Yes;
_invTableModule.ItemId = conPeek(readCon, 1);
_invTableModule.ModuleType = ModuleInventPurchSales::Purch;
_invTableModule.Price = conPeek(readCon, 15);
_invTableModule.UnitId = ‘pc’;
_invTableModule.doInsert();

_invTableModule.clear();
_invTableModule.EndDisc = NoYes::Yes;
_invTableModule.ItemId = conPeek(readCon, 1);
_invTableModule.ModuleType = ModuleInventPurchSales::Sales;
_invTableModule.Price = conPeek(readCon, 16);
_invTableModule.UnitId = ‘pc’;
_invTableModule.doInsert();
//END HERE

//ECORESPRODUCTCATEGORY——————————————————————————————————
_catCode = conPeek(readcon, 17);
_ecoResPrdCat.clear();
_ecoResPrdCat.Category = EcoResCategory::findByCode(_catcode,5637144576).RecId;
_ecoResPrdCat.Product = _productID;
_ecoResPrdCat.CategoryHierarchy = 5637144576; //MAIN
_ecoResPrdCat.doInsert();
//END HERE

//INVENTITEMLOCATION—————-
_invItemLocation.clear();
_invItemLocation.ItemId = conPeek(readCon, 1);
_invItemLocation.inventDimId = ‘AllBlank’;
_invItemLocation.insert();

//END HERE

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s