Friday, September 20, 2013

SugarCRM Quote PDF customization


1) Customize Fonts in default PDF of SugarCRM

  • copy and Edit  custom/modules/Quotes/sugarpdf/sugarpdf.quotes.php
  • add html tag for font.
  • like '<b>'.value.'</b>' for bold
  • '<u>'.value.'</u>' for underline
  • '<i>'.value.'</i>'
  • For Example you want to change for quote number :
 Code:  1.(For Label) : $quote[0]['TITLE'] = '<u><b><i>'.$mod_strings['LBL_PDF_QUOTE_NUMBER'].'</i></b></u>';

                 2.(For Value)     :   $quote[0]['VALUE']['value'] = '<u><b><i>'.format_number_display($this->bean->quote_num,$this->bean->system_id).'</i></b></u>';

Output :     





2) Customize Layout Using TcPDF :
 
   Code  :  coming  soon

Wednesday, August 7, 2013

Duplicate Finder

This is what i have find during surfing on internet,

Give an indication next to phone number if it is found to be repeated over various Contacts :

1.Create a process_record logic hook in custom/modules/Contacts/logic_hooks.php



<?php
$hook_array['process_record'][] = Array(1, 'Check Dup', 'custom/modules/Contacts/checkDup.php','checkDupC', 'checkDupF');

2. Create a file checkDup.php in SugarCRM/custom/modules/Contacts/








<?php
class checkDupC{
function checkDupF($bean){
$sContacts = $bean->db->query('SELECT contacts.id FROM contacts WHERE contacts.phone_work = "'.$bean->phone_work.'" AND contacts.id <> "'.$bean->id.'" AND contacts.phone_work IS NOT NULL', true);
$bFound = false;
while($aContacts = $bean->db->fetchByAssoc($sContacts)){
if(!empty($aContacts['id']))
$bFound = true;
}

if($bFound){
$bean->phone_work = $bean->phone_work."&nbsp;".SugarThemeRegistry::current()->getImage('no');
}
}
}

Now, refresh the list view and you should have (X) mark after phone number.









Ad