Finding times
On this page
A visit is booked only through the finder (Calendar → Book, or
talemo_find_times and then talemo_book_visit). Booking checks the chosen
start by the same rules again, so a booked visit is always one the finder would
offer.
What it asks
- For whom — the client's card. It is optional for a search, and with it the variants with whoever did the client's last visit come first, marked "last time". For booking there is also New client: a name and a number instead of a card (see Visits); the finder works for it without "last time": there is no card yet.
- In one visit — one or several services. The finder looks for time for all of them together. When no one master does them one right after another on that day but different masters can, the finder offers visits one after another (see “Two visits one after another” below).
- When — a month where a dot marks the days on which the people, places and devices that fit have free time for the whole visit. A day without a dot is all taken, a gray one has nobody working, a hatched one has no schedule. Pick a day to see the start times on the step of the branch, in the time of the branch: Morning (before 12:00), Afternoon (from 12:00), Evening (from 17:00). Nearest picks both the day and the time at once.
- Optionally the resources it must use. Who fits lists the masters, places and devices that can do the visit. If a resource picked from the grid menu does not fit the services of the visit, the finder refuses, and under the refusal Who fits stays for that role: the picked one has a cross — press it and the finder starts over without it, or pick another one from the list. The refusal names the picked one and the services that are not marked for it, and tells that if they need to be marked, this is done on its card, in Services.
What a variant is
A variant is a start, the resources that take it and two durations: Work and with cleanup. A start falls on the booking step ("Starts every N minutes — set in the booking rules"). Work must lie in the open time of every resource and be free of other visits; the cleanup of the last resource may go past the edge of the working day, and other visits wait for it. Past time is not offered.
For each of a master, a place and a device the visit needs, a resource is offered only if it is working, free and marked as doing every service of the visit that needs it (see Who does what).
The price of a variant
When a service has its own price for a level of masters (see Levels of masters), the price depends on who does it, so the finder names it per variant: the price of the whole visit and the price of each service, for the master of that variant. Two variants of the same time with different masters can differ. With no master named, a variant carries the price of the master the rule of the branch picked. A search can also be limited to the masters of one level. Without prices for levels nothing is added: every master takes the usual price.
Who gets a start
When no master is named and several are free at that start, the master of the client's
last visit goes first ("last time"), and then the rule of the branch for Any master picks:
Evenly, No gaps in the schedule or In order (see Booking rules). A
named master does not follow the rule. A place and a device do not follow it either: the less
busy one that day is taken, then by order of adding. Booking at the chosen start goes by the
same choice, so the visit lands with the master the finder showed. The outcome of each day
(days) does not depend on the rule.
Two visits one after another at different masters
A client asks, say, for a manicure and a haircut one right after the other, and on that day no master does both: the finder with in_turn then offers visits one after another. A leg is a visit of its own at its own master (the place and the device are chosen as for an ordinary visit); the next visit starts exactly where the one before it ends, and the order is the order the services were named in: the finder does not reorder it. The legs are as few as there can be for time to exist that day, and four at most. When one master does everything in a row, one visit is offered, not legs. A master the client named takes at least one leg, and the finder picks the others.
A variant with legs carries legs — for every leg its start, its service_ids and resource_ids, and the prices of its services. It is booked in one action: all the visits are booked or none, and when one leg does not fit, the refusal names its number (params.leg, from 1) and nothing is booked. For the notices these are visits back to back: Talemo writes one message about them when it fits (see Visit notices), and the answer of the booking says in client_hears whether the client gets it. The Calendar of the web app does not offer legs: there, two visits one after another at different masters are booked as two bookings; in the app the When they can come card offers “Book both”.
When there is nothing
The answer has one of these reasons, and each is an ordinary answer of the finder:
- No master has all these services marked together — no single master is marked for all the services that need a master. Free time is not searched; take a service out or mark a master.
- No place (or no device) has the services marked — some service of the visit has no
place or no device marked for it at all. Free time is not searched; mark the service on the
card of a place or a device (see Who does what);
fitsoftalemo_list_servicesshows who does which. - No schedule for these days — no day is laid out for the resources that fit. Nobody can be booked until the schedule is laid out (see Schedule of a resource).
- Not working in this window — everyone who fits has a day off or other hours. The time is not taken, it is not in the schedules.
- No free time in this window — everyone who fits is busy or not working.
With the last two the finder also offers the nearest free time after the window, if there is one in the next 90 days; the same visit can be booked there.
The calendar
talemo_get_calendar shows the grid of a branch for one to seven days, and the
Calendar grid a week: the resources, their open and busy time by day, the visits, and how many visits are not closed.
Who can use it
Finding times is its own right; the Administrator role has it. A role limited to own sees only the masters the person works as. The online admin uses the same finder for the client it is talking to, and it does not see which resources do not fit or why.
Tools and refusals
talemo_find_timestakesbranch_idandservice_ids(the IDs fromtalemo_list_services, in the order they are done) and optionally:party_id, so that the variants of the master of the client's last visit come first (they havelast_timetrue); a windowfromandto(a week when left out, 31 days at most) and a time of dayafterandbefore;resource_idswhen the person asked for particular ones;everyfor every start on the step instead of the earliest of each day for each master;limit, 1 to 10 (10 when left out); andvisit_idof a visit being moved, whose own time does not stand in the way, withkeep_masterto look for the move only at the master of the visit (below). The tool asks for visits one after another at different masters itself, instead of “nobody together”, except for a move: a move is one visit, so a search withvisit_idhas no legs. The answer is the short form of the finder; it hasoutcome:found—variantslists the starts. Each one hasresources— the master, the place and the device it needs, withresource_id,nameandrole— andservices(service_idand, when there is one,price);none_together— nobody does these services together;fitsoftalemo_list_servicesshows who does which. Take a service out or mark a master, a place or a device (see Who does what);none_free— everything is taken;day_off— nobody who fits works in the window: a day off, other hours than the asked time of day, or the time has passed. It is not busy time, so do not offer it: booking it is refused withvisit.outside_schedule, or withvisit.pastwhen the start has passed. A member of the business who still wants exactly that time books it withextend_scheduleonce the person has said yes to opening it (see Visits);no_schedule— the fitting resources have no schedule; lay it out first (see Schedule of a resource).
- When the window is empty,
nextis the nearest time beyond it within 90 days. - At most ten variants come, spread over the whole window rather than the first ten: the earliest and the latest start are among them. Those with
last_timetrue always come, and come first.moreistruewhen the finder found more than came, other starts or other masters at the same starts: do not tell the client that these are all the times. If none suits, find out when or with whom they would rather come, and call the finder again with a narrower window (from,to,after,before) or with a master inresource_ids. dayslists the dates of the window (the day by the clock of the branch) that have time free for the whole visit;limitdoes not change it. To see which days of a month have room, ask the whole month (31 days at most) withlimit1 and readdays.- Without
everythe answer is incomplete: it has only the earliest start of each day for each master, and a later time may be free. To check a time the person named, search witheveryand withafterandbeforearound it. - A resource named in
resource_idsthat cannot take its role is refused withvisit.resource_unfit,params.roleandparams.resource_id, as a booking would be: a master who does not do all the services, a place or a device that does none of the services of its role. It is notnone_together; name another resource or take the services apart. - A master not named in
resource_idsis chosen by the finder: first the master of the last visit ofparty_id, then the rule of the branch,any_master(seetalemo_get_booking_rules). - A variant goes as it is to
talemo_book_visit: itsstart, itsservice_ids(theservice_idof each entry ofservices) and theresource_idof each entry of itsresources. Do not build a start of your own. A variant withlegsgoes as itsstartand itslegs(each leg with itsservice_ids,resource_idsandprice, as the finder gave them), withoutservice_idsandresource_idsat the top; tell the client every leg: who does it (thenameof the entry ofresourceswith theresource_idof the leg) and when (thestartof the leg). - When a service of the visit has a price for a level, a variant has
price, the price of the visit, and each entry ofserviceshas itsprice, both for the master of that variant (nopricewhen no service has a price for a level, and for a role that may not see prices); each leg haspricetoo, the prices of its services in order. Name the price of the variant you offer, and book it with the same prices inpriceoftalemo_book_visit(of its leg, for a variant withlegs).level_id(thelevel_idof a master infitsoftalemo_list_services, ornonefor the masters with no level) looks at the masters of one level; a master named inresource_idsbeats it. - A move of a visit keeps to the specialist of the visit. With
visit_idthe answer hasvisit_master: theresource_idandnameof the specialist of that visit, andfree, whether the specialist has time in the window (why not — a day off, busy, switched off — the answer does not say). Withkeep_masterset totruethe finder looks only at the specialist of the visit whilefree:variantsanddaysare the specialist's. The tool setskeep_masteritself when there is avisit_idand noresource_idsorlevel_id. When the specialist of the visit has no time in those days,freeisfalseandvariantshold the time of the other specialists: tell the client that the specialist of the visit has no time, and name the specialist of every time you offer (theresource_idof the specialist is inresourcesof the variant, thenameof the specialist infitsoftalemo_list_services).keep_masterset tofalseis for a client who asked for any specialist or for another one; a specialist named inresource_idsandlevel_idbeatkeep_master. Withoutvisit_id,keep_masteris refused:request.body_invalid,params.fieldkeep_master. - With
visit_idthe answer also hasvisit_time: for each day of the window itsstart, the time of day the visit stands on laid on that day by the clock of the branch, andfree, whether the visit goes on thatstart. It is whattalemo_move_visitwould answer for that start, not a second guess: the specialist is the one named inresource_ids, otherwise the specialist of the visit, the visit has its services as booked, and the place and device of the visit are kept while they are free. When the person asks to move a visit to the same time, take thestartof the asked day fromvisit_timeand pass it totalemo_move_visit; never the earliest start of the day invariants, which is another time. Whenfreeisfalseon that day, say so and offervariants. A member of the business also getsreasonfor a day that is not free:taken(busy),closed(outside the open time: say what would open and ask, as for a booking outside it),past,off_step(not on the step of the branch) orunfit(the specialist or place of the visit cannot take it). The online admin gets noreason.visit_timedoes not change withkeep_master,level_id,after,before,everyorlimit, and a visit that took place or was canceled has none. talemo_get_calendarshows the grid of a branch for one to seven days with the schedules, the visits, canceled ones too, andunclosed_count. When the person sees just the visits of the resources linked to them, it also givesown_resource_ids(see Visits and their statuses).- Every outcome is an ordinary answer of the finder, not a failure. Tell the person which one it is and what would change it.