Hi,
IA is very crazy, now a new extension ext-office : phpWord (https://github.com/phpoffice)
For now, only Word : https://github.com/hturkoz/ext-office
a new item : Print-to-Word
in the release page, you can see result : FILENAME.docx and FILENAME.pdf
the out-of-box : Print-to-Pdf result
The word : Print-to-Word result (of the same template -> no another template !)
Feel free to fork or ..
Licence EspoCRM
the template :
the css :
IA is very crazy, now a new extension ext-office : phpWord (https://github.com/phpoffice)
For now, only Word : https://github.com/hturkoz/ext-office
a new item : Print-to-Word
in the release page, you can see result : FILENAME.docx and FILENAME.pdf
the out-of-box : Print-to-Pdf result
The word : Print-to-Word result (of the same template -> no another template !)
Feel free to fork or ..
Licence EspoCRM
the template :
PHP Code:
{{imageTag cImageId width=50 height=50}}
<h1>ACCOUNT 360 - COMPANY PROFILE</h1>
<p class="subtitle">Company information and customer overview</p>
<h2>1. GENERAL INFORMATION</h2>
<table class="info">
<tbody><tr><td class="key">Company Name</td><td>{{name}}</td></tr>
<tr><td class="key">Account Type</td><td>{{type}}</td></tr>
<tr><td class="key">Industry</td><td>{{industry}}</td></tr>
<tr><td class="key">Website</td><td>{{website}}</td></tr>
<tr><td class="key">Phone</td><td>{{phoneNumber}}</td></tr>
<tr><td class="key">Email</td><td>{{emailAddress}}</td></tr>
<tr><td class="key">Account Manager</td><td>{{assignedUserName}}</td></tr>
<tr><td class="key">Created Date</td><td>{{createdAt}}</td></tr>
<tr><td class="key">Last Modified</td><td>{{modifiedAt}}</td></tr>
</tbody></table>
<h2>2. BILLING ADDRESS</h2>
<table class="info">
<tbody><tr><td class="key">Street</td><td>{{billingAddressStreet}}</td></tr>
<tr><td class="key">Postal Code</td><td>{{billingAddressPostalCode}}</td></tr>
<tr><td class="key">City</td><td>{{billingAddressCity}}</td></tr>
<tr><td class="key">State</td><td>{{billingAddressState}}</td></tr>
<tr><td class="key">Country</td><td>{{billingAddressCountry}}</td></tr>
</tbody></table>
<h2>3. SHIPPING ADDRESS</h2>
<table class="info">
<tbody><tr><td class="key">Street</td><td>{{shippingAddressStreet}}</td></tr>
<tr><td class="key">Postal Code</td><td>{{shippingAddressPostalCode}}</td></tr>
<tr><td class="key">City</td><td>{{shippingAddressCity}}</td></tr>
<tr><td class="key">State</td><td>{{shippingAddressState}}</td></tr>
<tr><td class="key">Country</td><td>{{shippingAddressCountry}}</td></tr>
</tbody></table>
<h2>4. COMPANY DESCRIPTION</h2>
<p>{{{description}}}</p>
<h2>5. ASSOCIATED CONTACTS</h2>
<table class="list">
<tbody><tr>
<th>Contact Name</th>
<th>Job Title</th>
<th>Email</th>
<th>Phone</th>
</tr>
<tr iterate="{{contacts}}">
<td>{{name}}</td>
<td>{{title}}</td>
<td>{{emailAddress}}</td>
<td>{{phoneNumber}}</td>
</tr>
</tbody></table>
<br>
<h2>6. SALES OPPORTUNITIES</h2>
<table class="list">
<tbody><tr>
<th style="width: 30%">Opportunity</th>
<th>Stage</th>
<th>Amount</th>
<th>Probability</th>
<th>Close Date</th>
<th>Assigned User</th>
</tr>
<tr iterate="{{opportunities}}">
<td>{{name}}</td>
<td>{{stage}}</td>
<td>{{amount}} {{amountCurrency}}</td>
<td>{{probability}}%</td>
<td>{{closeDate}}</td>
<td>{{assignedUserName}}</td>
</tr>
</tbody></table>
<h2>7. CASE HISTORY</h2>
<table class="list">
<tbody><tr>
<th>Case Number</th>
<th>Subject</th>
<th>Status</th>
<th>Created Date</th>
<th>Assigned User</th>
</tr>
<tr iterate="{{cases}}">
<td>{{number}}</td>
<td>{{name}}</td>
<td>{{status}}</td>
<td>{{createdAt}}</td>
<td>{{assignedUserName}}</td>
</tr>
</tbody></table>
<h2>8. ACCOUNT SUMMARY</h2>
<table class="info">
<tbody><tr><td class="key">Account Name</td><td>{{name}}</td></tr>
<tr><td class="key">Account Manager</td><td>{{assignedUserName}}</td></tr>
<tr><td class="key">Report Date</td><td>{{now}}</td></tr>
</tbody></table>
<p class="footer">Generated from EspoCRM.</p>
PHP Code:
body { font-family: Arial; font-size: 10pt; }
h1 { font-size: 20pt; font-weight: bold; color: #1F4E79; margin-bottom: 4pt; }
h2 { font-size: 13pt; font-weight: bold; color: #1F4E79; margin-top: 14pt; margin-bottom: 6pt; }
p.subtitle { font-size: 11pt; color: #666; }
p.footer { font-size: 8pt; color: #888; text-align: center; }
table.info, table.list { width: 100%; }
table.info td, table.list td, table.list th { border: 1px solid #bbb; }
table.info td.key { width: 35%; background-color: #f2f2f2; font-weight: bold; }
table.list th { background-color: #1F4E79; color: #fff; font-weight: bold; text-align: left; }
