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