I want to send a monthly report automatically to our franchise HQ, I have report format and set rules, action and trigger to send reports however how to select or provision date range of previous month while saving and sending report.
Eg. on 1st Jan 2020 I need to save and send report for 1st to 31 Dec 2019. Automatically!!
Report format is below:
[SALES:1, 1.2, 1, 1, 1, 1, 1, 1]
>Day|Ticket Sales|Discount|Round|Tax|Total|Cash|Credit
{REPORT TICKET DETAILS:M.StartDate,([T.TotalAmount]-[CA.Discount]-[T.Tax]-[CA.Round]).sum,CA.Discount.sum,CA.Round.sum,T.Tax.sum,T.TotalAmount.sum,PA.Cash.sum,PA.Card.sum:(TS.Status=Paid)}
>Total |{REPORT TICKET DETAILS:([T.TotalAmount]-[CA.Discount]-[T.Tax]-[CA.Round]).sum,CA.Discount.sum,CA.Round.sum,T.Tax.sum,T.TotalAmount.sum,PA.Cash.sum,PA.Card.sum:(TS.Status=Paid)}
[PAYMENTS: 2, 1, 2]
{REPORT PAYMENT DETAILS:P.Name,P.Amount.Percent,P.Amount.Sum:Payment.Amount > 0}
>Total|{REPORT PAYMENT DETAILS:P.Amount.Sum:Payment.Amount > 0}
[GROUP SALES BY QTY:2, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.Quantity.Percent.desc,O.Quantity.Sum:(ODI=True)}
>Total||{REPORT ORDER DETAILS:O.Quantity.Sum:(ODI=True)}
[GROUP SALES BY AMOUNT:2, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Percent.desc,O.ExactTotal.Sum:(ODI=True)}
>Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(ODI=True)}
[ITEM SALES SUMMARY:2, 1, 1]
@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True):{0}:,}
>{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$1"}
{REPORT ORDER DETAILS:' '+[O.PortionName],O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$1":2}