Page 1 of 1

data import / exprot

Posted: Fri Jan 23, 2015 10:19 pm
by arrt
Hello Forum members

I am testing Hoteldruid and i am positive so far. Not being very technical in the field of php and html, I wonder if it is possible to import and export data with Hoteldruid.

I would like to import our existing client data into Hoteldruid. And i would need to export data from Hoteldruid to use this data for my bookkeeping program. Probably thus could work with Csv or text files using excel.

if anybody has experience or suggestions?

Re: data import / exprot

Posted: Fri Jul 03, 2015 10:47 am
by Martin Pusch
I can show you how I did the export of data. For the import of data, I don't have a suggestion for now.

I prepared a document, configured as follows:
Image
So the format is TXT.
Multi-Language is off.
Extension for viewing and downloading the document: custom, .csv

Inside the document, I put two lines of text:

Code: Select all

surname;occupied_unit;starting_date;ending_date;people_num_tot;periods_num;rate_name;rate_price;price_tot;paid;rest_to_pay;
[r][surname];[occupied_unit];[starting_date];[ending_date];[people_num_tot];[periods_num];[rate_name];[rate_price];[price_tot];[paid];[rest_to_pay];[new_line][/r]
The first line represents the head of columns in the table I want to export. This is just a kind of name of the column. To delimit the columns, I have chosen the sign ";". So, in my case, the name of the first column is "surname", the name of the second column "occupied_unit" and so on.

In the second line, there are the fields I want to have in my table, also with ";" to delimit the columns. The [r] at the beginning of the line and the [/r] at the end of line will repeat this line for every reservation on the page. The [new_line] will help to have a new line for each reservation.

When I open a table with all reservations, or just the current reservations, I can now choose at the bottom of the page the document I prepared, ant click the View-button. My browser will then export the list as a CSV-file. This file can be opened with Excel or OpenOffice. To import the file in OpenOffice, I have to choose "UTF-8", and the correct separator ";".

Perhaps you will have to correct the date format (perhaps a date formatted like 03-07-2015 is not recognized as a date). What I do: I highlight the columns containing dates, and let the program search and replace the "-" by the correct character (search only in the highlighted columns).

This works for me for now. In the future, I want to change the date format directly in the document, using some custom variables, to avoid the "search and replace" part after opening the new document.

Re: data import / exprot

Posted: Sun Oct 11, 2015 2:44 am
by bluealmondhostel
that's awesome Martin.

Re: data import / exprot

Posted: Tue Oct 13, 2015 11:47 am
by softfaber
Yes Martin, really awesome.
I used your solution for my purposes, nice!
Henry

Re: data import / exprot

Posted: Sun Nov 01, 2015 8:41 pm
by AndilgE
Hi Martin,

That's nice, works as document for every single reservation like a charm. What I would love to have is some kind of bulky export, stating all reservation of a week or month that can be determined. This would help us with the countability and save much time.

On what concerns the date separator this can be solved in HotelDruid with custom variables which later can be assigned to your documents. The example for changing starting date with format 25-06-2099 into 25/06/2099 is

1. create a new custom variables with unique name (let's name it [my_starting_date])
2. Set up rule 'Put [my_starting_date] equal to [starting_date] replacing "-" with "/"
3. Change the variables in your documents from [starting_date] to [my_starting_date].

This can be done for all variables treating dates. It sounds complicated but is easier than one might believe.

Happy HotelDruiding and brgs

Andi

Re: data import / exprot

Posted: Mon Nov 02, 2015 1:56 pm
by AndilgE
.. just to correct my last post:

I've found out that the export can be made for several bookings be accessing the month table und underneath of it choose the document that you want to execute. This gives a wonderful export of all bookings, rooms, financial info and so on in a csv file as Martin describes above.

For me, this one is sticky, most useful.

Happy HotelDruiding

Andi

Re: data import / exprot

Posted: Sat Nov 14, 2015 12:00 am
by kyomar
Thanks a lot Martin for this script (and arrt for bringing up this subject), it's very useful. It shows the huge potential hoteldruid has.

Re: data import / exprot

Posted: Tue Dec 01, 2015 4:02 pm
by marco
Hello,
I hope to add a document to export data similar to this one to default documents in one of the next versions.

Regards,
Marco

Re: data import / exprot

Posted: Thu Oct 13, 2016 4:27 pm
by softfaber
Hi there,
Is anybody able to export also statistics from HotelDruid?
I'd like to to that, also because you can have statistics only for the last 5 years.
Thanks for any tip