The Jobs plugin

The lino_welfare.modlib.jobs plugin provides functionality for managing job supplyments.

See also jobs : Job supplyments.

Dependencies

This plugin needs the lino_welfare.modlib.isip plugin.

Jobs

The central concept added by this module is a table of jobs.

>>> ses = rt.login('rolf')
>>> ses.show(jobs.Jobs, column_names="function provider sector", language="de")
... 
=================== ================================ ==========================
 Berufsbezeichnung   Stellenanbieter                  Sektor
------------------- -------------------------------- --------------------------
 Kellner             BISA                             Horeca
 Kellner             R-Cycle Sperrgutsortierzentrum   Landwirtschaft & Garten
 Koch                BISA                             Seefahrt
 Koch                Pro Aktiv V.o.G.                 Unterricht
 Küchenassistent     Pro Aktiv V.o.G.                 Medizin & Paramedizin
 Küchenassistent     R-Cycle Sperrgutsortierzentrum   Reinigung
 Tellerwäscher       BISA                             Transport
 Tellerwäscher       R-Cycle Sperrgutsortierzentrum   Bauwesen & Gebäudepflege
=================== ================================ ==========================

Job providers

A job provider (Stellenanbieter, Partenaire social) is an organisation where the work will be executed. They are not necessarily also the employer. It may be either some public service or a private company.

Employeur ou Services utilisateur

The JobProvider model is a polymorphic specialization (“MTI child”) of contacts.Company.

>>> ses.show(jobs.JobProviders)
... 
================================ ============ ================ ========= ======= ===== =========
 Name                             Adresse      E-Mail-Adresse   Telefon   Handy   ID    Sprache
-------------------------------- ------------ ---------------- --------- ------- ----- ---------
 BISA                             4700 Eupen                                      188   de
 Pro Aktiv V.o.G.                 4700 Eupen                                      191   de
 R-Cycle Sperrgutsortierzentrum   4700 Eupen                                      189   de
================================ ============ ================ ========= ======= ===== =========
class lino_welfare.modlib.jobs.JobProvider
is_social

Organisation bénéficiant de l’agrément « Initiative d’économie sociale » octroyé par la Wallonie.

Cet agrément vise à soutenir la mise en place de projets à finalité sociale et l’insertion socioprofessionnelle de travailleurs peu qualifiés par le biais d’une activité économique. https://economie.wallonie.be/Dvlp_Economique/Economie_sociale/AgrementES.html

Job Offers

>>> # settings.SITE.catch_layout_exceptions = False
>>> ses.show(jobs.Offers)  
======================== ================== ========================= =================== ================ ============== =============
 Name                     Stellenanbieter    Sektor                    Berufsbezeichnung   Beginn Auswahl   Ende Auswahl   Beginndatum
------------------------ ------------------ ------------------------- ------------------- ---------------- -------------- -------------
 Übersetzer DE-FR (m/w)   Pro Aktiv V.o.G.   Landwirtschaft & Garten   Kellner             22.01.14         02.05.14       01.06.14
======================== ================== ========================= =================== ================ ============== =============

Experiences by Job Offer

This table shows the Experiences which satisfy a given Job offer.

Example:

>>> obj = jobs.Offer.objects.get(pk=1)
>>> ses.show(jobs.ExperiencesByOffer, obj)
... 
============ ========== ==================== =================================== ==========
 Beginnt am   Enddatum   Klient               Organisation                        Land
------------ ---------- -------------------- ----------------------------------- ----------
 07.02.11     07.03.11   LAZARUS Line (144)   Belgisches Rotes Kreuz              Andorra
 04.04.11     04.04.13   JONAS Josef (139)    Pharmacies Populaires de Verviers   Botswana
============ ========== ==================== =================================== ==========

Candidatures by job offer

This table shows the Candidatures which satisfy a given Job offer.

Example:

>>> obj = jobs.Offer.objects.get(pk=1)
>>> ses.show(jobs.CandidaturesByOffer.request(obj))
... 
============== ======================= ======== ====================
 Anfragedatum   Klient                  Stelle   Kandidatur-Zustand
-------------- ----------------------- -------- --------------------
 02.05.14       MALMENDIER Marc (146)            Inaktiv
 27.06.14       KAIVERS Karl (141)               Arbeitet
============== ======================= ======== ====================
>>> ses.show(jobs.ContractTypes)  
=========================== ==========
 Bezeichnung                 Referenz
--------------------------- ----------
 Sozialökonomie              art60-7a
 Sozialökonomie - majoré     art60-7b
 Stadt Eupen                 art60-7e
 mit Rückerstattung          art60-7c
 mit Rückerstattung Schule   art60-7d
=========================== ==========

Contracts

class lino_welfare.modlib.jobs.Contracts

Shows all Art60 job supplyments.

class lino_welfare.modlib.jobs.ContractsByClient

Shows the Art60 job supplyments for this client.

class lino_welfare.modlib.jobs.JobSupplyment

Model mixin for jobs.Contract and art61.Contract. And also for art60.Contract.

duration

The duration of this job supplyment (number of working days).

Show all contracts

Via :menuselection`Explorer –> DSBE –> Art.60§7-Konventionen` you can see a list of all job supplyment contracts.

>>> show_menu_path(jobs.Contracts)
Explorer --> DSBE --> Art.60§7-Konventionen

The demo database contains 16 job supplyment contracts:

>>> ses.show(jobs.Contracts)  
==== ============================= =============== ============== ========== ==================================================== ========================= ===========================
 ID   Klient                        NR-Nummer       Laufzeit von   Enddatum   Stelle                                               Verantwortlicher (DSBE)   Art
---- ----------------------------- --------------- -------------- ---------- ---------------------------------------------------- ------------------------- ---------------------------
 1    COLLARD Charlotte (118)       960715 002-61   06.10.12       05.10.13   Kellner bei BISA                                     Alicia Allmanns           mit Rückerstattung Schule
 2    EVERTZ Bernd (126*)           890722 001-93   20.10.12       19.04.14   Kellner bei R-Cycle Sperrgutsortierzentrum           Alicia Allmanns           Sozialökonomie
 3    FAYMONVILLE Luc (130*)        890202 001-76   17.11.12       16.11.13   Koch bei BISA                                        Alicia Allmanns           Sozialökonomie - majoré
 4    FAYMONVILLE Luc (130*)        890202 001-76   17.11.13       17.11.14   Koch bei Pro Aktiv V.o.G.                            Hubert Huppertz           Sozialökonomie
 5    HILGERS Hildegard (133)       870325 002-29   01.12.12       30.11.14   Küchenassistent bei Pro Aktiv V.o.G.                 Alicia Allmanns           Stadt Eupen
 6    LAMBERTZ Guido (142)          810823 001-96   29.12.12       28.12.14   Küchenassistent bei R-Cycle Sperrgutsortierzentrum   Alicia Allmanns           Sozialökonomie - majoré
 7    MALMENDIER Marc (146)         791013 001-77   12.01.13       11.01.14   Tellerwäscher bei BISA                               Alicia Allmanns           Stadt Eupen
 8    MALMENDIER Marc (146)         791013 001-77   12.01.14       12.01.15   Tellerwäscher bei R-Cycle Sperrgutsortierzentrum     Mélanie Mélard            mit Rückerstattung
 9    RADERMACHER Christian (155)   761227 001-93   09.02.13       08.02.14   Kellner bei BISA                                     Alicia Allmanns           mit Rückerstattung Schule
 10   RADERMACHER Christian (155)   761227 001-93   09.02.14       09.02.15   Kellner bei R-Cycle Sperrgutsortierzentrum           Mélanie Mélard            Sozialökonomie
 11   RADERMACHER Fritz (158*)      750805 001-25   23.02.13       22.02.15   Koch bei BISA                                        Alicia Allmanns           Sozialökonomie - majoré
 12   VAN VEEN Vincent (166)        710528 001-06   23.03.13       22.03.15   Koch bei Pro Aktiv V.o.G.                            Alicia Allmanns           Sozialökonomie
 13   RADERMECKER Rik (173)         730407 001-89   06.04.13       05.04.14   Küchenassistent bei Pro Aktiv V.o.G.                 Caroline Carnol           Stadt Eupen
 14   RADERMECKER Rik (173)         730407 001-89   06.04.14       06.04.15   Küchenassistent bei R-Cycle Sperrgutsortierzentrum   Hubert Huppertz           Sozialökonomie - majoré
 15   DENON Denis (180*)            950810 001-04   04.05.13       03.05.14   Tellerwäscher bei BISA                               Alicia Allmanns           Stadt Eupen
 16   DENON Denis (180*)            950810 001-04   04.05.14       04.05.15   Tellerwäscher bei R-Cycle Sperrgutsortierzentrum     Hubert Huppertz           mit Rückerstattung
==== ============================= =============== ============== ========== ==================================================== ========================= ===========================

Use the filter parameters to show e.g. only contracts that were active on 2012-11-18:

>>> pv = dict(observed_event=isip.ContractEvents.active,
...     start_date=i2d(20121118), end_date=i2d(20121118))
>>> kwargs = dict()
>>> kwargs.update(param_values=pv)
>>> ses.show(jobs.Contracts, **kwargs)
... 
==== ========================= =============== ============== ========== ============================================ ========================= ===========================
 ID   Klient                    NR-Nummer       Laufzeit von   Enddatum   Stelle                                       Verantwortlicher (DSBE)   Art
---- ------------------------- --------------- -------------- ---------- -------------------------------------------- ------------------------- ---------------------------
 1    COLLARD Charlotte (118)   960715 002-61   06.10.12       05.10.13   Kellner bei BISA                             Alicia Allmanns           mit Rückerstattung Schule
 2    EVERTZ Bernd (126*)       890722 001-93   20.10.12       19.04.14   Kellner bei R-Cycle Sperrgutsortierzentrum   Alicia Allmanns           Sozialökonomie
 3    FAYMONVILLE Luc (130*)    890202 001-76   17.11.12       16.11.13   Koch bei BISA                                Alicia Allmanns           Sozialökonomie - majoré
==== ========================= =============== ============== ========== ============================================ ========================= ===========================

Use the filter parameters to show e.g. only contracts that started in October 2012:

>>> pv.update(observed_event=isip.ContractEvents.started,
...     start_date=i2d(20121001), end_date=i2d(20121030))
>>> ses.show(jobs.Contracts, **kwargs)
... 
==== ========================= =============== ============== ========== ============================================ ========================= ===========================
 ID   Klient                    NR-Nummer       Laufzeit von   Enddatum   Stelle                                       Verantwortlicher (DSBE)   Art
---- ------------------------- --------------- -------------- ---------- -------------------------------------------- ------------------------- ---------------------------
 1    COLLARD Charlotte (118)   960715 002-61   06.10.12       05.10.13   Kellner bei BISA                             Alicia Allmanns           mit Rückerstattung Schule
 2    EVERTZ Bernd (126*)       890722 001-93   20.10.12       19.04.14   Kellner bei R-Cycle Sperrgutsortierzentrum   Alicia Allmanns           Sozialökonomie
==== ========================= =============== ============== ========== ============================================ ========================= ===========================

Evaluations of a project

>>> obj = jobs.Contract.objects.get(pk=6)
>>> print(str(obj.client))
LAMBERTZ Guido (142)
>>> obj.active_period()
(datetime.date(2012, 12, 29), datetime.date(2014, 12, 28))
>>> obj.get_recurrence_set()
ExamPolicy #3 ('Alle 3 Monate')
>>> print(str(obj.get_recurrence_set().event_type))
Auswertung
>>> print(obj.get_recurrence_set().event_type.max_conflicting)
4
>>> [str(i.start_date) for i in obj.get_existing_auto_events()]
['2013-04-02', '2013-07-02', '2013-10-02', '2014-01-02', '2014-04-02', '2014-07-02', '2014-10-02']
>>> with ses.capture_logger('DEBUG') as out:
...     wanted, unwanted = obj.get_wanted_auto_events(ses)
>>> print(out.getvalue())  
Generating events between 2013-03-29 and 2014-12-28 (max. 72).
Évaluation 1 wants 2013-03-29 but conflicts with <QuerySet [Event #77 ('Karfreitag (29.03.2013)')]>, moving to 2013-04-01.
Évaluation 1 wants 2013-04-01 but conflicts with <QuerySet [Event #58 ('Ostermontag (01.04.2013)')]>, moving to 2013-04-02.
Reached upper date limit 2014-12-28 for 7
>>> settings.SITE.site_config.update(hide_events_before=None)
>>> ses.show(cal.EntriesByController.request(obj),
... column_names="when_html summary")
... 
================ ==================
 Wann             Kurzbeschreibung
---------------- ------------------
 *Do. 02.10.14*   Évaluation 7
 *Mi. 02.07.14*   Évaluation 6
 *Mi. 02.04.14*   Évaluation 5
 *Do. 02.01.14*   Évaluation 4
 *Mi. 02.10.13*   Évaluation 3
 *Di. 02.07.13*   Évaluation 2
 *Di. 02.04.13*   Évaluation 1
================ ==================

Mélanie has two appointments on 2014-09-15:

>>> from django.db.models import Count
>>> from lino.utils import SumCollector
>>> sc = SumCollector()
>>> for e in cal.Event.objects.filter(event_type__is_appointment=True):
...     sc.collect((e.user.username, e.start_date), 1)
>>> for username_date, count in sc.items():
...     if count > 1:
...         print("{1} has {0} appointments on {2}".format(count, *username_date))
...         break
melanie has 2 appointments on 2013-10-09
>>> d = i2d(20131009)
>>> pv = dict(start_date=d, end_date=d)
>>> ses.show(cal.EntriesByDay.request(param_values=pv),
...     column_names="user start_date start_time summary project")
... 
================= ============ ============ ================== ==========================
 Verwaltet durch   Beginnt am   Beginnt um   Kurzbeschreibung   Klient
----------------- ------------ ------------ ------------------ --------------------------
 Mélanie Mélard    09.10.13     09:00:00     Évaluation 2       AUSDEMWALD Alfons (116)
 Mélanie Mélard    09.10.13     09:00:00     Évaluation 9       LAZARUS Line (144)
 Alicia Allmanns   09.10.13     09:00:00     Évaluation 8       RADERMACHER Alfons (153)
================= ============ ============ ================== ==========================

The two appointments conflict, at least strictly speaking. This is because the EventType of these automatically generated evaluation appointments is configured to allow for up to 4 conflicting events:

>>> e = cal.EntriesByDay.request(param_values=pv).data_iterator[0]
>>> e.event_type
EventType #6 ('Auswertung')
>>> e.event_type.max_conflicting
4

After modifying hide_events_before we must tidy up and reset it in order to not disturb other test cases:

>>> settings.SITE.site_config.update(hide_events_before=i2d(20140401))

JobsOverview

The JobsOverview report helps integration agents to make decisions like:

  • which jobs are soon going to be free, and which candidate(s) should we suggest?

Example content:

>>> ses.show(jobs.JobsOverview)
----------------------------
Sozialwirtschaft = "majorés"
----------------------------

+----------------------------------------------------------------------------------------------+--------------------------------------------------------+-------------------------------------+--------------------------------------+
| Stelle                                                                                       | Arbeitet                                               | Probezeit                           | Kandidaten                           |
+==============================================================================================+========================================================+=====================================+======================================+
| `Kellner <Detail>`__ bei `R-Cycle Sperrgutsortierzentrum <Detail>`__ (1) *Sehr harte Stelle* | `RADERMACHER Christian (155) <Detail>`__ bis 09.02.15  | `FAYMONVILLE Luc (130*) <Detail>`__ | `JEANÉMART Jérôme (181) <Detail>`__  |
+----------------------------------------------------------------------------------------------+--------------------------------------------------------+-------------------------------------+--------------------------------------+
| `Koch <Detail>`__ bei `Pro Aktiv V.o.G. <Detail>`__ (1)                                      | `VAN VEEN Vincent (166) <Detail>`__ bis 22.03.15 |br|  | `EMONTS-GAST Erna (152) <Detail>`__ | `JACOBS Jacqueline (137) <Detail>`__ |
|                                                                                              | `FAYMONVILLE Luc (130*) <Detail>`__ bis 17.11.14       |                                     |                                      |
+----------------------------------------------------------------------------------------------+--------------------------------------------------------+-------------------------------------+--------------------------------------+

------
Intern
------

+------------------------------------------------------------------------------------------------------+------------------------------------------------------+--------------------------------------+------------------------------------+
| Stelle                                                                                               | Arbeitet                                             | Probezeit                            | Kandidaten                         |
+======================================================================================================+======================================================+======================================+====================================+
| `Koch <Detail>`__ bei `BISA <Detail>`__ (1)                                                          | `RADERMACHER Fritz (158*) <Detail>`__ bis 22.02.15   | `AUSDEMWALD Alfons (116) <Detail>`__ | `MEESSEN Melissa (147) <Detail>`__ |
+------------------------------------------------------------------------------------------------------+------------------------------------------------------+--------------------------------------+------------------------------------+
| `Küchenassistent <Detail>`__ bei `R-Cycle Sperrgutsortierzentrum <Detail>`__ (1) *Sehr harte Stelle* | `LAMBERTZ Guido (142) <Detail>`__ bis 28.12.14 |br|  | `BRECHT Bernd (177) <Detail>`__      | `JONAS Josef (139) <Detail>`__     |
|                                                                                                      | `RADERMECKER Rik (173) <Detail>`__ bis 06.04.15      |                                      |                                    |
+------------------------------------------------------------------------------------------------------+------------------------------------------------------+--------------------------------------+------------------------------------+

----------------------------------------------
Extern (Öffentl. VoE mit Kostenrückerstattung)
----------------------------------------------

================================================================================================================== =================================================== ================================= ==================================
 Stelle                                                                                                             Arbeitet                                            Probezeit                         Kandidaten
------------------------------------------------------------------------------------------------------------------ --------------------------------------------------- --------------------------------- ----------------------------------
 `Küchenassistent <Detail>`__ bei `Pro Aktiv V.o.G. <Detail>`__ (1) *No supervisor. Only for independent people.*   `HILGERS Hildegard (133) <Detail>`__ bis 30.11.14   `JONAS Josef (139) <Detail>`__
 `Tellerwäscher <Detail>`__ bei `BISA <Detail>`__ (1)                                                                                                                   `KAIVERS Karl (141) <Detail>`__   `EMONTS Daniel (128) <Detail>`__
================================================================================================================== =================================================== ================================= ==================================

------------------------------------
Extern (Privat Kostenrückerstattung)
------------------------------------

+--------------------------------------------------------------------------------+-------------------------------------------------------+---------------------------------+--------------------------------------+
| Stelle                                                                         | Arbeitet                                              | Probezeit                       | Kandidaten                           |
+================================================================================+=======================================================+=================================+======================================+
| `Tellerwäscher <Detail>`__ bei `R-Cycle Sperrgutsortierzentrum <Detail>`__ (1) | `MALMENDIER Marc (146) <Detail>`__ bis 12.01.15 |br|  | `ENGELS Edgar (129) <Detail>`__ | `RADERMACHER Guido (159) <Detail>`__ |
|                                                                                | `DENON Denis (180*) <Detail>`__ bis 04.05.15          |                                 |                                      |
+--------------------------------------------------------------------------------+-------------------------------------------------------+---------------------------------+--------------------------------------+

--------
Sonstige
--------

================================================ ========== ===================================== =================================
 Stelle                                           Arbeitet   Probezeit                             Kandidaten
------------------------------------------------ ---------- ------------------------------------- ---------------------------------
 `Kellner <Detail>`__ bei `BISA <Detail>`__ (1)              `RADERMACHER Hedi (161) <Detail>`__   `ENGELS Edgar (129) <Detail>`__
================================================ ========== ===================================== =================================

Printing this report caused a “NotImplementedError: <i> inside <text:p>” traceback when one of the jobs had a remark.

>>> settings.SITE.default_build_method = "appyodt"
>>> obj = ses.spawn(jobs.JobsOverview).create_instance()
>>> rv = ses.run(obj.do_print)  
appy.pod render .../lino/modlib/printing/config/report/Default.odt -> .../media/webdav/userdocs/appyodt/jobs.JobsOverview.odt
>>> print(rv['success'])
True
>>> print(rv['open_url'])
... 
/.../jobs.JobsOverview.odt

This bug was fixed 2013-04-23. Note: the webdav/ is only there when lino.core.site.Site.use_java is True.

Configuration

jobs.with_employer_model

Set this to True if you want to differentiate between two types of job providers, “services utilisateurs” and “employers”.