Prev | Current Page 214 | Next

David Berube

"Practical Reporting with Ruby and Rails"

In an
effort to boost output, he wants to reward productive employees with a gift based on
their number of meetings with clients and potential clients. The more meetings a salesperson
has, the better the gift.
He would like to keep tabs on this effort, and wants you to produce a report that lists
each salesperson and the gift that person has earned. Your boss wants the report to be
made available in a format that is easy to print and e-mail. Therefore, you??™ve decided to
create the report as a PDF file.
Fortunately, it should be fairly easy to create a Ruby report that pulls this data from
the SugarCRM database. First, though, you??™ll need to modify the database to include the
extra gift information.
Updating the Database
You can use the SQL in Listing 8-1 to add some sample data to your database.
Listing 8-1. Sample Data for the Sales Force Reporting Application (rewards_data.sql)
CREATE TABLE rewards (
reward_id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
meeting_count INT(11) NOT NULL,
description VARCHAR(255));
INSERT into rewards (meeting_count, description)
VALUES (50, "'You Are Number One!' Pen");
INSERT into rewards (meeting_count, description)
VALUES (100, "'Super Salesman' Coffee Mug");
INSERT into rewards (meeting_count, description)
VALUES (150, "'You Make Our Company Great' Sweatshirt");
INSERT into rewards (meeting_count, description)
VALUES (200, "Granite 'Rock Hard Sales' Paperweight");
CHAPTER 8 n CREATING SALES PERFORMANCE REPORTS WITH SUGARCRM 156
Save the SQL as rewards_data.


Pages:
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
geovision podłogi drewniane sypialnia Krople citrosept A*Teens