Никита Ремизов - Случай использования drupal как erp...
DESCRIPTION
Никита Ремизов - Случай использования Drupal как ERP системы Событие: Drupal White Nights 2014 Дата: 07.06.2014 Анонс: http://camp2014.drupalspb.org/sessions/sluchay-ispolzovaniya-drupal-kak-erp-sistemyTRANSCRIPT
CASE OF USING DRUPAL 7 AS ERP SYSTEM
CAN DRUPAL BE MORE THAN CMS, LMS, HRM, PMS, FMS?
YES, IT CAN
WHO ARE YOU?
ABOUT ME
Working with Drupal for 3 years already.
Web-Developer СТО in Retail Navigator Company Maintainer of a few Drupal modules
@Niremizov
Contacts
Twitter: @Niremizov E-mail: [email protected] Website: http://golbin.ru
WHAT IS RETAIL NAVIGATOR?
ABOUT COMPANY
BTL services: Promoters Merchandisers Supervisors
@Niremizov
More than 700 employees across RussiaWeb-site: http://retail-navigator.ru/
DRUPAL 7 AS ERP
A long time ago in a galaxy far, far away…The development of the ERP system based on Drupal 7 has began (2011-12-19 2 years 6 month ago – Has been made a first commit)“This is insane!“ – they yield. But I knew,
Drupal you are out last hope!
Foreword: Why Drupal?
A lot of power – just from the box• Node• Fields• Taxonomy• Users• Blocks• File• Forms• Menu
What about other Frameworks?- Initially, Drupal attracts by its simplicity of “first use”, after by its
flexibility- Required: not 1C
Russia, Saint-Petersburg 2014
Chapter I – Unsuccessful attemptAfter creating first module (Sell Field), that was
supposed to solve reports collection task, new questions appeared:
Russia, Saint-Petersburg 2014
• How to manage users that will insert this data? (About 700 employees)
• How to accept or decline report?• How to relate report and project? Wait, project is?• How to calc bonuses earned by Employee after
report has been accepted?• Etc…
CHAPTER I – UNSUCCESSFUL ATTEMPT
Where to begin development of ERP system?
1. Information gathering
2. UML / Split to subsystems
4. Code, code, code
Russia, Saint-Petersburg 2014
3. UI Visualization
http://gomockingbird.com/
UML EXAMPLE
Russia, Saint-Petersburg 2014
The aim – is to automate business process in each department.
Control Human Resources Gather sales reportsLearning management
Russia, Saint-Petersburg 2014
CHAPTER II – MOVING TO THE AIM
• HR manager• HR coordinator
• Teacher • Promoters / Supervisors
• Project leader
Roles:
PMS + HRM
PROJECT(NODE)
WORKING CONDITIONS(ENTITY API)
FORMS(NODE)
VACANCIES(ENTITY)
Russia, Saint-Petersburg 2014
1. Manager creates project2. Manager creates working conditions on the
project3. Manager creates vacancies on the project, and
sends them to HR department4. HR coordinator appoints vacancy to certain
manager. (Or manager can do it by himself.)5. HR adding to new (FORMS?) to ERP (1st interview)6. If applicants passed 2nd interview – Manager
changes FORM status to employee7. Employee works on schedule
Adapted workflow of recruitment
*
1
*1
*Entity Reference + Field Collection
Entity Property
SHIFT(EVENTE)
1 *
1
Russia, Saint-Petersburg 2014
Russia, Saint-Petersburg 2014
Russia, Saint-Petersburg 2014
Vacancy creation Form
FORMS – COMPOUND FIELD
Forms are nodes with 30+ fields, including Field Collection. But there could be more if we were not created or own “Compound Field” module.
Compound fieldMultifield FieldCollection
Russia, Saint-Petersburg 2014
1 Table per Field
1 Table for all Fields
1 Table for all Fields
Multifield modules comparison: https://groups.drupal.org/node/135229Compound Field Sandbox: https://drupal.org/sandbox/niremizov/2274055
Reuses code of each fields
Reuses code of each fields
No code reuse
FORMS – COMPOUND FIELD
Russia, Saint-Petersburg 2014
3 Fields 1 Table
FORMS - WEBCAM WIDGET
Applicants must provide a photo during form creation. Managers must have an ability to change this photo.
Russia, Saint-Petersburg 2014
Pic. Of Webcam-widget module during Node creation.
Webcam Widget (Custom)+Allows to change widget depending on role
Webcam field widget (Sandbox)
EVENT ENTITY (SHIFT)
Russia, Saint-Petersburg 2014
What is event? – It is combination of:• Description (Host entity)• Place (Taxonomу ref)• Organizer (author in most cases),• Comment• Status• Attendees (Separate entity)• Date (Field)
Russia, Saint-Petersburg 2014
ONE LINE CALENDAR
Module adds Views Style Plugin | Sandbox https://drupal.org/sandbox/Niremizov/1856118
LMS
FORMS(NODE)
VACANCIES(ENTITY)
Russia, Saint-Petersburg 2014
1. Manager gather group of employees for training. *Other managers if needed can attach their employees to the created training. (Sing up)
2. After the training, teacher inputs data of attended employees to the system.
3. Employees passes Quizzes.4. After each employee on vacancy finished
Course, “learning percent” vacancy’s property equals to 100%
Adapted workflow of Learning System
USER(ENTITY)
COURSE(NODE)
COURSEOBJECT (ENTITY)
TRAINING(EVENTE)
QUIZ (NODE)
Course Module / LMS
*
1
1
1
1
1
Relation + Relation Unique
HRM
FULLFILMENT
(ENTITY)
COURSE
Use Enity API: hook_entity_insert() or hook_entity_update()
Russia, Saint-Petersburg 2014
How to track Course completion?
How to Sync Objects between Courses?
hook_course_enroll(), hook_entity_update()
Use Course API - hook_course_handlers()Course module uses Ctools
How to create own Course Objects?
EVENT ENTITY SIGNUP (TRAININGS)
How to enroll users on event? Create Custom Event Entity Sing Up module.
1. Additional Event Signup functionality only for chosen event bundles.
2. Action to enroll employees on new event or to existed one3. “Comment on signup” action, to comment on attendance of employee
Russia, Saint-Petersburg 2014
Reports + FMS
CHECK(ENTITY API)
REPORT(ENTITY API)
Russia, Saint-Petersburg 2014
1. After work hours employee fills their reports.2. Managers approve or decline their reports3. In case if report was approved – positive
transaction created.4. In the end of the month (for ex.) managers
creates checks for employees5. Manager creates invoice for the client
Adapted workflow of Reports & Finance management
USER
TRANSACTION
(ENTITY API)
WALLET(ENTITY API)
INVOICE(ENTITY API)
Reports
PROJECT(NODE)
ACTIVITY(TAXONOMY
TERM)
BONUS(ENTITY)
REPORT(ENTITY)
Russia, Saint-Petersburg 2014
Few details to mention about Bonuses
• Bonus can be a static value, or percent from activity cost
• Bonuses create separately for each project
• Activity TID• Activity price• Calced Bonus• Photos (Files)• Dates (Created, Modified)• Status
• Project NID
Reports consist of
Russia, Saint-Petersburg 2014
Russia, Saint-Petersburg 2014
CHAPTER III – PERFOMANCE
• cache_set() / cache_get()• APC
Average page load: 1,4 seconds (without problem pages 800 milliseconds)Maximum page load: 25,4 seconds
Project plans pages – 4.6 secondsCourse Outline pages – 15,1 seconds
Average page load time
Measures to increase performance
USED MODULES
Russia, Saint-Petersburg 2014
Totally used: 164 modulesSystem modules: 23Custom modules: 22Contrib modules: 119
Entity APIFeedsFeaturesRelation (?)Rules (?)
Favorite modules
Modules Summary
164
ViewsViews Bulk OperationsViews Data ExportViews Calc
DEMO
Russia, Saint-Petersburg 2014
WHAT NEXT?
Russia, Saint-Petersburg 2014
• Integration with ERPAL
• Integration with CRM Core
• Further integration with Course• Statistics module development• Probably, making few parts of a system - open source
THANK YOU FOR YOUR ATTENTION
@Niremizov
http://golbin.ru
ВОПРОСЫ?
Russia, Saint-Petersburg 2014
ANY QUESTIONS?ANY?