Hotel Rooms (Entity?)

am little bit late on this but i hope i can still catch up,Hope JTRTech hasn’t trashed the DB yet.

@JTRTech, Need your help whenever you are free. On Image #5, I am having challenges finding the Action Type that has the Fields displayed.

It’s a big thread, which action?

Room%20Booking%20System

The Fields Under Booking Cash/Card Payment

It is a ‘Create Account Transaction Document’ action.
You will obviously need corresponding tens document for payments to room entity accounts. If unsure compare to the default customer account payment documents.

2 Likes

Hey @JTRTech, I have added this to my Script but I do not know what to put under the Handler. Please help

What script was that sorry? Dont remember there being a script in this setup but was a while ago…

function accountbalance(accountname)
{
var qry = "
SELECT
sum([Debit])-sum([Credit]) as [Balance]

FROM [dbo].[AccountTransactionValues] tv
LEFT JOIN [Accounts] a ON a.[Id] = tv.[AccountId]
LEFT JOIN [Entities] e ON e.[AccountId] = a.[Id]

WHERE 1=1
AND a.[Name] = ‘"+accountname+"’";

var balance = sql.Query(qry).First;
return balance;
}

function BalanceFromEntityGridBookingNumberSetting()
{
var qry1 = “SELECT [Value] FROM [ProgramSettingValues] WHERE [Name]=’”+‘EntityGridBookingNumber’+"’";
var accountname = sql.Query(qry1).First;
var qry2 = "
SELECT
sum([Debit])-sum([Credit]) as [Balance]
FROM [dbo].[AccountTransactionValues] tv
LEFT JOIN [Accounts] a ON a.[Id] = tv.[AccountId]
LEFT JOIN [Entities] e ON e.[AccountId] = a.[Id]
WHERE 1=1
AND a.[Name] = ‘"+accountname+"’";

var balance = sql.Query(qry2).First;
return balance;
}

Oh, ok.
Handler is irreverent to the script itself so long as the call to the script uses the handler.
Handler is just the name the script is saved under.

{CALL:handler.function(‘variable’)}

2 Likes

Hello all.
I have followed all the steps and setup the Actions, Rules, Auto commands and Entities but am not getting it to work like the gif at the top of this post. Does anyone have more detailed steps and screen shots on how my setup must be? TIA.

Its quite a complex setup, dont think i have that database handly anymore as prefered the option of using a dedicated booking system and intergrating with that.
It did work so likely skmething missed along the way but not given much to go on.

Hi Joe,
Thank you for your response. I will send you screen shots of my setup. Maybe you will see something I missed.

Hello Joe,
Here are my Actions.

1
2
3
4
5
6
7
8
9
10
11
12
13


15
16

My Rules.

17
18
19
20


22
23
24
25

And my Mapping for all the Rules.

Hi Joe,
How did you get this working? I can’t get them to link when using Entity Grid.


What do you mean by link? You mean the gid doesnt change when making a booking? Looks like your rooms maybe arnt showing/displaying the entity state formatting.

Hello Joe, I got the Entity screen working but my next problem is assigning the account number to the ticket so that it can be added to the booking account.
Screenshot 2024-08-16 102944
How did your flow work to get the Booking number and Entity Selected to show on the ticket?
Screenshot 2024-08-16 103029
How do I get this to automatically select the correct Ticket ID to cash out / close the booking account?

its been like 7 years since did this proof of concept, I don’t have that DB anymore and barely remember the full flow and in fairness cant be expected to go through 8 years of posts on a topic to relearn/refresh my memory.
I am lost as to the issue your asking.
You have the booking entity selected yes?
So on settle you would charge to the booking account no?

Screenshot 2024-08-16 103029

whats re you screenshotting here?
transaction type?
are the accounts being created on entity creation action? I want to say target should be blank anditwill use the selected entity account but dont quote me on it

This is mine.
image
On settle it does not assign it to a specific account just the booking account in general.

There isnt account for the entity shown, sure a account has been created for that booking entity?