#!/bin/bash
cd /tmp/out/app && ./tests/reset.sh >/dev/null 2>&1
php tools/toko_key.php AMBO1 > storage/k1.txt; K=$(awk '{print $2}' storage/k1.txt); TGL=$(date +%F)
for s in 1 2 3; do curl -s -o /dev/null -H "X-Toko-Kode: AMBO1" -H "X-Toko-Key: $K" -H 'Content-Type: application/json' -d "{\"tanggal\":\"$TGL\",\"shift\":\"Shift $s\",\"kasir\":\"Sari\",\"setoran\":$((s*500000+250000))}" "http://127.0.0.1:8099/api/index.php?r=ingest/setoran"; done
mysql -ubt -pbtpass -h127.0.0.1 brambo_test -e "INSERT INTO notas (supplier_id,tanggal_nota,jumlah) VALUES (1,'$(date -d '-5 day' +%F)',1250000),(1,'$(date -d '-3 day' +%F)',2000000),(2,'$(date -d '-2 day' +%F)',800000)"
