Script will now print out list of parts with no price that have BOM entries

This commit is contained in:
Matt McWilliams 2024-11-28 12:06:25 -05:00
parent e1c8a7bc3c
commit 95a41e1443
4 changed files with 22 additions and 13 deletions

View File

@ -41,21 +41,21 @@ Actual price of a full build may be higher.
| Part | Qty | Cost (USD) |
|-------------------------------------|-----|------------|
| M4 hex bolt 40mm | 4 | 5.0 |
| M3 sliding t slot nut | 25 | 1.5 |
| M3 hex cap bolt 8mm | 25 | 2.25 |
| M4 hex bolt 40mm | 4 | 2.4 |
| M3 sliding t slot nut | 25 | 1.25 |
| M3 hex cap bolt 8mm | 25 | 2.0 |
| M3 hex cap bolt 6mm | 8 | 0.56 |
| M3 hex cap bolt 12mm | 1 | 0.0 |
| L298N Motor driver module | 1 | 2.89 |
| M3 hex cap bolt 12mm | 1 | 0.08 |
| L298N Motor driver module | 1 | 2.87 |
| ESP32 GPIO breakout board | 1 | 5.99 |
| ESP32 Dev board | 1 | 6.66 |
| 608-RS Ball Bearing | 1 | 0.17 |
| 250RPM DC geared motor | 2 | 29.98 |
| 2020 Aluminum extrusion 420mm | 2 | 5.22 |
| 2020 Aluminum extrusion 260mm | 4 | 6.44 |
| 100RPM DC geared motor with encoder | 1 | 17.02 |
| 2020 Aluminum extrusion 420mm | 2 | 5.1 |
| 2020 Aluminum extrusion 260mm | 4 | 6.4 |
| 100RPM DC geared motor with encoder | 1 | 16.19 |
|---------|---------------|------------------------------------|
| TOTAL | 75 | 83.51 |
| TOTAL | 76 | 79.65 |
<!-- /bom -->

View File

@ -3,7 +3,7 @@ quantity,part,part_id,price
25,"M3 sliding t slot nut",N/A,125
25,"M3 hex cap bolt 8mm",N/A,200
8,"M3 hex cap bolt 6mm",N/A,56
1,"M3 hex cap bolt 12mm",N/A,0
1,"M3 hex cap bolt 12mm",N/A,8
1,"L298N Motor driver module",N/A,287
1,"ESP32 GPIO breakout board",N/A,599
1,"ESP32 Dev board",N/A,666
@ -12,4 +12,4 @@ quantity,part,part_id,price
2,"2020 Aluminum extrusion 420mm",N/A,510
4,"2020 Aluminum extrusion 260mm",N/A,640
1,"100RPM DC geared motor with encoder",N/A,1619
76,TOTAL,N/A,7957
76,TOTAL,N/A,7965

1 quantity part part_id price
3 25 M3 sliding t slot nut N/A 125
4 25 M3 hex cap bolt 8mm N/A 200
5 8 M3 hex cap bolt 6mm N/A 56
6 1 M3 hex cap bolt 12mm N/A 0 8
7 1 L298N Motor driver module N/A 287
8 1 ESP32 GPIO breakout board N/A 599
9 1 ESP32 Dev board N/A 666
12 2 2020 Aluminum extrusion 420mm N/A 510
13 4 2020 Aluminum extrusion 260mm N/A 640
14 1 100RPM DC geared motor with encoder N/A 1619
15 76 TOTAL N/A 7957 7965

View File

@ -2,6 +2,7 @@ part,part_id,price,quantity,url
M3 hex nut,N/A,999,300,https://amzn.to/4hAnwjc
M3 hex cap bolt 6mm,N/A,726,100,https://amzn.to/3AwiZxo
M3 hex cap bolt 8mm,N/A,899,100,https://amzn.to/3YEvWNB
M3 hex cap bolt 12mm,N/A,836,100,https://amzn.to/48CGa5Y
M3 sliding t slot nut,N/A,599,105,https://amzn.to/48GRrSU
2020 Aluminum extrusion 260mm,N/A,7399,46,https://amzn.to/418OicC
2020 Aluminum extrusion 420mm,N/A,7399,29,https://amzn.to/418OicC

1 part part_id price quantity url
2 M3 hex nut N/A 999 300 https://amzn.to/4hAnwjc
3 M3 hex cap bolt 6mm N/A 726 100 https://amzn.to/3AwiZxo
4 M3 hex cap bolt 8mm N/A 899 100 https://amzn.to/3YEvWNB
5 M3 hex cap bolt 12mm N/A 836 100 https://amzn.to/48CGa5Y
6 M3 sliding t slot nut N/A 599 105 https://amzn.to/48GRrSU
7 2020 Aluminum extrusion 260mm N/A 7399 46 https://amzn.to/418OicC
8 2020 Aluminum extrusion 420mm N/A 7399 29 https://amzn.to/418OicC

View File

@ -61,4 +61,12 @@ sqlite3 :memory: -cmd '.mode csv' -cmd ".import ${TOTAL} bom" -cmd '.mode markdo
"SELECT 'TOTAL', SUM(quantity), CAST(SUM(price) / 100.00 as MONEY) FROM bom;" | grep -v 'SUM('
sqlite3 :memory: -cmd '.mode csv' -cmd ".import ${TOTAL} bom"\
"SELECT SUM(quantity), 'TOTAL', 'N/A', SUM(price) FROM bom;" | tr -d '"' >> "${TOTAL}"
"SELECT SUM(quantity), 'TOTAL', 'N/A', SUM(price) FROM bom;" | tr -d '"' >> "${TOTAL}"
NONEFOUND=$(sqlite3 :memory: -cmd '.mode csv' -cmd ".import ${DESTINATION} bom" -cmd ".import ${PRICES} prices" -cmd '.mode column' -cmd '.headers off' \
'SELECT DISTINCT part FROM bom WHERE part NOT IN (SELECT part FROM prices) ORDER BY part;')
if [[ "${NONEFOUND}" != "" ]]; then
echo "No price found for the following parts:"
echo "${NONEFOUND}"
fi