Report of (TOTAL EARNINGS)-(TOTAL EXPENSES)=TOTAL EARNINGS

an example of a report template, to know the total profit already subtracted with the expenses?

It would depend on how you have Samba setup. How are you tracking your expenses within Samba?

  • Something to do with a product inventory and costs associated with this, or
  • Using different ticket types, payment types and account transactions to track expenses through tickets (this is what I do. I have sales tickets and expense tickets. Expense tickets have their own menu containing a list of things we spend money on).

For me, the way I would create such a report would be to have two REPORT TICKET TOTAL tags. One which brings in the total of the sales tickets and one bringing in the total of the expense tickets. This could be placed inside some square brackets to take care of the maths. Something like this:

[F(     TN('{REPORT TICKET TOTAL:(TY=Sales Ticket)}')    -    TN('{REPORT TICKET TOTAL:(TY=Expense Ticket)}')    )]

In this example,

  • the [ ] allow you to do some maths.
  • the TN converts the report tag output (1,350.45) to a simple number (1350.45) to allow the maths to work (if you try to go maths with that comma , in there then it wouldn’t work
  • finally the F which wraps the two TNs will re-format the number into a nice looking number with comma separators for the final display output.

There is a lot to look into here though. Start by learning about the various custom report tags and make sure you are getting the numbers out from them that you are expecting, before you start building these report tags into calculations.

Finally, you also need to consider how you will deal with taxes and any other commissions that you might pay. In my environment the simple equation above wouldn’t work, because staff also earn a sales commission on sales which I pay outside of Samba (I should really have it inside, but I haven’t got around to this yet).

2 Likes

I have not succeeded yet

Can you share what Account Transaction Types and Documents do you use within SambaPOS to keep track of your expenses?

1 Like

excellent, I will be sending you the transactions and documents, detail is Spanish

TYPES OF TRANSACTION
Transaction Discount
Transaction Rounding
Sales Transaction
Payment Transaction
Transaction Account Staff
Tips Transaction
Change Transaction
Transaction Account to Suppliers
Decrease Transaction
Transaction Expenses
Transaction Income
Transaction Payment to Suppliers
Cash Payment Staff
Staff Credit
IN Petty Cash

TYPES OF DOCUMENTS
Effective Staff
Staff Credit
Cash Expense
Cash Income
Buy from Supplier

So your Payment Transactions should be basically your income accounts.

Payment Transactions basically moves the funds from Receivables to one of these accounts:

  • Cash
  • Credit Card
  • Voucher
  • Customer Receivables etc.

I see Income Transaction but I dont understand in which context you are using this, so Ill stick with my assumptions above.

So what you need to do is use {ACCOUNT TRANSACTION DETAILS:AccTxType:Account}
i.e. {ACCOUNT TRANSACTION DETAILS:Payment Transaction:Cash}

It will give you account line details for all the Payment Transaction that targeted Cash account.

There is also {ACCOUNT TRANSACTION TOTAL:AccTxType:Account}
i.e. {ACCOUNT TRANSACTION TOTAL:Payment Transaction:Cash} which will give you a sum of all the transactions for this account.

Since you have movement of Debit and Credit from Cash account i.e. Petty Cash, you will need to use
{ACCOUNT DEBIT TOTAL:Account} i.e. {ACCOUNT DEBIT TOTAL:Cash} to account for all the incoming and outgoing transactions {ACCOUNT CREDIT TOTAL:Cash}

Here is a sample, hope it helps


>>Sale Incomes|||
Cash|||{ACCOUNT TRANSACTION TOTAL:Payment Transaction:Cash}
Credit Card|||{ACCOUNT TRANSACTION TOTAL:Payment Transaction:Credit Card}
ABA Pay|||{ACCOUNT TRANSACTION TOTAL:Payment Transaction:ABAPay}
Tabs|||{ACCOUNT TRANSACTION TOTAL:Payment Transaction:Customer Account}
>Total Sales Income|||{ACCOUNT TRANSACTION TOTAL:Payment Transaction:Payment Accounts}



>>Petty Cash||
{ACCOUNT TRANSACTION DETAILS:Petty Cash Transaction:Cash}

[Grand Totals:2.5, 2, 1, 2]
Cash|||[=F((TN('{ACCOUNT DEBIT TOTAL:Cash}')-TN('{ACCOUNT TRANSACTION TOTAL:Petty Cash Transaction:Cash}')),'#,#0.00')]

2 Likes