Subversion Repositories SmartDukaan

Rev

Rev 2860 | Rev 3511 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2396 chandransh 1
#!/bin/bash
2
 
3
REPORT_DIR="/InventoryReports"
4
today=`date +%Y-%b-%d`
3288 chandransh 5
for i in 1 2 5;
2396 chandransh 6
do
2860 chandransh 7
	mysql -uroot -pshop2020 catalog -e "select concat(item.id, ',', item.product_group, ',', item.brand, ',', item.model_number, ',', item.color, ',', s.availibility) as 'Id, Product Group, Brand, Model, Color, Availability' from currentinventorysnapshot as s, item where s.item_id = item.id and item.color is not null and s.warehouse_id = $i" > ${REPORT_DIR}/inventory-report-$today-$i.csv
2396 chandransh 8
done
9
mysql -uroot -pshop2020 catalog -e "select concat(item_key, ',', item_id) as 'Key,Id' from vendoritemmapping where vendor_category='Handsets'" > ${REPORT_DIR}/vendor-mapping-1.csv
10
mysql -uroot -pshop2020 catalog -e "select concat(item_key, ',', item_id) as 'Key,Id' from vendoritemmapping where vendor_category='Accessories'" > ${REPORT_DIR}/vendor-mapping-2.csv
11