Opening and Closing CASH and CC amounts

I have a need of knowing how much money I put in the cash register before I open the work period, and then of course knowing how much money I have when I close the work period… Without entering into accounts (far too complicated for me at this point). I decided to save all these CASH ??? (I dont know how to name them) into Entities…

so:

  1. Create a Entity TYPE:

now:
2) Create the action to work with this entity:


  1. Create the Rules:


  2. Create the Report:

    [Reporte de Cajas:2, 2, 2, 2]

    Caja - Fecha|:Apertura|:Cierre|:Tarjetas
    @@ReporteCajas

    select Name,
    CustomData as Apertura,
    CustomData as Cierre,
    CustomData as Tarjetas
    from Entities where EntityTypeId = 6

Hope this is usefull!!!

G.

1 Like

Gerlandog I am moving this to tutorials section as this is not a prebuilt database.

1 Like

yea… sorry… my bad!!!

G.

Interesting use for Entity. I would need to study it more to see if I could use this idea but that is definitely interesting.

1 Like

Small suggestion for your Query, so that it is more universal for others to use without needing to know the [EntityTypeId], since it will be different than 6 for most people…

WHERE [EntityTypeId] = (SELECT [Id] FROM [EntityTypes] WHERE [Name]='CAJA')

Full Query:

SELECT
 [Name]
,[CustomData] as [Apertura]
,[CustomData] as [Cierre]
,[CustomData] as [Tarjetas]
FROM [Entities]
WHERE [EntityTypeId] = (SELECT [Id] FROM [EntityTypes] WHERE [Name]='CAJA') -- set Entity Type
1 Like

I don’t know if anyone still uses it or not but to make it SQL CE compatible we can use in keyword…

WHERE [EntityTypeId] in (SELECT [Id] FROM [EntityTypes] WHERE [Name]=‘CAJA’)

1 Like

@emre @gerlandog
i tied all the steps but it gives me an error if you can provide sample database with the configure it be helpful

@gerlandog
how did you have 2 selection for the step 3 . for event work period end work period end .create rule

To add an Action more than once to a Rule:

  • Select Actions > Right-click in left chooser window > Display All Values.
  • Scroll to bottom of Left chooser Window where you will find the Action so you can add it to the Right again.

@QMcKay Thank You found it now there no error but there is no out put report

[img=http://s29.postimg.org/bd86c5nmb/report.png]

[img=http://s29.postimg.org/yfypbbp3n/script.png]

please help me on it thank you

Report Template should look like this:

[Reporte de Cajas:2, 2, 2, 2]
>Caja - Fecha|:Apertura|:Cierre|:Tarjetas
@@ReporteCajas

SQL Script should look like the following and have Handler called @@ReporteCajas:

SELECT
 [Name]
,[CustomData] as [Apertura]
,[CustomData] as [Cierre]
,[CustomData] as [Tarjetas]
FROM [Entities]
WHERE [EntityTypeId] IN (SELECT [Id] FROM [EntityTypes] WHERE [Name]='CAJA') -- set Entity Type

The Template calls Handler @@ReporteCajas which contains the SQL Script. The SQL Script should not be in the Template.

1 Like

… additionally

[Reporte de Cajas:2, 2, 2, 2]
>Caja - Fecha|:Apertura|:Cierre|:Tarjetas
@@ReporteCajas

This template reads custom fields named Apertura, Cierre custom fields. Headers starting with : char defines that. As @shuhain_ismail used field names as Opening, Clojure, Cards headers should match custom field names.

1 Like

@emre @QMcKay
i am using the Spanish filed now but when i use English filed some value comes in report
report show no value… as i use filed name as defined in tutorial
will be helpful sample db provide

@shuhain_ismail you can drag drop images just inside the post edtior. No need to upload somewhere else. Can you try uploading them again? These are too small for my vision :slight_smile:

@emre

Enties


rule 1

rule 2

Action1

Action2

scrpit

work period start

Work period End

report sales

Custom Report

Did you also configured entity custom fields?

@emre
no i haven’t what do i need to put there

@gerlandog can you please add a screen shot for custom entity fields configuration?

sure!!!

G.

2 Likes

@gerlandog thanks
now to test it and translate it to English
Note also Custom field names are from database
for example
Apertura = opening

your database field names in Portuguese,