Subversion Repositories SmartDukaan

Rev

Rev 3318 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3318 Rev 3319
Line 24... Line 24...
24
PYTHON_DIR=${PRGDIR}/../PyProj/src/shop2020/utils
24
PYTHON_DIR=${PRGDIR}/../PyProj/src/shop2020/utils
25
 
25
 
26
DATE=`date +%Y-%b-%d`
26
DATE=`date +%Y-%b-%d`
27
mysql -uroot -pshop2020 catalog -e " select i.id as ID, i.brand as Brand, i.model_number as 'Model Number', i.model_name as 'Model Name', i.color as Color, sum(c.availibility) as Availability from item i left join currentinventorysnapshot c on c.item_id = i.id where i.product_group = 'Handsets' and i.status =3 group by i.id having sum(c.availibility) >= 2 order by i.brand, i.model_number, i.color" > /tmp/items-deliverable-on-next-day.${DATE}.csv
27
mysql -uroot -pshop2020 catalog -e " select i.id as ID, i.brand as Brand, i.model_number as 'Model Number', i.model_name as 'Model Name', i.color as Color, sum(c.availibility) as Availability from item i left join currentinventorysnapshot c on c.item_id = i.id where i.product_group = 'Handsets' and i.status =3 group by i.id having sum(c.availibility) >= 2 order by i.brand, i.model_number, i.color" > /tmp/items-deliverable-on-next-day.${DATE}.csv
28
mysql -uroot -pshop2020 catalog -e " select i.id as ID, i.brand as Brand, i.model_number as 'Model Number', i.model_name as 'Model Name', i.color as Color, sum(c.availibility) as Availability from item i left join currentinventorysnapshot c on c.item_id = i.id where i.product_group = 'Handsets' and i.status =3 group by i.id having sum(c.availibility) < 2 order by i.brand, i.model_number, i.color" > /tmp/items-not-deliverable-on-next-day.${DATE}.csv
28
mysql -uroot -pshop2020 catalog -e " select i.id as ID, i.brand as Brand, i.model_number as 'Model Number', i.model_name as 'Model Name', i.color as Color, sum(c.availibility) as Availability from item i left join currentinventorysnapshot c on c.item_id = i.id where i.product_group = 'Handsets' and i.status =3 group by i.id having sum(c.availibility) < 2 order by i.brand, i.model_number, i.color" > /tmp/items-not-deliverable-on-next-day.${DATE}.csv
29
mysql -uroot -pshop2020 catalog -e " select i.id as ID, i.brand as Brand, i.model_number as 'Model Number', i.model_name as 'Model Name', i.color as Color, sum(c.availibility) as Availability from item i left join currentinventorysnapshot c on c.item_id = i.id where i.product_group = 'Handsets' and i.status in (2,6) order by i.brand, i.model_number, i.color" > /tmp/items-marked-out-of-stock.${DATE}.csv
29
mysql -uroot -pshop2020 catalog -e " select i.id as ID, i.brand as Brand, i.model_number as 'Model Number', i.model_name as 'Model Name', i.color as Color, sum(c.availibility) as Availability from item i left join currentinventorysnapshot c on c.item_id = i.id where i.product_group = 'Handsets' and i.status in (2,6) group by i.id order by i.brand, i.model_number, i.color" > /tmp/items-marked-out-of-stock.${DATE}.csv
30
 
30
 
31
#Email the two report files.
31
#Email the two report files.
32
 
32
 
33
FROM=$1
33
FROM=$1
34
PASSWD=$2
34
PASSWD=$2