openqcManual v02 en.pdf - SugarForge
openqcManual v02 en.pdf - SugarForge
openqcManual v02 en.pdf - SugarForge
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Op<strong>en</strong>QuotesAndContracts manual (v0.2)<br />
Lion Vollnhals, Ingo Jaeckel<br />
September 16, 2008
Cont<strong>en</strong>ts<br />
1 Introduction 3<br />
2 Installation 5<br />
2.1 Requirem<strong>en</strong>ts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
2.2 Installation of Op<strong>en</strong>QuotesAndContracts ZIP file . . . . . . . . . . . . . . 5<br />
2.3 Getting the <strong>pdf</strong> creation feature working . . . . . . . . . . . . . . . . . . . 6<br />
3 Restrictions 8<br />
3.1 Formatting Texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
4 Contract Managem<strong>en</strong>t 9<br />
4.1 Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9<br />
4.2 Product Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10<br />
4.3 Textblocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10<br />
4.4 Offerings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10<br />
4.5 Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
4.6 Contract additions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
5 Product Catalog 12<br />
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12<br />
5.2 Step By Step: Create a Product Catalog . . . . . . . . . . . . . . . . . . . 13<br />
6 External Contracts 15<br />
7 PDF G<strong>en</strong>eration 16<br />
7.1 Quotes and Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
7.2 Product Catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
2
1 Introduction<br />
This docum<strong>en</strong>t describes the installation process and the use of the SugarCRM module<br />
Op<strong>en</strong>QuotesAndContracts - also known as op<strong>en</strong>qc [1].<br />
Four stud<strong>en</strong>ts have started the op<strong>en</strong>qc-developm<strong>en</strong>t in winter 2007/2008 at the Hasso-<br />
Plattner-Institut [3] which is situated in Potsdam, Germany. It is build together with a<br />
departm<strong>en</strong>t called LDS [2], which provides IT-services for other german departm<strong>en</strong>ts.<br />
The aim of op<strong>en</strong>qc is making business processes more transpar<strong>en</strong>t, increase productivity<br />
and improve service quality.<br />
It is developed by two stud<strong>en</strong>ts of the Hasso-Plattner-Institut at the mom<strong>en</strong>t - the<br />
authors of this manual. Together with the compon<strong>en</strong>ts that are integrated into op<strong>en</strong>qc<br />
(e.g. FckEditor, dhtmlxTree), op<strong>en</strong>qc consists of more than 35000 lines of PHP and<br />
65000 lines of JavaScript code.<br />
At the time of writing Op<strong>en</strong>QuotesAndContracts has the following features:<br />
• The creation of PDF files from contracts, offerings, contract additions and product<br />
catalogs. Docum<strong>en</strong>ts can be attached (PDF, DOC) or embedded (all other formats)<br />
into the PDF file.<br />
• The managem<strong>en</strong>t of contracts, offerings and contract additions (see chapter 4).<br />
– Automatic versioning of offerings, contracts and contracts additions.<br />
– Creation of contracts from offerings.<br />
– Creation of contracts additions from contracts.<br />
– Integration of the SugarCRM autocompletion feature for selection of contacts<br />
and employees.<br />
– Select products to produce and configure lists of services that are sold in a<br />
contract.<br />
– Select and edit textblocks with the integrated WYSIWYG editor: FckEditor.<br />
– Upload docum<strong>en</strong>ts that give further details about offerings or contracts.<br />
• The managem<strong>en</strong>t of product catalogs (see chapter 5).<br />
– Create product categories and change their TODO hierarchies using drag and<br />
drop.<br />
– Duplicate existing category and product hierarchies wh<strong>en</strong> creating new product<br />
catalogs.<br />
We appreciate for all kind of feedback to op<strong>en</strong>qc but also to this manual. Just leave<br />
a message at the op<strong>en</strong>qc website or write a mail.<br />
3
1 Introduction<br />
• http://www.sugarforge.org/projects/op<strong>en</strong>qc<br />
• Ingo Jaeckel, ingo.jaeckel@stud<strong>en</strong>t.hpi.uni-potsdam.de<br />
• Lion Vollnhals, lion.vollnhals@stud<strong>en</strong>t.hpi.uni-potsdam.de<br />
4
2 Installation<br />
2.1 Requirem<strong>en</strong>ts<br />
Installation requires a working AMP <strong>en</strong>vironm<strong>en</strong>t including a configured SugarCRM<br />
instance. The curr<strong>en</strong>t release was testet with the following software versions:<br />
• PHP 5.2.4<br />
• Apache 2.2.8<br />
• MySQL 5.0.5<br />
• SugarCRM 5.0.0g<br />
However, you should be able to use op<strong>en</strong>qc in similiar <strong>en</strong>vironm<strong>en</strong>ts as well. In order to<br />
g<strong>en</strong>erate PDF docum<strong>en</strong>ts of quotes, contracts and product catalogs further software is<br />
required:<br />
• Python<br />
• Op<strong>en</strong>Office.org mit headless-Untersttzung und Python-UNO-Bindings<br />
• <strong>pdf</strong>tk<br />
• <strong>pdf</strong>latex<br />
• Docum<strong>en</strong>tConverter.py (auch bekannt unter PyODConverter)<br />
2.2 Installation of Op<strong>en</strong>QuotesAndContracts ZIP file<br />
You can install Op<strong>en</strong>QuotesAndContracts using the module loader that comes with<br />
SugarCRM. This requires the following steps:<br />
1. Download the curr<strong>en</strong>t ZIP file from the op<strong>en</strong>qc website [1].<br />
2. Upload the file into SugarCRM using the module loader (see figure 2.1).<br />
3. Click on the “Install” button and accept the lic<strong>en</strong>se (see figure 2.2).<br />
Everything but the <strong>pdf</strong> creation feature should work after the installation. The next<br />
section describes what you have to do to get the <strong>pdf</strong> creation feature working.<br />
5
2 Installation<br />
Figure 2.1: op<strong>en</strong>qc ZIP file in the module loader<br />
Figure 2.2: Start the installation process<br />
2.3 Getting the <strong>pdf</strong> creation feature working<br />
1. The installation of the required software packages is distribution specific because<br />
the package managing tools and the package names differ. However, in the following<br />
we describe the steps for some of the major distributions.<br />
Op<strong>en</strong>Suse 11 You should have <strong>en</strong>abled the Op<strong>en</strong>Suse and the Packman repositories<br />
so that zypper can find the tools we want to install.<br />
zypper in apache2 apache2-mod_php5 python<br />
zypper in php5 php5-mysql php5_zlib php5_mbstring mysql<br />
zypper in Op<strong>en</strong>Office_org-pyuno <strong>pdf</strong>tk texlive texlive-latex<br />
Ubuntu 8.10 This sections has to be writt<strong>en</strong>. To install the required latex module<br />
titlesec you should do the following.<br />
sudo aptitude install texlive-extra<br />
Other Distributions<br />
To be writt<strong>en</strong>.<br />
2. After that you have to compile the html2tex.c file which is situated in the tools<br />
directory of the op<strong>en</strong>qc ZIP file.<br />
6
2 Installation<br />
gcc html2tex.c -o html2tex<br />
3. Download the Docum<strong>en</strong>tConverter script [4].<br />
wget http://artofsolving.com/files/Docum<strong>en</strong>tConverter.py<br />
4. Copy all neccessary files into a directory which is in $PATH (e.g. /usr/local/<br />
bin/). The Docum<strong>en</strong>tModifier.py file can be found in the tools directory of the<br />
op<strong>en</strong>qc ZIP file as well.<br />
cp html2tex /usr/local/bin/<br />
cp Docum<strong>en</strong>tConverter.py /usr/local/bin/<br />
cp Docum<strong>en</strong>tModifier.py /usr/local/bin/<br />
After these steps the <strong>pdf</strong> creation feature should work. If this is not the case please<br />
have a look at the error.log file of your Apache webserver and at the SugarCRM logfile<br />
sugarcrm.log. You probably have to increase the loglevel of SugarCRM. Just change<br />
the logging settings in the SugarRootDirectory/log4php.properties file to this<br />
....<br />
//log4php.rootLogger=fatal, A2<br />
//log4php.rootLogger=error, A2<br />
//log4php.rootLogger=warn, A2<br />
//log4php.rootLogger=info, A2<br />
log4php.rootLogger=debug, A2<br />
Try to create a <strong>pdf</strong> file again and look into the debug output in the logfile afterwards.<br />
We like to support you during the installation process. Just post a message at the<br />
op<strong>en</strong>qc website [1] and we will help you as fast as possible.<br />
7
3 Restrictions<br />
3.1 Formatting Texts<br />
If you are filling the description fields and want to use <strong>en</strong>umerations or itemizations,<br />
you should use the builtin feature. Copying text from other sources into the description<br />
fields can insert special characters that are not interpreted correctly. This can result in<br />
problems during the <strong>pdf</strong> creation process. That is why you should avoid copying text<br />
from other sources into the description fields that have formatting support.<br />
8
4 Contract Managem<strong>en</strong>t<br />
Op<strong>en</strong>QuotesAndContracts allows the user to manage offerings, contracts and contract<br />
additions. We suggest the following workflow.<br />
1. Create an offering.<br />
2. Create a contract from the previously created offering.<br />
3. Create a contract addition from the previously created contract.<br />
However, it is possible to skip the offering stage as well. You can create existing<br />
contracts and upload the signed contract contract docum<strong>en</strong>ts.<br />
All changes that are done in the modules, are automatically controlled by a integrated<br />
versioning system.<br />
Figure 4.1: versioning of a contract<br />
It is possible to create <strong>pdf</strong> files from the offerings and contracts all the time.<br />
In the next sections we will describe the basics of offerings and contracts: products,<br />
product categories and textblocks.<br />
4.1 Products<br />
Products have the following attributes:<br />
• name<br />
• price<br />
• contact person<br />
• category<br />
9
4 Contract Managem<strong>en</strong>t<br />
• description<br />
You can easily associate existing docum<strong>en</strong>ts with the product to store additional<br />
information about it.<br />
Figure 4.2: detail view of a product<br />
4.2 Product Categories<br />
Products are organized in categories which can be structured in hierarchies. Every<br />
product is associated with exactly one category. The hierarchy of the categories itself is<br />
called the product catalog which is complex <strong>en</strong>ough to be a seperate module (see chapter<br />
5). You cannot manage categories directly but within a product catalog.<br />
4.3 Textblocks<br />
Textblocks are templates describing the matter of the contract. These templates should<br />
describe your contracts in g<strong>en</strong>eral. You can insert and edit the textblocks wh<strong>en</strong> editing<br />
a contract. If you do any changes in the textblocks while editing the contract, they will<br />
effect only this particular contract.<br />
Each contract has another textfield for everything which has not be<strong>en</strong> described in<br />
the other textblocks.<br />
4.4 Offerings<br />
This section has to be writt<strong>en</strong>.<br />
10
4 Contract Managem<strong>en</strong>t<br />
4.5 Contracts<br />
Contracts have some additional attibutes in comparison to offerings:<br />
• Information about the schedule<br />
– start date<br />
– <strong>en</strong>d date<br />
– deadline for cancellation<br />
• The signed contract as a file.<br />
4.6 Contract additions<br />
You can define additions to existing contracts. These ext<strong>en</strong>d or update the existing<br />
contract. You can only access additions from the contract refer<strong>en</strong>ced by them.<br />
11
5 Product Catalog<br />
5.1 Introduction<br />
In the product catalog module you can create categories and structure them in hierarchies.<br />
You can create a <strong>pdf</strong> file from each product catalog which you can give your<br />
customers for example. It contains the category structure and of course a listing of all<br />
products (see figure 5.1).<br />
Figure 5.1: detail view of a product catalog<br />
Activity You can create several product catalogs but only one can be set to active at a<br />
time. Only products from the active product catalog can be used during the creation of<br />
an offering or a contract 1 . However, you can view contracts refer<strong>en</strong>cing products from<br />
1 Note that this also means that you have to activate your product catalog. If you forget to do so, you<br />
will still not be able to select products while creating offerings or contracts.<br />
12
5 Product Catalog<br />
old product catalogs that are not active at the mom<strong>en</strong>t.<br />
If you activate a catalog, all other catalogs will be set inactive. The field “valid from”<br />
will be filled automatically if you do not fill it. This means if you activate a catalog<br />
but leave the field “valid from” empty, Op<strong>en</strong>QuotesAndContracts will set “valid from”<br />
to the curr<strong>en</strong>t date. If you deactivate a catalog, the “valid from” field will be emptied<br />
automatically.<br />
Duplicate You should use the duplicate mechanism if you want to create a new catalog<br />
on the basis of an older one. This will duplicate all categories and products of the existing<br />
catalog and still lets you update what you want.<br />
Editing products To create, view and update the products of a catalog, you have to<br />
op<strong>en</strong> the detail view of this product catalog and click the “Edit Products” button. If<br />
you th<strong>en</strong> start creating or updating products they will always refer<strong>en</strong>ce the categories<br />
of the catalog, which you came from.<br />
5.2 Step By Step: Create a Product Catalog<br />
1. Op<strong>en</strong> the product catalog module in SugarCRM.<br />
2. Click on “Create product catalog” (see figure 5.2).<br />
Figure 5.2: create a product catalog<br />
3. Define a name and a description. Try the formatting options offered by the editor.<br />
At the bottom of the page you can <strong>en</strong>ter a category name and and a description.<br />
Click “Add” to add the category (see figure 5.3).<br />
4. Create other categories as well. New categories will be inserted as subcategories of<br />
the selected (blue background) category. You can change the resulting hierarchy<br />
with drag and drop. Play around with the category creation and update process<br />
to find out how it is working. If you click on a category you can start updating<br />
it. Never forget to click the “Save” button next to the “Add” button after you<br />
changed a category name or description, otherwise your changes will be lost. You<br />
should avoid creating hierarchies deeper than five levels because this will not look<br />
very good in the <strong>pdf</strong> file. It is possible but will result in a layout that is not very<br />
clear (see figure 5.4).<br />
13
5 Product Catalog<br />
Figure 5.3: editing of categories<br />
Figure 5.4: a sample hierarchy<br />
14
6 External Contracts<br />
to be writt<strong>en</strong>..<br />
15
7 PDF G<strong>en</strong>eration<br />
The g<strong>en</strong>eration of PDF docum<strong>en</strong>ts is fundam<strong>en</strong>tally composed of the following steps:<br />
• Preprocess data originating from the webinterface using PHP code.<br />
• Convert formatted HTML texts by running html2tex.<br />
• Merge preprocessed and converted data into the static template by the use of<br />
smarty.<br />
• G<strong>en</strong>erate PDF docum<strong>en</strong>t out of filled in template using <strong>pdf</strong>latex.<br />
• Attach attachm<strong>en</strong>ts to PDF docum<strong>en</strong>t using <strong>pdf</strong>tk.<br />
If the g<strong>en</strong>erated PDF docum<strong>en</strong>t is to be redesigned, ess<strong>en</strong>tially the static template, which<br />
consists of LaTeX and smarty code, has to be changed. New data has to be preprocessed<br />
in the PHP code and passed to smarty before processing the template.<br />
7.1 Quotes and Contracts<br />
Data-preprocessing PHP code is in modules/oqc Contract/oqc CreatePdf.php, which<br />
dep<strong>en</strong>ds on include/oqc/Pdf/Common.php.<br />
The static template, which consists of LaTeX and smarty code, is structured into the<br />
following parts under include/oqc/Pdf/Contract/:<br />
Template frame (Contract.tpl):<br />
and listing of parts.<br />
Definition of docum<strong>en</strong>t properties, <strong>pdf</strong> informations<br />
Title page (Titlepage.tpl):<br />
Logos, contract data, addresses.<br />
Contract arrangem<strong>en</strong>ts (TextBlocksSkeleton.tpl):<br />
Text blocks.<br />
Service tables (Services.tpl):<br />
Tables containing services.<br />
7.2 Product Catalog<br />
Data-preprocessing PHP code is in modules/oqc ProductCatalog/<br />
ProductCatalogPdfCreator.php, which dep<strong>en</strong>ds on include/oqc/Pdf/Common.php.<br />
The static template, which consists of LaTeX and smarty code, is structured into the<br />
following parts under include/oqc/Pdf/ProductCatalog/:<br />
16
7 PDF G<strong>en</strong>eration<br />
Template frame (Contract.tpl): Definition of docum<strong>en</strong>t properties, <strong>pdf</strong> informations,<br />
static text, formatting definitions and listing of parts.<br />
Description of categories and detailed de-<br />
Categories, service part (Categories.tpl):<br />
scriptions of products.<br />
Listing of cat-<br />
Products, fee directory part (Products.tpl and ProductTables.tpl):<br />
egories and their products including price and unit.<br />
17
Bibliography<br />
[1] The Op<strong>en</strong>QuotesAndContracts project, http://www.sugarforge.org/projects/<br />
op<strong>en</strong>qc/<br />
[2] LDS, Landesbetrieb fr Dat<strong>en</strong>verarbeitung und IT-Serviceaufgab<strong>en</strong> des Landes Brand<strong>en</strong>burg,<br />
http://www.lds-bb.de<br />
[3] Hasso-Plattner-Institut, http://www.hpi.uni-potsdam.de<br />
[4] Docum<strong>en</strong>tConverter, http://artofsolving.com/op<strong>en</strong>source/pyodconverter<br />
18