summaryrefslogtreecommitdiff
path: root/import
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-31 10:06:48 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-31 10:06:48 +0100
commitcef2bbde0cbaa042a545f432865de11e0bc51d03 (patch)
tree53315ea10db725ec3b99ca31c7c016b0b60f89f6 /import
parent693acd68d2dcdbfd700a3aab6c49251552cc9be0 (diff)
downloadstock-cef2bbde0cbaa042a545f432865de11e0bc51d03.tar.gz
stock-cef2bbde0cbaa042a545f432865de11e0bc51d03.tar.bz2
stock-cef2bbde0cbaa042a545f432865de11e0bc51d03.zip
Remove stock_component table — use liberty_content directly
stock_component was a pure alias (component_id ↔ content_id with no other data). All queries now target liberty_content WHERE content_type_guid = STOCKCOMPONENT_CONTENT_TYPE_GUID directly. - StockComponent: drop mComponentId, constructor takes content_id only - All component_id URL params changed to content_id - Import files, edit_movement, sitemap updated to match - BOM xref templates updated (xref column migrated from component_id to content_id in live DB — 130 rows) - StockAssembly loadXrefList/enrichXrefDisplay join liberty_content directly; loadComponents drops stock_component LEFT JOIN - StockBase: previous/next keys renamed to _content_id stock_component table left in schema_inc.php pending DB reset. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'import')
-rw-r--r--import/ImportAssembly.php9
-rw-r--r--import/ImportSimpleComponent.php14
-rw-r--r--import/data/CANPANStockList.csv33
-rw-r--r--import/data/CANSOLStockList.csv41
-rw-r--r--import/data/KitlockerAssemblies.csv272
-rw-r--r--import/data/KitlockerGroups.csv29
-rw-r--r--import/data/assembly_components.csv59
-rw-r--r--import/data/simple_assemblies.csv7
-rw-r--r--import/data/simple_components.csv82
-rw-r--r--import/data/simple_components_2.csv82
-rw-r--r--import/data/stock.csv57
-rw-r--r--import/load_stock.php7
12 files changed, 674 insertions, 18 deletions
diff --git a/import/ImportAssembly.php b/import/ImportAssembly.php
index 44b63f3..001dd8c 100644
--- a/import/ImportAssembly.php
+++ b/import/ImportAssembly.php
@@ -4,7 +4,7 @@
*
* CSV column layout (0-based):
* 0 assembly_title Kit / assembly name
- * 1 component_title Component name (must already exist in stock_component)
+ * 1 component_title Component name (must already exist as a stockcomponent content item)
* 2 quantity_value Numeric quantity in BOM (optional, default 1)
* 3 quantity_item SGL / PCK / SHT / VOL (optional, default SGL)
* 4 item_position Float position (e.g. 1.1, 1.2, 2.1) (optional)
@@ -85,10 +85,9 @@ function StockAssemblyBatchLoad( string $assemblyTitle, array $pRows ): array {
function _stockImportFindComponent( string $title ): ?int {
global $gBitDb;
$contentId = $gBitDb->getOne(
- "SELECT fi.`content_id`
- FROM `".BIT_DB_PREFIX."stock_component` fi
- INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON lc.`content_id` = fi.`content_id`
- WHERE lc.`title` = ?",
+ "SELECT lc.`content_id`
+ FROM `".BIT_DB_PREFIX."liberty_content` lc
+ WHERE lc.`content_type_guid` = '".STOCKCOMPONENT_CONTENT_TYPE_GUID."' AND lc.`title` = ?",
[ $title ]
);
return $contentId ? (int)$contentId : null;
diff --git a/import/ImportSimpleComponent.php b/import/ImportSimpleComponent.php
index 1ce0dd0..778df85 100644
--- a/import/ImportSimpleComponent.php
+++ b/import/ImportSimpleComponent.php
@@ -46,18 +46,15 @@ function stockExpungeComponentByTitle( string $title ): bool {
$contentId = $gBitDb->getOne(
"SELECT lc.`content_id`
- FROM `".BIT_DB_PREFIX."stock_component` sc
- INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON lc.`content_id` = sc.`content_id`
- WHERE lc.`title` = ?",
+ FROM `".BIT_DB_PREFIX."liberty_content` lc
+ WHERE lc.`content_type_guid` = '".STOCKCOMPONENT_CONTENT_TYPE_GUID."' AND lc.`title` = ?",
[ $title ]
);
if( !$contentId ) {
return false;
}
- // StockComponent::expunge() handles component_map + stock_component;
- // LibertyContent::expunge() now handles liberty_xref + liberty_content
- $component = new StockComponent( null, (int)$contentId );
+ $component = new StockComponent( (int)$contentId );
$component->expunge();
return true;
}
@@ -76,9 +73,8 @@ function stockImportSimpleComponent( array $data, int $rowNum ): array {
$exists = $gBitDb->getOne(
"SELECT lc.`content_id`
- FROM `".BIT_DB_PREFIX."stock_component` sc
- INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON lc.`content_id` = sc.`content_id`
- WHERE lc.`title` = ?",
+ FROM `".BIT_DB_PREFIX."liberty_content` lc
+ WHERE lc.`content_type_guid` = '".STOCKCOMPONENT_CONTENT_TYPE_GUID."' AND lc.`title` = ?",
[ $title ]
);
if( $exists ) {
diff --git a/import/data/CANPANStockList.csv b/import/data/CANPANStockList.csv
new file mode 100644
index 0000000..cd11a75
--- /dev/null
+++ b/import/data/CANPANStockList.csv
@@ -0,0 +1,33 @@
+"ITEM","XORDER","XREF","XKEY","XKET_EXT","DATA"
+"SGL",1001,"ResCF-10kRQW",2,"R2, R5",
+"SGL",1002,"ResCF-1k8RQW",3,"R3, R4, R6",
+"SGL",1003,"ResCF-100kRQW",1,"R1",
+"SGL",1004,"ResNet-10k4+C",1,"RR1",
+"SGL",2001,"1N4001",1,"D1",
+"SGL",2002,"1N4148",32,"For switch isolation",
+"SGL",2003,"LED-3mmYLC",1,"LD1",
+"SGL",2004,"LED-3mmGLC",1,"LD2",
+"SGL",3001,"CapRE-100u/25V",1,"C1",
+"SGL",3002,"CapTB-10u/16V",1,"C4",
+"SGL",3003,"CapTB-4.7u/16V",1,"C2",
+"SGL",3004,"CapRC-100n/50V2.5",4,"C3, C5, C6, C7",
+"SGL",4001,"FDV304P",4,"Q1 - Q4",
+"SGL",4002,"MCP2551-I/P",1,"U1",
+"SGL",4003,"PIC18F26K80-I/SP",1,"U4",
+"SGL",4003,"CD74HC238E",1,"U2",
+"SGL",4005,"TLC5917N",1,"U5",
+"SGL",5001,"R-78E5.0-0.5",1,"U3",
+"SGL",5002,"RzPC-4M",1,"X1",
+"SGL",5003,"SWTact-4.3mm",1,"S1",
+"PCK",5004,"SRH-p1-36",6,"J2",
+"SGL",5005,"TB-3.5-2",2,"J1",
+"SGL",5006,"Sock-SPCB-D25",1,"J3",
+"SGL",5007,"Plug-SL-D25",1,"(J3)",
+"SGL",5008,"BoxH-p1-2x13",1,"J4",
+"SGL",6001,"SocDIL-28",1,"(U4)",
+"SGL",6002,"SocDIL-16",2,"(U2), (U5)",
+"SGL",6003,"SocDIL-8",1,"(U1)",
+"SGL",7001,"CANPAN PCB",1,,
+"SGL",8001,"BagSS-75x85",3,,
+"SGL",8002,"BagSS-140x140",1,,
+"SHT",8003,"ASFoam","65x35",,
diff --git a/import/data/CANSOLStockList.csv b/import/data/CANSOLStockList.csv
new file mode 100644
index 0000000..c879b5b
--- /dev/null
+++ b/import/data/CANSOLStockList.csv
@@ -0,0 +1,41 @@
+"ITEM","XORDER","XREF","XKEY","XKET_EXT","DATA"
+"SGL",1001,"ResCF-10kRQW",4,"R1, R2, R3, R7",
+"SGL",1002,"ResCF-1k8RQW",3,"R4, R5, R12",
+"SGL",1003,"ResCF-2k2RQW",1,"R9",
+"SGL",1004,"ResWW-4R7/0.5W",1,"R6",
+"SGL",1005,"ResWW-1R2/0.5W",1,"R8",
+"SGL",1006,"ResWW-0R1/3W",1,"R11",
+"SGL",3007,"1N4002",10,"D1 - D10",
+"SGL",1007,"UF4002",2,"D11, D12",
+"SGL",1008,"1N4148",2,"D13, D14",
+"SGL",3004,"LED-3mmYLC",1,"LD1",
+"SGL",3005,"LED-3mmGLC",1,"LD2",
+"SGL",3006,"LED-3mmRLC",1,"LD3",
+"SGL",3001,"CapRE-2200u/35V",1,"C3",
+"SGL",3002,"CapRE-470u/35V",1,"C6",
+"SGL",3003,"CapRE-220u/25V",1,"C1",
+"SGL",1009,"CapTB-10u/16V",1,"C8",
+"SGL",1011,"CapTB-4.7u/16V",3,"C2, C4, C5",
+"SGL",1012,"CapRC-100n/50V2.5",1,"C7",
+"SGL",1013,"CapRC-22p/100V2.5",2,"C9, C10",
+"SGL",2001,"STP55NF06L",8,"Q1 - Q8",
+"SGL",1014,"ZTX1149A",1,"Q9",
+"SGL",1015,"2N4401",1,"Q10",
+"SGL",4001,"MCP2562-I/P",1,"U1",
+"SGL",3016,"L7805CV",1,"U2",
+"SGL",4002,"PIC18F26K80-I/SP",1,"U3",
+"SGL",4003,"MIC4426",1,"U4",
+"SGL",3008,"SWTact-4.3mm",1,"S1",
+"SGL",4004,"SWDIL-6w",1,"DIP1",
+"PCK",3009,"SRH-p1-36",6,"J2",
+"SGL",3011,"TBSE-10A-3.5-4",1,"J1",
+"SGL",3012,"TBPL-10A-3.5-4",1,"J1",
+"SGL",3013,"TBSE-10A-3.5-3",4,"J3-J6",
+"SGL",3014,"TBPL-10A-3.5-3",4,"J3-J6",
+"SGL",3015,"Xyl-4MLP",1,"X1",
+"SGL",5001,"CANSOL PCB",1,,
+"SGL",6001,"BagSS-55x75",2,,
+"SGL",6002,"BagSS-100x140",1,,
+"SHT",4007,"ASFoam","65x35",,
+"SGL",4005,"SocDIL-28",1,"(U3)",
+"SGL",4006,"SocDIL-8",2,"(U1), (U4)",
diff --git a/import/data/KitlockerAssemblies.csv b/import/data/KitlockerAssemblies.csv
new file mode 100644
index 0000000..395e736
--- /dev/null
+++ b/import/data/KitlockerAssemblies.csv
@@ -0,0 +1,272 @@
+"Title","Description","SGL","KL3M","Group"
+"36A","SD3 - Colour Light Signal Driver",0,0,1
+"37a","PD3-1000 Dual Capacitor-assisted Turnout Motor Driver",6,2,1
+"37b","PD3-2200 Dual Capacitor-assisted Turnout Motor Driver",7,6,1
+49,"12VDC CDU Solenoid Driver",8,9,1
+60,"5V DC Adaptor Kit",25,8,1
+61,"Gas Lamp Twinkler",16,12,1
+68,"2ch DC or DCC diode drop Block Detector (Train-on-Track-Indicator, ToTi-2)",15,14,1
+69,"±5V Dual Power Supply Regulator kit for ToTI Kits",14,11,1
+"72A","Dual Hector, Infra-red train detector kit ",24,11,1
+"72B","Hector Double Sensor Head kit",13,0,1
+"75A","Servo4-G",45,66,1
+"76B","ServoSet2, Setting box for kit 75, Servo4",0,9,1
+77,"Servo1 Single Servo Driver",17,24,1
+"77R","Servo1R Single Servo Driver with Relay",37,12,1
+"77RM","Servo1R Servo Driver 5 Multipack",11,2,1
+"77S","Setting Box for kits 77 & 77R",21,7,1
+79,"Turntable Controller (Stepper Motor)",2,6,1
+"79C","Turntable Control Pack",9,5,1
+470,"Dapol Signal Conversion Kit",17,8,1
+"59A","DCC Booster Kit NB2",3,24,2
+57,"DCC District Cutout",42,43,2
+52,"DCC Accessory Decoder (pulsed outputs)",16,2,2
+"53A","DCC Accessory Decoder (steady state output for constant drive turnouts, eg Tortoises) 4-channel Bipolar",16,20,2
+50,"2ch DCC only Current Transformer Block Detector, DTC2",42,119,2
+"56A","8ch DCC only Current Transformer Block Detector, DTC8",30,65,2
+175,"Frog Polarity Switch (FPS)",28,152,2
+177,"DCC Single Servo Decoder",0,0,2
+110,"Arduino CAN Shield",3,13,3
+793,"26SWG Solder",48,30,4
+794,"Bending Jig",47,17,4
+795,"Track/PCB Cleaner block",19,10,4
+799,"Measure of Patience",0,0,4
+"7921E","CANCAB2 Rotary Encoder for Kit 92E",5,5,5
+673,"CAB Holder",24,18,5
+721,"BT 47W/6H PCB Relay (12v 960 ohms)",0,0,5
+"472A","Telescope Ferrule for Dual Hector",29,4,5
+676,"Uses CBUS Label",170,4,5
+677,"CBUS Free Zone Label",41,0,5
+"678A","RJ22 Twin Faceplate",234,18,5
+"679A","MERG Publicity Label",110,11,5
+"93AH","CAB Plug-in Point with horizontal RJ22 sockets",21,25,5
+"93AV","CAB Plug-in Point with vertical RJ22 sockets",17,32,5
+498,"Voltage Detector Dongle Kit for CBUS",85,47,5
+"498F","Voltage Detector Dongle Kit inc with K80 CBUS PIC",66,97,5
+625,"4-way Pluggable Connectors : 5 Pack",65,25,5
+"764A","Label fascia for CANCAB2 Handset Kit 92P/E",9,0,5
+7919,"Spacer/Bracket sprue for CANCAB2",7,3,5
+6920,"Tactile Switch for CANCAB",1,55,5
+6921,"Button Cap for CANCAB - Ivory",31,21,5
+6922,"Button Cap for CANCAB - Black",20,7,5
+6923,"Button Cap for CANCAB - Yellow",44,2,5
+6924,"Button Cap for CANCAB - Red",27,2,5
+6925,"Button Cap for CANCAB - Green",48,0,5
+6926,"Button Cap for CANCAB - Blue",45,1,5
+7921,"100k Speed Pot for CANCAB",6,4,5
+7999,"Warranty Spares",19,2,5
+758,"FDV304P SMD CBUS Transistors (4)",11,0,5
+788,"MCP23017 Expander IC for EzyBus Input Module",0,8,6
+781,"TBD62083APG MOSFET Driver",18,4,6
+783,"L6388E Half Bridge MOSFET Driver",7,0,6
+784,"CD74HC238 Decoder/Multiplexer",22,32,6
+785,"TLC5917N LED Driver",15,25,6
+786,"MCP2561FD CAN Transceiver",14,3,6
+787,"MIC4426YN MOSFET Driver",1,4,6
+"775P-OUT","ATMEGA328P-PU",9,13,6
+"724P","EzyBus Controller Microprocessor",10,5,6
+755,"MCP2551-I/P CAN Transceiver",29,7,6
+756,"MCP2562-E/P CAN Transceiver",25,31,6
+759,"MCP2515-I/P",0,5,6
+798,"MCP111",0,0,6
+9152,"Layout Power Distribution PCB",17,13,7
+960,"PCB for Unversal PSU",4,3,7
+150,"RJ45 4-way Interconnector",0,0,7
+9461,"PCB for SMD Gas Lamp Twinkler",4,0,7
+9151,"LCB Connector Board PCB",18,14,7
+9470,"PCB for Dapol Signal Conversion",6,0,7
+921,"U-RLY Universal Relay Mounting PCB",80,77,7
+"922a","EzyBus Output PCB rev2",4,5,7
+923,"EzyBus Input PCB rev 3",7,0,7
+924,"EzyBus Controller PCB",4,0,7
+936,"SD2 Signal Driver PCB",4,5,7
+"936A","SD3 Signal Driver PCB",8,0,7
+937,"PD3 Point Driver PCB",0,0,7
+9145,"ATC2-CORE PCB",4,0,7
+"9145P","ATC2-CORE-PANEL PCB",5,0,7
+9146,"ATC2-ENDS and PROFILES PCB",7,0,7
+"9147P","ATC2-PROFILES-PANEL PCB",3,0,7
+9148,"ATC2-MPS PCB",4,0,7
+949,"12V CDU PCB",5,0,7
+961,"Gas Lamp Twinkler PCB (TH)",2,2,7
+968,"PCB for 2Ch ToTI Kit 68",4,5,7
+969,"PCB for Split PSU Kit 69",2,0,7
+"972A","Dual Hector PCB",16,0,7
+"975G","Servo4G Rev1 PCB",10,0,7
+"976B","ServoSet2 PCB",4,0,7
+977,"Servo1 PCB",25,0,7
+"977R","Servo1R PCB",21,0,7
+979,"Stepper Motor Turntable Controller PCB",0,0,7
+9436,"PCB for SD2-SMD",10,0,7
+"750SMP","Programmed PIC12F683 for Servo1",30,0,8
+404,"PTP-Lite HV Backplane Kit - SMD",0,0,8
+409,"PTP-Lite Address Setter Kit - SMD",0,0,8
+901.4,"TM4 CANLED Test Module PCB",31,1,8
+980,"CANUSB USB I/F PCB",6,0,8
+771,"5V 5A DC Power Supply",5,1,9
+772,"12V 5A DC Power Supply",35,39,9
+773,"15V 3A DC Power Supply",34,19,9
+774,"15V 6A DC Power Supply",12,6,9
+"774P","C5 (Clover Leaf) Power Lead",2,9,9
+776,"18V 3.6A DC Power Supply",2,0,9
+779,"DC Socket CLB-JL53",1483,18,9
+780,"C7 PSU Power Cable",10,36,9
+911,"PCB CAN.FLIM.IO-E",3,11,10
+912,"PCB CAN.FLIM.IO-O",6,5,10
+914,"PCB CAN.FLIM.IO-F",14,0,10
+928,"CANOUT PCB",8,5,10
+929,"CANINP PCB",10,0,10
+"980A","CANUSB4 I/F PCB",4,2,10
+"993A","CANCAB Plug Point Dual PCB",7,3,10
+"993S","CANCAB Plug Point Single PCB",30,4,10
+"994A","CANSOL 94A Rev 5 PCB",0,5,10
+997,"CANPAN Mimic Panel Interface PCB",6,0,10
+"998B","CANMIO Rev K PCB",11,6,10
+9110,"PCB for Arduino CAN Shield",4,1,10
+9111,"CAN-Pico02_2515 PCB",0,5,10
+9112,"Pico MEZZ01 PCB",12,1,10
+"9193A","CANACTOUT RJ22 PCB RevC",5,1,10
+9391,"MioADD PCB",12,13,10
+9392,"MioADDSVO PCB",8,2,10
+436,"SD2 Colour Light Signal Driver SMD",14,8,11
+461,"Gas Lamp Twinkler SMD",15,12,11
+681,"Point Motor - Micro-Servo Mount",60,66,12
+682,"Point Motor - Horizontal Kit",41,17,12
+683,"Microswitch Pack",41,28,12
+684,"Single Arm Semaphore Mount",0,33,12
+685,"Double Arm Semaphore Mount",14,6,12
+686,"Quad Arm Semaphore Mount",13,0,12
+687,"Removable Mount for Semaphore Mounts",10,0,12
+688,"Magnet Pack for Demountable Kit",15,10,12
+689,"Colour Light Signal Mount Kit",8,4,12
+690,"Level Crossing Gate Servo Mount",16,0,12
+"690A","Level Crossing Gate Servo Mount",9,23,12
+802,"PMP2 - LDR Train Detector",66,41,13
+803,"PMP3 - Servo Tester/Controller",21,14,13
+805,"PMP5 - Logic Probe",11,1,13
+806,"PMP6 - 12V Supply",18,3,13
+808,"PMP8 - Multi Purpose Flasher V2",48,22,13
+809,"PMP9 - 4-way Traffic Lights",26,9,13
+811,"PMP11 - LED Dimmer",17,2,13
+812,"PMP12 - Random Lights",44,29,13
+813,"PMP13 - Lighthouse Simulator",23,2,13
+814,"PMP14 - Decoder Test Rig",3,10,13
+816,"PMP16 - Turnout Position Sensor",20,7,13
+817,"PMP17 - Automatic Signals",35,32,13
+819,"PMP19 - Automatic Coach Lighting",14,4,13
+820,"PMP20 - Versatile Timer",30,19,13
+821,"PMP21 - Dual LED Flasher",41,21,13
+823,"PMP23 - DCC Reverse Loop Controller",38,1,13
+824,"PMP24 - Arc Flash Generator",43,17,13
+825,"PMP25 - Steam Sound Emulator",32,2,13
+826,"PMP26 - Event Sequencer",12,10,13
+827,"PMP27 - Button Operated Servos",34,1,13
+899,"PMP99 - Hall Effect Sensor Pack",19,5,13
+950,"DTC2 DCC Block Detector PCB",10,10,14
+952,"DCC Accessory Decoder (P) PCB",0,0,14
+"953A","DCC Accessory Decoder (S/S) PCB",5,4,14
+"956A","DTC8 DCC Block Detector PCB",1,8,14
+957,"DCO DCC District Cutout PCB",28,0,14
+"959A","NB2 DCC Booster PCB",7,0,14
+"991B","CANCMDB Command Station PCB",7,2,14
+"992P","CANCAB2 DCC Handset PCB",11,2,14
+9175,"Frog Polarity Switch (FPS) PCB",0,12,14
+741,"PIC12F675-I/P Microcontroller",3,0,15
+"741P","Programmed PIC12F675 Microcontroller",0,6,15
+760,"PIC16F1847",0,0,15
+"742P","PIC12F1840-I/SP Preprogrammed For Kit 77",22,3,15
+743,"PIC16F18313-I/P",11,9,15
+"743P","PIC16F18313-I/P Preprogrammed For Kit 77R",10,0,15
+540,"PIC16F628A Microcontroller",3,0,15
+"540P","Programmed PIC16F628A Microcontroller",20,8,15
+751,"PIC16F630 Microcontroller Blank",28,0,15
+"751P","PIC16F630 Microcontroller Programmed",20,6,15
+752,"PIC16F676 Microcontroller",6,0,15
+"752P","Programmed PIC16F676 Microcontroller",0,0,15
+753,"Blank 16F1503 Microcontroller",27,0,15
+"753P","Programmed 16F1503 Microcontroller for Dual Hector",27,3,15
+745,"Programmed 16F883 Microcontroller for ATC1 ",14,0,15
+754,"PIC18F2480 Microcontroller",5,0,15
+"754P","Programmed PIC18F2480 Microcontroller",20,2,15
+"756P","Programmed 18F2580 Microcontroller for CANCMD",18,2,15
+767,"Preprogrammed PIC18F14K50 for CANUSB4",3,4,15
+761,"PIC18F2420 Microcontroller",4,0,15
+"761P","Programmed PIC18F2420 Microcontroller for TTSM",7,1,15
+766,"PIC18F25K80 Microcontroller",0,0,15
+"766P","Programmed PIC18F25K80 Microcontroller",0,0,15
+768,"PIC18F26K80 Microcontroller",8,16,15
+"768P","Programmed PIC18F26K80 Microcontroller",0,9,15
+769,"PIC18F27Q83 MIcrocontroller",5,11,15
+"769P","PIC18F27Q83",4,6,15
+775,"ATMEGAGA328P-PU Microcontroller",0,0,15
+757,"PIC18F13K22-I/P",8,1,15
+11,"CANVOUT",18,22,16
+12,"CANVINP",25,11,16
+13,"CANVSERVO",35,47,16
+14,"CANV4BIP",18,6,16
+15,"CANV8BIP",0,0,16
+16,"CANV4SOL",0,0,16
+97,"CANPAN Mimic Panel Interface",19,28,16
+"98A","CANMIO Multi-Input-Output Module",0,0,16
+"98B","CANMIO-UNIVERSAL",27,32,16
+391,"MioADD",21,16,16
+392,"MioADDSVO",8,3,16
+193,"CANACTOUT RJ22 connector and CBUS Monitor",20,14,17
+90,"CBUS Message Activity Monitor (CANACT)",23,11,17
+492,"CANGIZMO. (CBUS Test Module.)",19,12,17
+491,"LCB Switch and LED test Boards",21,11,17
+493,"Bipolar pluggable LCB test Board",5,1,17
+497,"CANTM7 Test Module Kit",17,8,17
+990,"CANACT PCB",10,0,18
+"9491a","Pluggable Switch LCB test Board PCB",7,5,18
+"9491b","Pluggable LED LCB test Board PCB",7,5,18
+9492,"CANGIZMO PCB",8,0,18
+9493,"Bipolar pluggable LCB test Board PCB",3,0,18
+9497,"TM7 CANPAN Test Module PCB",5,2,18
+9801,"PCB for PMK1",24,13,19
+9804,"PCB for PMK4",16,5,19
+"9804A","PCB for PMK4A",5,3,19
+9807,"PCB for PMK7",19,10,19
+9810,"PCB for PMK10",26,2,19
+9815,"PCB for PMK15",26,0,19
+9818,"PCB for PMK18",19,0,19
+9822,"PCB for PMK22",3,0,19
+"101A","Beginners Kit 101A",8,7,20
+"102B","Beginners Kit 102B",4,9,20
+"101S","CBUS Beginner Pack A Subkit",12,0,20
+"102S","CBUS Beginner Pack B Subkit",9,0,20
+4801,"PMK1 - Track Tester",45,33,21
+4804,"PMK4 - Simple Shuttle",36,26,21
+"4804A","PMK4a - Shuttle Add-on",9,9,21
+4807,"PMK7 - DCC Train Detector",23,111,21
+4810,"PMK10 - Speed Controller",7,21,21
+4815,"PMK15 - Train AutoStop",25,7,21
+4818,"PMK18 - EzyPoints",80,32,21
+4822,"PMK22 - Laser Train Detector",58,51,21
+22,"EzyBus Output Module",5,22,22
+23,"EzyBus Input Module",0,19,22
+24,"AVR/EzyBus Controller Module",9,4,22
+"91B","DCC Command Station and Mini-Booster with CBUS Interface (CANCMDB)",30,39,23
+"92P","Handset with pot for MERG DCC Command Station - CANCAB2P",20,15,23
+"92E","Handset with encoder for MERG DCC Command Station - CANCAB2E",10,23,23
+144,"CANCAB2 RJ22 Curly Lead",16,16,23
+"7920P","Metal Knob and Washer for CAB2 Pot Version",14,1,23
+"7920E","Metal Knob for CAB2 Encoder Version",7,0,23
+777,"LCD Back lit Display for CANCAB2",10,4,23
+6720,"1.27mm Header for CANCAB2",13,2,23
+"44c","Mk1 DCC Handset cable, 2 metres",1,0,23
+236,"SD2A Colour Light Signal Driver kit",22,11,24
+25,"LCB Node Connector",0,0,25
+151,"LCB Connector Board",39,40,25
+152,"Power Distribution Board",29,47,25
+"779A","DC Male Socket CLB-JL52 DC 2.1 x 5.5",30,11,25
+28,"CANOUT",21,11,26
+29,"CANINP",19,7,26
+"80A","USB Interface (CANUSB4)",37,38,26
+"94A","CANSOL 94A",5,31,26
+145,"Automatic Train Controller 2 (ATC2) - Core Module Kit",2,4,27
+146,"ATC2 Ends",7,4,27
+147,"ATC2 Profiles Panel",5,1,27
+148,"ATC2 MPS",11,1,27
+666,"1st Class Postage in Addition to the Standard 2nd Class",791,24,28
+" ",,,,
diff --git a/import/data/KitlockerGroups.csv b/import/data/KitlockerGroups.csv
new file mode 100644
index 0000000..38c3afd
--- /dev/null
+++ b/import/data/KitlockerGroups.csv
@@ -0,0 +1,29 @@
+"KLID","Title"
+"G1","General Kits"
+"G2","DCC Kits"
+"G3","CBUS Explorer"
+"G4","Tools"
+"G5","Miscellaneous"
+"G6","ICs"
+"G7","General Kit PCBs"
+"G8","Clearance"
+"G9","Power Supplies"
+"G10","CBUS PCBs"
+"G11","SMD Starter Kits"
+"G12","Servo Mounts"
+"G13","Pocket Money Projects"
+"G14","DCC PCBs"
+"G15","PICs"
+"G16","CBUS Advanced"
+"G17","Test Modules"
+"G18","Test Module PCBs"
+"G19","PMK PCBs"
+"G20","CBUS Beginner's Packs"
+"G21","Pocket Money Kits"
+"G22","EzyBus"
+"G23","DCC Traction"
+"G24","Bitz-in-Bag kits"
+"G25","Connector Boards"
+"G26","CBUS Basic"
+"G27","ATC"
+"G28","POSTAGE"
diff --git a/import/data/assembly_components.csv b/import/data/assembly_components.csv
new file mode 100644
index 0000000..213002d
--- /dev/null
+++ b/import/data/assembly_components.csv
@@ -0,0 +1,59 @@
+,,,,"CANSOL","CANPAN"
+"ResCF-10kRQW","10K 0.25W",150,,,2
+"ResCF-1k8RQW","1K8 0.25W",59,,,3
+"ResCF-2k2RQW","2K2 0.25W",25,,,
+"ResCF-100kRQW","100K 0.25W",22,,,1
+"ResWW-4R7/0.5W","4R7 0.5W",89,,,
+"ResWW-1R2/0.5W","1R2 0.5W",95,,,
+"ResWW-0R1/3W","0R1 3W",45,,,
+"ResNet-10k4+C","10K 5-pin commoned resistor network",2,,,1
+"1N4002","1N4002",2472,,,
+"1N4001","1N4001",17,,,1
+"UF4002","UF4002",11,,,
+"1N4148","1N4148",3482,,,32
+"LED-3mmYLC","yellow LED low current 3mm",8,,,1
+"LED-3mmGLC","green LED low current 3mm",7,,,1
+"LED-3mmRLC","red LED low current 3mm",22,,,
+"CapRE-470u/35V","470uF/35V electrolytic",4,,,
+"CapRE-220u/25V","220uF 25V Radial Electrolytic Capacitor",37,,,
+"CapRE-100u/25V","100uF/25V electrolytic",63,,,1
+"CapTB-10u/16V","10uF tantalum 2.5mm",44,,,1
+"CapTB-4.7u/16V","4.7uF/16V tantalum 2.5mm",31,,,1
+"CapRC-100n/50V2.5","100nF/0.1uF ceramic 2.5mm",12,,,4
+"CapRC-22p/100V2.5","22pF 100V 2.5mm Radial Ceramic capacitor",68,,,
+"FDV304P","FDV304P/XP221P0501TR-G XML CBUS Transistor",248,"farnell",,4
+"STP55NF06L","STP55NF06L MOSFET",24,,,
+"ZTX1149A","ZTX1149A PNP Transistor",87,"farnell",,
+"2N4401","2N4401 NPN Transistor",14,,,
+"MCP2551-I/P","MCP2551 CAN Xceiver",0,"kitlocker",,1
+"L7805CV","L7805 5v 1A Regulator",8,,,
+"PIC18F26K80-I/SP","PIC18F26K80",0,"kitlocker",1,1
+"MIC4426","MIC4426YN Driver",0,"mouser",,
+"CD74HC238E","CD74HC238E Mux/Demux",0,"mouser",,
+"TLC5917N","TLC5917IN LED Driver",0,"mouser",,
+"R-78E5.0-0.5","R-78E5.0-0.5 5V 0.5A",2,"farnell",,1
+"RzPC-4M","4MHz 3 pin Resonator",54,,,
+"SWTact-4.3mm","Tactile Switch 4.3mm Miniature Rectangular SPST",16,,,
+"SWDIL-6w","DIL switch 6 Way 12 Pin",7,,,
+"SRH-p1-36","Header 36 Way Single Row Plug 2.54mm",127,,,
+"TB-3.5-2","Terminal Block 2 Way 10A 3.5mm Camden Type",52,,,
+"Sock-SPCB-D25","D Type 25 Way Socket Straight PCB",3,,,
+"Plug-SL-D25","D Type 25 Way Plug Solder Lug",4,,,
+"BoxH-p1-2x13","Header 26 Way IDC Straight Boxed 2.54mm",7,,,
+"TBSE-10A-3.5-4","4 way 10A 3.5mm Pitch Side Entry Header",11,"farnell",,
+"TBPL-10A-3.5-4","4 Way 10A 3.5mm Pitch Free Plug",4,"farnell",,
+"TBSE-10A-3.5-3","3 way 10A 3.5mm Pitch Side Entry Header",131,,,
+"TBPL-10A-3.5-3","3 Way 10A 3.5mm Pitch Free Plug",212,,,
+"Xyl-4MLP","4MHz Crystal",53,,,
+"MCP2562-I/P","MCP2562-I/P CAN Transceiver",87,,,
+"CANPAN PCB","CANPAN Printed Circuit Board",54,"kitlocker",,
+"CANSOL PCB","CANSOL Rev D Solenoid Driver PCB",0,"kitlocker",,
+"BagSS-75x85","Bag (M) 75x85",119,,,
+"BagSS-140x140","Bag (L) 140x140",99,,,
+"ASFoam","Antistatic Foam (whole sheets) 305x305x6mm",19,,,
+,"CANPAN",1,,,
+,"CANPAN Test Module",1,,,
+"CapRE-2200u/35V","2200uF/35V electrolytic",0,,,
+"SocDIL-28","28 way DIL socket 7.62mm",0,,,
+"SocDIL-16","16 way DIL socket 7.62mm",0,,,
+"SocDIL-8","8 way DIL socket 7.62mm",0,,,
diff --git a/import/data/simple_assemblies.csv b/import/data/simple_assemblies.csv
new file mode 100644
index 0000000..595bba5
--- /dev/null
+++ b/import/data/simple_assemblies.csv
@@ -0,0 +1,7 @@
+"PMP2","LDR Detector, works with DC and DCC.",0.5,"https://merg.org.uk/merg_wiki/doku.php?id=kits:pmplist"
+"PMK4A","Add-on for PMK4 Simple Shuttle to operate a turnout. Replaces Kit 804A",4.01,"https://merg.org.uk/merg_wiki/doku.php?id=kits:pmklist"
+"PMK15","A simple module that stops a train at any chosen point, controlled by the output of one or more train detectors. ",5.53,"https://merg.org.uk/merg_wiki/doku.php?id=kits:pmklist"
+"PMP19","An automatic lighting system where the coach lights only come on when the train is moving.",3.14,"https://merg.org.uk/merg_wiki/doku.php?id=kits:pmplist"
+"PMP27","Panel push buttons for servos. As described in the June 2019 Journal.",3.28,"https://merg.org.uk/merg_wiki/doku.php?id=kits:pmplist"
+"CANPAN97","CBUS Modular Mimic Panel interface allowing up to 32 LEDs and 32 Switches/Pushbuttons. v1y Firmware",16.87,"https://merg.org.uk/merg_wiki/doku.php?id=kits:97"
+"CANSOL94a","A revised version of the CANSOL solenoid driver kit",21.44,"https://merg.org.uk/merg_wiki/doku.php?id=kits:94a"
diff --git a/import/data/simple_components.csv b/import/data/simple_components.csv
new file mode 100644
index 0000000..b2c5967
--- /dev/null
+++ b/import/data/simple_components.csv
@@ -0,0 +1,82 @@
+"Title","Description","supplier","supplier PN","Supplier price"
+"ResWW-0R1/3W","0R1 3W Wire Wound Resistor","farnell",1735066,
+"R-78E5.0-0.5","DC/DC Converter R-78E5.0-0.5 5V 0.5A","farnell",2078564,
+"ResWW-1R2/0.5W","1R2 0.5W Wire Wound Resistor","farnell",2329749,
+"FDV304P","FDV304P SMD CBUS Transistor","farnell",2438464,
+"TBSE-10A-3.5-4","4 way 10A 3.5mm Pitch Side Entry Header","farnell",2517860,
+"TBPL-10A-3.5-4","4 Way 10A 3.5mm Pitch Free Plug","farnell",2575217,
+"ZTX1149A","ZTX1149A PNP Bipolar Transistor","farnell",9526781,
+"PIC12F675-I/P","PIC12F675-I/P Microcontroller 8-bit DIP8","kitlocker","PIC12F675-I/P",
+"CANSOL PCB","CANSOL Rev D Solenoid Driver PCB","kitlocker","CANSOL PCB",
+"MCP2551-I/P","MCP2551-I/P CAN Transceiver","kitlocker","MCP2551-I/P",
+"PIC18F26K80-I/SP","PIC18F26K80-I/SP Microcontroller","kitlocker","PIC18F26K80-I/SP",
+"PMK4a PCB","PMK4a rev2 PCB","kitlocker","PMK4a PCB",
+"PMK15 PCB","PMK15 rev 2 PCB","kitlocker","PMK15 PCB",
+"CANPAN PCB","CANPAN Mimic Panel Interface PCB","kitlocker","CANPAN PCB",
+"MCP2562-I/P","MCP2562-I/P CAN Transceiver","kitlocker","MCP2562-I/P",
+"PIC18F26K80-I/SP","PIC18F26K80-I/SP Microcontroller Preprogrammed","kitlocker","PIC18F26K80-I/SP",
+"TLC5917N","TLC5917N LED Driver","mouser",1755252,
+"CD74HC238E","CD74HC238E Decoder / Demultiplexer DIL16","mouser","595-CD74HC238E",
+"MIC4426","MIC4426 Dual 1.5A Peak MOSFET Drive","mouser","998-MIC4426YN",
+"CapRE-470u/35V","470uF 35V Radial Electrolytic Capacitor","rapid","11-0244",
+"CapTB-4.7u/16V","4.7uF 16V 2.5mm Tantalum Bead Capacitor","rapid","11-1018",
+"CapTB-10u/16V","10uF 16V 2.5mm Tantalum Bead Capacitor","rapid","11-1022",
+"CapTB-330n/35V","330nF 35V 2.5mm Tantalum bead","rapid","11-1060",
+"CapRC-470n/50V2.5","470nF 50V 2.5mm Ceramic Capacitor","rapid","11-3424",
+"CapRC-22p/100V2.5","22pF 100V 2.5mm Radial Ceramic capacitor","rapid","11-3427",
+"CapRC-100n/100V2.5","100nF 100V 2.5mm Ceramic Capacitor","rapid","11-3442",13.68
+"CapRC-100n/50V2.5","100nF 50V 2.5mm Radial Ceramic Capacitor","rapid","11-3455",0.01
+"CapRE-100u/25V","100uF 25V Radial Electrolytic Capacitor","rapid","11-3509",0.06
+"CapRE-220u/25V","220uF 25V Radial Electrolytic Capacitor","rapid","11-3512",0.03
+"CapRE-2200u/35V","2200uF 35v Radial Electrolytic Capacitor","rapid","11-3533",13
+"BagSS-140x140","Self Seal Polythene Bag 140 x 140mm 160 gauge","rapid","14-0909",0.95
+"Plug-SL-D25","25 Way D-Type Solder Lug Plug","rapid","15-0110",277
+"Sock-SPCB-D25","25 Way Straight PCB D Type Socket","rapid","15-0750",3.03
+"BH-2032","CR2032 Coin Cell Battery Holder","rapid","18-0498",38
+"BoxH-p1-2x13","26 Way Straight Boxed Header 2.54mm Pitch","rapid","19-0037",135
+"TBLP-16A-5-2","2 Way 16A Low Profile Terminal Block 5mm Pitch","rapid","21-0461",0.11
+"TB-3.5-2","2 way 3.5mm Terminal Block","rapid","21-1500",0.08
+"TBSE-10A-3.5-3","3 way 10A 3.5mm Pitch Side Entry Header","rapid","21-3028",0.14
+"TBPL-10A-3.5-3","3 Way 10A 3.5mm Pitch Free Plug","rapid","21-3035",0.11
+"SocDIL-8","8 Pin DIL Socket 7.62 mm","rapid","22-0107",0.56
+"SocDIL-14","14 Pin DIL Socket 7.62 mm","rapid","22-0108",0.82
+"SocDIL-16","16 Pin DIL socket 7.62mm","rapid","22-0109",0.81
+"SocDIL-28","28 Pin DIL Socket 7.62mm","rapid","22-0114",0.84
+"SRH-p1-36","36 Way 2.54mm Single Row Header","rapid","22-0545",2.73
+"JL2pC","2 Pin Closed Jumper Link","rapid","22-0690",
+"SB-25x64","Stripboard 25 x 64mm","rapid","34-0500",
+"STP55NF06L","STP55NF06L MOSFET Logic N 60V 55A","rapid","47-0550",
+"UF4002","UF4002 1A 100V Ultrafast Rectifier Diode","rapid","47-3156",
+"L7805CV","L7805CV TO220 5V 1A Voltage Regulator","rapid","47-3290",
+"1N4148","1N4148 75V 150mA Signal Diode","rapid","47-3416",
+"1N4001","1N4001 Rectifier Diode","rapid","47-3420",
+"78L05-100mA","78L05 -100mA Voltage Regulator","rapid","47-3612",
+"1N4002","1N4002 Silicon Rectifier Diode 100V","rapid","47-3802",
+"BC557B","BC557B Transistor PNP TO92 45V","rapid","50-3119",
+"LED-3mmR","3mm LED - Red","rapid","55-0150",
+"LED-3mmRLC","3mm LED - Red Low Current","rapid","56-0400",
+"LED-3mmGLC","3mm LED - Green Low Current","rapid","56-0405",
+"LED-3mmYLC","3mm LED - Yellow Low Current","rapid","56-0410",
+"GL5528","GL5528 Light Dependent Photoresistor","rapid","58-0134",
+"RlyDPDT-12V1A","12V DPDT relay 1A","rapid","60-4692",
+"TCRT5000","TCRT5000 Optical sensor","rapid","60-8260",
+"ResCF-470RQW","470R 0.25W Carbon Film Resistor","rapid","62-0362",
+"ResCF-1k0RQW","1K0 0.25W Carbon Film Resistor","rapid","62-0370",
+"ResCF-1k8RQW","1K8 0.25W Carbon Film Resistor","rapid","62-0376",
+"ResCF-2k2RQW","2K2 0.25W Carbon Film Resistor","rapid","62-0378",
+"ResCF-10kRQW","10K 0.25W Carbon Film Resistor","rapid","62-0394",
+"ResCF-100kRQW","100K 0.25W Carbon Film Resistor","rapid","62-0418",
+"ResCF-4k7RHW","4R7 0.5W Carbon Film Resistor","rapid","62-0510",
+"ResNet-10k4+C","10K 5 Pin Commoned Resistor Network","rapid","63-0265",
+"ResTrim-10kSM","10K 0.1W 30% Linear Trimpot","rapid","68-1575",
+"PIC16F676-I/P","PIC16F676-I/P Microcontroller 8-bit DIP8","rapid","73-3692",
+"SWTact-4.3mm","4.3mm Miniature Rectangular SPST Tactile Switch","rapid","78-1120",
+"SWDIL-6w","DIL Switch 6-way 12-pin","rapid","80-0024",
+"BC547B","BC547B Transistor NPN TO92 45V","rapid","81-0468",
+"2N4401","2N4401 Transistor NPN TO92 40V","rapid","81-0487",
+"BagSS-75x85","Self Seal Polythene Bags 75 x 85 x 0.05mm","rapid","87-0590",
+"ASFoam","Conductive Foam","rapid","87-1528",
+"Xyl-4MLP","4MHz Crystal","rapid","90-1074",
+"RzPC-4M","4MHz 3-Pin Piezo-Ceramic Resonator","rapid","90-3565",
+"BagSS-100x140","Self Seal Polythene Bag 100 x 140mm 160 Gauge","rapid","14-0926",
+"BagSS-55x75","Self Seal Polythene Bag 55 x 75mm 160 gauge","rapid","14-0937",
diff --git a/import/data/simple_components_2.csv b/import/data/simple_components_2.csv
new file mode 100644
index 0000000..962e27f
--- /dev/null
+++ b/import/data/simple_components_2.csv
@@ -0,0 +1,82 @@
+"Title","Description","supplier","supplier PN","Supplier price","Supplier URL"
+"ResWW-0R1/3W","0R1 3W Wire Wound Resistor","farnell",1735066,0.7476,"https://uk.farnell.com/vishay/ac03000001007jac00/res-0r1-5-3w-axial-wirewound/dp/1735066"
+"R-78E5.0-0.5","DC/DC Converter R-78E5.0-0.5 5V 0.5A","farnell",2078564,3.48,"https://uk.farnell.com/recom-power/r-78e5-0-0-5/dc-dc-converter-5v-0-5a/dp/2078564"
+"ResWW-1R2/0.5W","1R2 0.5W Wire Wound Resistor","farnell",2329749,0.072,"https://uk.farnell.com/te-connectivity/cfr50j1r2/res-1r2-5-500mw-axial-carbon-film/dp/2329749"
+"FDV304P","FDV304P SMD CBUS Transistor","farnell",2438464,0.4536,"https://uk.farnell.com/on-semiconductor/fdv304p/mosfet-p-25v-0-46-sot-23-full/dp/2438464"
+"TBSE-10A-3.5-4","4 way 10A 3.5mm Pitch Side Entry Header","farnell",2517860,0.4872,"https://uk.farnell.com/imo-precision-controls/20-155mh-4-e/terminal-block-header-4pos-th/dp/2517860"
+"TBPL-10A-3.5-4","4 Way 10A 3.5mm Pitch Free Plug","farnell",2575217,1.284,"https://uk.farnell.com/imo-precision-controls/20-1550m-4-e/tb-pluggable-4pos-28-16awg/dp/2575217"
+"ZTX1149A","ZTX1149A PNP Bipolar Transistor","farnell",9526781,1.680,"https://uk.farnell.com/diodes-inc/ztx1149a/transistor-pnp-e-line/dp/9526781"
+"PIC12F675-I/P","PIC12F675-I/P Microcontroller 8-bit DIP8","kitlocker","PIC12F675-I/P",,
+"CANSOL PCB","CANSOL Rev D Solenoid Driver PCB","kitlocker","CANSOL PCB",,
+"MCP2551-I/P","MCP2551-I/P CAN Transceiver","kitlocker","MCP2551-I/P",,
+"PIC18F26K80-I/SP","PIC18F26K80-I/SP Microcontroller","kitlocker","PIC18F26K80-I/SP",,
+"PMK4a PCB","PMK4a rev2 PCB","kitlocker","PMK4a PCB",,
+"PMK15 PCB","PMK15 rev 2 PCB","kitlocker","PMK15 PCB",,
+"CANPAN PCB","CANPAN Mimic Panel Interface PCB","kitlocker","CANPAN PCB",,
+"MCP2562-I/P","MCP2562-I/P CAN Transceiver","kitlocker","MCP2562-I/P",,
+"TLC5917N","TLC5917N LED Driver","mouser",1755252,,
+"CD74HC238E","CD74HC238E Decoder / Demultiplexer DIL16","mouser","595-CD74HC238E",,
+"MIC4426","MIC4426 Dual 1.5A Peak MOSFET Drive","mouser","998-MIC4426YN",,
+"CapRE-470u/35V","470uF 35V Radial Electrolytic Capacitor","rapid","11-0244",0.090,"https://www.rapidonline.com/suntan-ts13de1v471msb0b0r-470uf-35v-20-10-17mm-p-5mm-radial-alum-elec-cap-11-0244"
+"CapTB-4.7u/16V","4.7uF 16V 2.5mm Tantalum Bead Capacitor","rapid","11-1018",0.075,"https://www.rapidonline.com/suntan-ts19001c4r7msb0a0r-4-7uf-16v-2-5mm-tantalum-bead-capacitor-11-1018"
+"CapTB-10u/16V","10uF 16V 2.5mm Tantalum Bead Capacitor","rapid","11-1022",0.110,"https://www.rapidonline.com/suntan-ts19001c100msb0a0r-10uf-16v-2-5mm-tantalum-bead-capacitor-11-1022"
+"CapTB-330n/35V","330nF 35V 2.5mm Tantalum bead","rapid","11-1060",0.100,"https://www.rapidonline.com/suntan-ts19001vr33msb0a0r-0-33uf-35v-2-5mm-tantalum-bead-capacitor-11-1060"
+"CapRC-470n/50V2.5","470nF 50V 2.5mm Ceramic Capacitor","rapid","11-3424",0.057,"https://www.rapidonline.com/suntan-ts170r1h474msbfa0r-0-47uf-20-50v-y5v-2-54mm-radial-ceramic-capacitor-11-3424"
+"CapRC-22p/100V2.5","22pF 100V 2.5mm Radial Ceramic capacitor","rapid","11-3427",0.040,"https://www.rapidonline.com/suntan-ts170r2a220jsbna0r-22pf-5-100v-npo-p-2-54mm-radial-ceramic-capacitor-11-3427"
+"CapRC-100n/100V2.5","100nF 100V 2.5mm Ceramic Capacitor","rapid","11-3442",0.050,"https://www.rapidonline.com/suntan-ts170r2a104ksbba0r-0-1uf-10-100v-x7r-2-54mm-radial-ceramic-capacitor-11-3442"
+"CapRC-100n/50V2.5","100nF 50V 2.5mm Radial Ceramic Capacitor","rapid","11-3455",0.010,
+"CapRE-100u/25V","100uF 25V Radial Electrolytic Capacitor","rapid","11-3509",0.060,
+"CapRE-220u/25V","220uF 25V Radial Electrolytic Capacitor","rapid","11-3512",0.030,
+"CapRE-2200u/35V","2200uF 35v Radial Electrolytic Capacitor","rapid","11-3533",13.000,
+"BagSS-140x140","Self Seal Polythene Bag 140 x 140mm 160 gauge","rapid","14-0909",0.950,
+"Plug-SL-D25","25 Way D-Type Solder Lug Plug","rapid","15-0110",277.000,
+"Sock-SPCB-D25","25 Way Straight PCB D Type Socket","rapid","15-0750",3.030,
+"BH-2032","CR2032 Coin Cell Battery Holder","rapid","18-0498",38.000,
+"BoxH-p1-2x13","26 Way Straight Boxed Header 2.54mm Pitch","rapid","19-0037",135.000,
+"TBLP-16A-5-2","2 Way 16A Low Profile Terminal Block 5mm Pitch","rapid","21-0461",0.110,
+"TB-3.5-2","2 way 3.5mm Terminal Block","rapid","21-1500",0.080,
+"TBSE-10A-3.5-3","3 way 10A 3.5mm Pitch Side Entry Header","rapid","21-3028",0.140,
+"TBPL-10A-3.5-3","3 Way 10A 3.5mm Pitch Free Plug","rapid","21-3035",0.110,
+"SocDIL-8","8 Pin DIL Socket 7.62 mm","rapid","22-0107",0.560,
+"SocDIL-14","14 Pin DIL Socket 7.62 mm","rapid","22-0108",0.820,
+"SocDIL-16","16 Pin DIL socket 7.62mm","rapid","22-0109",0.810,
+"SocDIL-28","28 Pin DIL Socket 7.62mm","rapid","22-0114",0.840,
+"SRH-p1-36","36 Way 2.54mm Single Row Header","rapid","22-0545",2.730,
+"JL2pC","2 Pin Closed Jumper Link","rapid","22-0690",,
+"SB-25x64","Stripboard 25 x 64mm","rapid","34-0500",,
+"STP55NF06L","STP55NF06L MOSFET Logic N 60V 55A","rapid","47-0550",,
+"UF4002","UF4002 1A 100V Ultrafast Rectifier Diode","rapid","47-3156",,
+"L7805CV","L7805CV TO220 5V 1A Voltage Regulator","rapid","47-3290",,
+"1N4148","1N4148 75V 150mA Signal Diode","rapid","47-3416",,
+"1N4001","1N4001 Rectifier Diode","rapid","47-3420",,
+"1N4002","1N4002 Rectifier Diode","rapid","47-3422",,
+"78L05-100mA","78L05 -100mA Voltage Regulator","rapid","47-3612",,
+"1N4002","1N4002 Silicon Rectifier Diode 100V","rapid","47-3802",,
+"BC557B","BC557B Transistor PNP TO92 45V","rapid","50-3119",,
+"LED-3mmR","3mm LED - Red","rapid","55-0150",,
+"LED-3mmRLC","3mm LED - Red Low Current","rapid","56-0400",,
+"LED-3mmGLC","3mm LED - Green Low Current","rapid","56-0405",,
+"LED-3mmYLC","3mm LED - Yellow Low Current","rapid","56-0410",,
+"GL5528","GL5528 Light Dependent Photoresistor","rapid","58-0134",,
+"RlyDPDT-12V1A","12V DPDT relay 1A","rapid","60-4692",,
+"TCRT5000","TCRT5000 Optical sensor","rapid","60-8260",,
+"ResCF-470RQW","470R 0.25W Carbon Film Resistor","rapid","62-0362",,
+"ResCF-1k0RQW","1K0 0.25W Carbon Film Resistor","rapid","62-0370",,
+"ResCF-1k8RQW","1K8 0.25W Carbon Film Resistor","rapid","62-0376",,
+"ResCF-2k2RQW","2K2 0.25W Carbon Film Resistor","rapid","62-0378",,
+"ResCF-10kRQW","10K 0.25W Carbon Film Resistor","rapid","62-0394",,
+"ResCF-100kRQW","100K 0.25W Carbon Film Resistor","rapid","62-0418",,
+"ResCF-4k7RHW","4R7 0.5W Carbon Film Resistor","rapid","62-0510",,
+"ResNet-10k4+C","10K 5 Pin Commoned Resistor Network","rapid","63-0265",,
+"ResTrim-10kSM","10K 0.1W 30% Linear Trimpot","rapid","68-1575",,
+"PIC16F676-I/P","PIC16F676-I/P Microcontroller 8-bit DIP8","rapid","73-3692",,
+"SWTact-4.3mm","4.3mm Miniature Rectangular SPST Tactile Switch","rapid","78-1120",,
+"SWDIL-6w","DIL Switch 6-way 12-pin","rapid","80-0024",,
+"BC547B","BC547B Transistor NPN TO92 45V","rapid","81-0468",,
+"2N4401","2N4401 Transistor NPN TO92 40V","rapid","81-0487",,
+"BagSS-75x85","Self Seal Polythene Bags 75 x 85 x 0.05mm","rapid","87-0590",,
+"ASFoam","Conductive Foam","rapid","87-1528",,
+"Xyl-4MLP","4MHz Crystal","rapid","90-1074",,
+"RzPC-4M","4MHz 3-Pin Piezo-Ceramic Resonator","rapid","90-3565",,
+"BagSS-100x140","Self Seal Polythene Bag 100 x 140mm 160 Gauge","rapid","14-0926",,
+"BagSS-55x75","Self Seal Polythene Bag 55 x 75mm 160 gauge","rapid","14-0937",,
diff --git a/import/data/stock.csv b/import/data/stock.csv
new file mode 100644
index 0000000..8f0ad2b
--- /dev/null
+++ b/import/data/stock.csv
@@ -0,0 +1,57 @@
+"ResCF-10kRQW","10K 0.25W",150
+"ResCF-1k8RQW","1K8 0.25W",59
+"ResCF-2k2RQW","2K2 0.25W",25
+"ResCF-100kRQW","100K 0.25W",22
+"ResWW-4R7/0.5W","4R7 0.5W",89
+"ResWW-1R2/0.5W","1R2 0.5W",95
+"ResWW-0R1/3W","0R1 3W",45
+"ResNet-10k4+C","10K 5-pin commoned resistor network",2
+"1N4002","1N4002",2472
+"1N4001","1N4001",17
+"UF4002","UF4002",11
+"1N4148","1N4148",3482
+"LED-3mmYLC","yellow LED low current 3mm",8
+"LED-3mmGLC","green LED low current 3mm",7
+"LED-3mmRLC","red LED low current 3mm",22
+"CapRE-470u/35V","470uF/35V electrolytic",4
+"CapRE-220u/25V","220uF 25V Radial Electrolytic Capacitor",37
+"CapRE-100u/25V","100uF/25V electrolytic",63
+"CapTB-10u/16V","10uF tantalum 2.5mm",44
+"CapTB-4.7u/16V","4.7uF/16V tantalum 2.5mm",31
+"CapRC-100n/50V2.5","100nF/0.1uF ceramic 2.5mm",12
+"CapRC-22p/100V2.5","22pF 100V 2.5mm Radial Ceramic capacitor",68
+"FDV304P","FDV304P/XP221P0501TR-G XML CBUS Transistor",248
+"STP55NF06L","STP55NF06L MOSFET",24
+"ZTX1149A","ZTX1149A PNP Transistor",87
+"2N4401","2N4401 NPN Transistor",14
+"MCP2562-I/P","MCP2551 CAN Xceiver",43
+"L7805CV","L7805 5v 1A Regulator",8
+"PIC18F26K80-I/SP","PIC18F26K80",104
+"MIC4426","MIC4426YN Driver",60
+"CD74HC238E","CD74HC238E Mux/Demux",43
+"TLC5917N","TLC5917IN LED Driver",49
+"R-78E5.0-0.5","R-78E5.0-0.5 5V 0.5A",2
+"RzPC-4M","4MHz 3 pin Resonator",54
+"SWTact-4.3mm","Tactile Switch 4.3mm Miniature Rectangular SPST",16
+"SWDIL-6w","DIL switch 6 Way 12 Pin",7
+"SRH-p1-36","Header 36 Way Single Row Plug 2.54mm",127
+"TB-3.5-2","Terminal Block 2 Way 10A 3.5mm Camden Type",52
+"Sock-SPCB-D25","D Type 25 Way Socket Straight PCB",3
+"Plug-SL-D25","D Type 25 Way Plug Solder Lug",4
+"BoxH-p1-2x13","Header 26 Way IDC Straight Boxed 2.54mm",7
+"TBSE-10A-3.5-4","4 way 10A 3.5mm Pitch Side Entry Header",11
+"TBPL-10A-3.5-4","4 Way 10A 3.5mm Pitch Free Plug",4
+"TBSE-10A-3.5-3","3 way 10A 3.5mm Pitch Side Entry Header",131
+"TBPL-10A-3.5-3","3 Way 10A 3.5mm Pitch Free Plug",212
+"Xyl-4MLP","4MHz Crystal",53
+"MCP2562-I/P","MCP2562-I/P CAN Transceiver",87
+"CANPAN PCB","CANPAN Printed Circuit Board",54
+"BagSS-75x85","Bag (M) 75x85",119
+"BagSS-140x140","Bag (L) 140x140",99
+"ASFoam","Antistatic Foam (whole sheets) 305x305x6mm",19
+,"CANPAN",1
+,"CANPAN Test Module",1
+"CapRE-2200u/35V","2200uF/35V electrolytic",0
+"SocDIL-28","28 way DIL socket 7.62mm",0
+"SocDIL-16","16 way DIL socket 7.62mm",0
+"SocDIL-8","8 way DIL socket 7.62mm",0
diff --git a/import/load_stock.php b/import/load_stock.php
index d8bd2e6..19cd0d3 100644
--- a/import/load_stock.php
+++ b/import/load_stock.php
@@ -67,10 +67,9 @@ if( !file_exists( $csvFile ) ) {
}
$contentId = $gBitDb->getOne(
- "SELECT sc.`content_id`
- FROM `".BIT_DB_PREFIX."stock_component` sc
- INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON lc.`content_id` = sc.`content_id`
- WHERE lc.`title` = ?",
+ "SELECT lc.`content_id`
+ FROM `".BIT_DB_PREFIX."liberty_content` lc
+ WHERE lc.`content_type_guid` = '".STOCKCOMPONENT_CONTENT_TYPE_GUID."' AND lc.`title` = ?",
[ $componentTitle ]
);
if( !$contentId ) {