Hello SambaPOS Community,
I’m trying to set up an automation process in SambaPOS v5 to send a monthly sales report via email. The goal is to generate the sales report for the previous month and send it automatically on the 2nd day of the current month. Here’s what I have so far and where I need help:
Requirements
- The report should:
- Include sales data for the entire previous month.
- Use the provided report template (below).
- Save the report as a file with a dynamic name (e.g.,
MonthlySales_2024-12.xps
).
- The automation should:
- Automatically generate the report on the 2nd day of each month.
- Attach the saved report to an email and send it.
- Use a trigger or automation command for scheduling.
- I also want to understand how to:
- Define the date range dynamically for the report (e.g., first and last day of the previous month).
- Pass dynamic file names or values to actions.
4.I’m unable to dynamically generate the report for the previous month. I’ve tried using{DATE:yyyy-MM-01:-1M}
for the start date and{DATE:yyyy-MM-dd:-1D}
for the end date but haven’t been successful.
Report Template
Here’s the template for the report I want to use:
[DAILY SALES REPORT:1.8, 1.5, 1.5, 1, 1.8, 2, 1.5, 1.5, 1.5, 1.8, 1.8]
>> Daily Sales Summary
Date | Ticket Sales | Discount | Round | Tax | Total | Cash | BML Card | MIB Card | BML Transfer | MIB Transfer
{REPORT TICKET DETAILS:T.Date,([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.BML Card.sum,PA.MIB Card.sum,PA.BML Transfer.sum,PA.MIB Transfer.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.BML Card.sum,PA.MIB Card.sum,PA.BML Transfer.sum,PA.MIB Transfer.sum:(TS.Status=Paid)}
[PAYMENT TOTALS BY TYPE:2, 1, 2]
>>Payment Summary by Type
Payment Type|Total Amount
{REPORT PAYMENT DETAILS:P.Type,P.Amount.Sum:Payment.Amount > 0}
>>Total Payments
>Total|{REPORT PAYMENT DETAILS:P.Amount.Sum:Payment.Amount > 0}
Any help would be greatly appreciated!
If you have step-by-step guides, examples, or suggestions to streamline this process, please share them. Thank you in advance for your support!