package mtwmapi

import (
	"git.rosy.net.cn/jx-callback/globals"
	"testing"
	"time"
)

func TestBillList(t *testing.T) {
	now := time.Now()
	from := time.Date(now.Year(), now.Month(), now.Day()-8, 0, 0, 0, 0, time.Local)
	to := time.Date(now.Year(), now.Month(), now.Day()-2, 23, 59, 59, 59, time.Local)
	param := &Bill{
		AppPoiCode: "7379574",
		StartDate:  from.Unix(),
		EndDate:    to.Unix(),
		Offset:     0,
		Limit:      200,
	}

	data, settleId, err := api.GetStoreBillList(param)
	if err != nil {
		globals.SugarLogger.Debugf("err := %v", err)
		return
	}

	globals.SugarLogger.Debugf("settleId := %d", settleId)
	for _, v := range data {
		globals.SugarLogger.Debugf("OrderId : %s , TimingFee : %d , DeliveryFee : %d , PlatformSettlement : %d ", v.OrderId, v.TimingFee, v.DeliveryFee, v.PlatformSettlement)
	}
}
