$digikey_bom = false;
$kits = 1;
+$use_inventory = false;
define("DATA_ROW_START", 3);
"width" => 0),
);
-$short_opts = "hckn:";
+$short_opts = "hci:kn:";
function usage()
{
echo "\n";
echo "Options:\n";
echo " -c Add cost information to the BOM\n";
+ echo " -i Specifiy inventory CSV file\n";
echo " -k Create digikey BOM submission file (tab-separated fields)\n";
echo " -h Display this help and exit\n";
echo " -n Number of cards/kits for digikey BOM submission\n";
case 'c':
$add_cost = true;
break;
+ case 'i':
+ $use_inventory = true;
+ $inventory_filename = $o[1];
+ break;
case 'k':
$digikey_bom = true;
break;
if ($digikey_bom) {
/* Exportation BOM digikey. */
$dest .= ".txt";
+ $inventory = array();
+
+ if ($use_inventory) {
+ $inventory = import_inventory($inventory_filename);
+ }
- export_bom_digikey($data, $num, $col_num_to_id, $col_id_to_num, $dest);
+ export_bom_digikey($data, $num, $col_num_to_id, $col_id_to_num, $dest, $inventory);
} else {
/* Exportation BOM Excel */