Customization | Adlis ERP-CRM Dev. https://help.perfexcrm.com Help Center Fri, 23 Feb 2024 12:29:11 +0000 en-US hourly 1 https://help.adlis-weiyin.com/wp-content/uploads/2017/02/cropped-favicon-32x32.jpg Customization | Adlis ERP-CRM Dev. https://help.perfexcrm.com 32 32 Make admin URL default https://help.adlis-weiyin.com/make-admin-url-default/ Tue, 13 Jul 2021 11:49:03 +0000 https://help.adlis-weiyin.com/?p=4274 In Adlis ERP-CRM Dev., the default URL when accessing your installation is reserved for your customers, if an admin/staff member want to log in, you will need to append the /admin in the URL, for example, https://your-perfexcrm-installation.com/admin At this time we don’t have plans to change this behavior as Adlis ERP-CRM Dev. customers area is full separated […]

The post Make admin URL default first appeared on Adlis ERP-CRM Dev..]]>
In Adlis ERP-CRM Dev., the default URL when accessing your installation is reserved for your customers, if an admin/staff member want to log in, you will need to append the /admin in the URL, for example, https://your-perfexcrm-installation.com/admin

At this time we don’t have plans to change this behavior as Adlis ERP-CRM Dev. customers area is full separated from the admin area, if you want to change the default URL to point to the admin area, you can do this with an action hook.

In application/helpers create file (if don’t exist) my_functions_helper.php and add the following code:

hooks()->add_action('app_init','my_change_default_url_to_admin');

function my_change_default_url_to_admin(){
    $CI = &get_instance();

    if(!is_client_logged_in() && !$CI->uri->segment(1)){
        redirect(site_url('admin/authentication'));
    }
}

Don’t forget to add the <?php opening tag on top of the file if it’s not already there.

Note that in order for your clients to log in in the customers area, they must access the https://your-perfexcrm-installation.com/login

The post Make admin URL default first appeared on Adlis ERP-CRM Dev..]]>
Create Custom Payment Gateway https://help.adlis-weiyin.com/create-custom-payment-gateway/ Tue, 25 Sep 2018 11:48:58 +0000 https://help.adlis-weiyin.com/?p=4029 Creating new online payment gateway will require more advanced php knowledge and also knowledge of the payment gateway and the requirements. Because Adlis ERP-CRM Dev. uses Codeigniter framework to integrate the payment gateway you will need to create 1 gateway library (gateway config and process method) and 1 gateway controller (for HTTP requests, show form etc..), […]

The post Create Custom Payment Gateway first appeared on Adlis ERP-CRM Dev..]]>
The implementation below is compatible for version 2.3.2 or above.

Creating new online payment gateway will require more advanced php knowledge and also knowledge of the payment gateway and the requirements.

Because Adlis ERP-CRM Dev. uses Codeigniter framework to integrate the payment gateway you will need to create 1 gateway library (gateway config and process method) and 1 gateway controller (for HTTP requests, show form etc..), you can also take a look at the other gateways files in order to get the idea.

In the invoice HTML area when a customer clicks on the button PAY NOW, we call 1 method from the gateway library which will process everything additional that is required for this gateway eq redirect to gateway website and pass parameters or redirect to controller and show form etc…

We have simplified a little the process for creating new gateways e.q. the gateway will be auto showed in Setup->Settings->Payment Gateways, encrypting fields, 1 unique function from each gateway library to call etc… but this will still require effort to get started.

The main folders who you will use when creating a new gateway are:

  1. application/libraries/gateways – This file holds the main logic for the gateway eq settings, adding the gateway to the system, the main process_payment function which is called each time a customer click on PAY NOW  button.
  2. application/gateways/controllers – This folder is used in case you need to create valid URL/s for your gateway eq. webhook or to take the HTTP response from the gateway request. In this case, you should create a Codeigniter controller there.
Before start, make sure that you set development mode in order to see any errors and functions/hooks deprecation warnings.

The PHP Class

Let’s assume for this example your gateway name is Example

In application/libraries/gateways/ create file Example_gateway.php with the following content:

<?php

defined('BASEPATH') or exit('No direct script access allowed');

class Example_gateway extends App_gateway
{
    public function __construct()
    {
        /**
        * Call App_gateway __construct function
        */
        parent::__construct();

        /**
         * Gateway unique id - REQUIRED
	 * 
         * * The ID must be alphanumeric
         * * The filename (Example_gateway.php) and the class name must contain the id as ID_gateway
         * * In this case our id is "example"
         * * Filename will be Example_gateway.php (first letter is uppercase)
         * * Class name will be Example_gateway (first letter is uppercase)
         */
        $this->setId('example');

        /**
         * REQUIRED
         * Gateway name
         */
        $this->setName('Example');

        /**
         * Add gateway settings
         * You can add other settings here to fit for your gateway requirements
         *
         * Currently only 2 field types are accepted for gateway
         *
         * 'type'=>'yes_no'
         * 'type'=>'input'
         */
        $this->setSettings(array(
            array(
                'name' => 'api_secret_key',
                'encrypted' => true,
                'label' => 'API KEY',
                'type'=>'input',
            ),
            array(
                'name' => 'api_publishable_key',
                'label' => 'SECRET KEY',
                'type'=>'input'
            ),
            array(
                'name' => 'currencies',
                'label' => 'settings_paymentmethod_currencies',
                'default_value' => 'USD,CAD'
            ),
        ));

        /**
         * REQUIRED
         * Hook gateway with other online payment modes
         */
        hooks()->add_filter('app_payment_gateways', [ $this, 'initMode' ]);
    }

    /**
     * Each time a customer click PAY NOW button on the invoice HTML area, the script will process the payment via this function.
     * You can show forms here, redirect to gateway website, redirect to Codeigniter controller etc..
     * @param  array $data - Contains the total amount to pay and the invoice information
     * @return mixed
     */
    public function process_payment($data)
    {
        var_dump($data);
        die;
    }
}

There are comments on the functions and variables, you should spend some time to read them because they are important if you want to help you get started.

Additionally, you can take a look at the other gateway example in application/libraries/gateways or application/controllers/gateways.

Now after you create and save the file navigate to Setup->Settings->Payment Gateways you will be able to see Example gateway listed, what’s up to you now you need to implement the gateway logic how you are going to process the payments, this all depends by the requirements of the payment gateway.

The post Create Custom Payment Gateway first appeared on Adlis ERP-CRM Dev..]]>
Applying custom CSS styles https://help.adlis-weiyin.com/applying-custom-css-styles/ Mon, 29 May 2017 07:21:12 +0000 https://help.adlis-weiyin.com/?p=1462 Via CSS file Adlis ERP-CRM Dev. supports custom.css file that will be autoloaded all over the CRM to apply your custom styles. This file doesn’t exist in the core files and you won’t need to worry to lose your changes when performing an update. You can achieve this by creating a file custom.css in assets/css, after […]

The post Applying custom CSS styles first appeared on Adlis ERP-CRM Dev..]]>
Via CSS file

Adlis ERP-CRM Dev. supports custom.css file that will be autoloaded all over the CRM to apply your custom styles.

This file doesn’t exist in the core files and you won’t need to worry to lose your changes when performing an update.

You can achieve this by creating a file custom.css in assets/css, after the file is created you can use your favorite code editor and apply custom styles.

You will need some basic knowledge of CSS, you can read more here

Via Admin Area

If you have enabled the Theme Style module in Setup->Modules you can apply custom CSS in Setup->Theme Style->Custom CSS

Custom CSS can be added directly for the admin area, clients area, and both admin and clients area, depends on where you add the CSS, will be loaded accordingly to the section you added the code.

The post Applying custom CSS styles first appeared on Adlis ERP-CRM Dev..]]>
Action Hooks https://help.adlis-weiyin.com/action-hooks/ Thu, 16 Mar 2017 10:21:15 +0000 https://help.adlis-weiyin.com/?p=871 Adlis ERP-CRM Dev. support various action hooks all over the code to give the buyers the best experience. Create file with name my_functions_helper.php in application/helpers/. This file is reserved for all your functions. TIP: If you need some action hook added anywhere in the code please let us know by opening support ticket. Version 2.3.0 and above. […]

The post Action Hooks first appeared on Adlis ERP-CRM Dev..]]>
Adlis ERP-CRM Dev. support various action hooks all over the code to give the buyers the best experience.

Create file with name my_functions_helper.php in application/helpers/. This file is reserved for all your functions.

TIP: If you need some action hook added anywhere in the code please let us know by opening support ticket.

Before add any code in my_functions_helper.php, make sure that you set development mode in order to see any errors and functions/hooks deprecation warnings.

Version 2.3.0 and above.

hooks()->add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1);
hooks()->add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1);
hooks()->do_action($tag, $arg = '');
hooks()->apply_filters($tag, $value, $additionalParams);
The functions below are prior to version 2.3.0

Add Action Hook

add_action('action_function','your_function_callback');

Example action hook for after_client_added
Note: this code should be inside my_functions_helper.php mentioned earlier.

This is example where the action do not expect to return $data.

 function callback_after_client_added_insert_to_local_database($id)
  {
    $clientid = $id;
    // Do Staff with $clientid
  }

  add_action('after_client_added','callback_after_client_added_insert_to_local_database');

Example action hook for before_client_added
This is example where the action expect to return $data

  function callback_before_client_added_check_company($data)
  {
      if($data['company'] == 'Test'){
         $data['company'] = '';
      }

      return $data;
  }

  add_action('before_client_added','callback_before_client_added_check_company');

The post Action Hooks first appeared on Adlis ERP-CRM Dev..]]>
PDF Customization https://help.adlis-weiyin.com/pdf-customization/ Fri, 10 Mar 2017 20:25:56 +0000 https://help.adlis-weiyin.com/?p=497 File Location The invoice PDF template is located in application/views/themes/perfex/views/invoicepdf.php. With Perfex you have the ability to edit all the files located on application/views without editing the core files so in this case you won’t need to worry the updates except if any huge changes made in the files, check the link below for more […]

The post PDF Customization first appeared on Adlis ERP-CRM Dev..]]>
File Location
This is a general example how to modify the invoice PDF file, check on the bottom of this article for other PDF documents file locations.

Keep in mind that you will need more developer knowledge if you are looking to make big changes to the PDF design, if you don’t, you should consider hiring a developer to do this for you.


The invoice PDF template is located in application/views/themes/perfex/views/invoicepdf.php. With Perfex you have the ability to edit all the files located on application/views without editing the core files so in this case you won’t need to worry the updates except if any huge changes made in the files, check the link below for more information, in this case, your filename should be my_invoicepdf.php

Editing the Text and the Content of the PDF document.


You can customize the PDF Invoices add or remove some text changing your layout or images. Adlis ERP-CRM Dev. uses the TCPDF library for generating PDF documents. Here is the direct link to all functions available in the TCPDF library: https://tcpdf.org/docs/srcdoc/tcpdf/class-TCPDF/.

Additional examples you can find at the following link: https://tcpdf.org/examples/

Using this TCPDF Library you can edit the PDF templates. Note that you will need PHP knowledge to modify the file.

Adding a Custom PDF Logo


Probably you will have problems with PNG images with transparency that are handled in a different way depending on the php-imagick or php-gd version used. Try to update php-imagick and disable php-gd, if you leave this field blank the uploaded company logo will be used.

Go to Setup->Settings->PDF -> Custom PDF Company Logo URL. You can adjust your logo width also see picture below.

pdf customization

If can’t see the logo, you can apply a workaround as explained here: https://help.adlis-weiyin.com/tcpdf-error-image-unable-to-get-the-size-of-the-image/

Items Table

If you need to customize the items tables (HTML and PDF), the best is to take a look in application/libraries/App_items_table.php

PDF Document Formats

You can find all PDF document formats in Setup->Settings->PDF->Document Formats.


pdf customization

Note that when you customize the PDF and you remove the ability to apply these options you won’t be able to see any changes while applying options from the settings area.

You can always adjust one template that fit for your needs based on your colors, font sizes etc.. and use it for your own requirements.


PDF Font Family

When you first purchase Adlis ERP-CRM Dev. the PDF font freesans will be used.

This font is the default because of support UTF-8. PDF files may be larger using this font if your company does not need UTF-8 support and your customers are not using any special characters in their data or in the language you are using you can change to font to Eq. Helvetica or try changing the font until it best fits for your requirements.

  • For Arabic characters use font: dejavusans or aealarabiya or aefurat
  • For Japanese and Chineese use font: droidsansfallback
  • For Cyrlilic characters use font: freesans

Changing the font is available from the settings at Setup->Settings->PDF


Changing Invoice/Estimate PDF Heading

If you need to change the heading on the right side (see images below for more info) for estimates and invoices you can overwrite the translation text by creating custom_lang.php, read more here.

Change Heading to Invoices

pdf customization

Language key: $lang[‘invoice_pdf_heading’] = ‘Invoice’;

Change heading to Estimates

pdf customization

Language key: $lang[‘estimate_pdf_heading’] = ‘Estimate’;

Additional options.


Also you can find more options in Setup->Settings->PDF. Check the pictures below.

pdf customization

Troubleshooting



PDF Language

  • If customer language is System Default the default language that is selected in Setup->Settings->Localization will be used on PDF documents.
  • When you are in the admin area and system/staff language is e.q English and customer default language is Spanish the invoice will be still downloaded in English, if you want when you are in the admin area, to download the PDF documents in customers language, check Setup->Settings->Localization the option Output client PDF documents from admin area in client language

When the customer will view the invoice or download the invoice PDF from customers invoice preview area, he/she will be able to see the invoice into his default language that is set in the customer profile.

Other PDF Templates


If u want to edit other pdf templates you can achieve this by editing the files, the process is the same like invoices.

  • Estimate PDF location: application/views/themes/perfex/views/estimatepdf.php
  • Proposal PDF location: application/views/themes/perfex/views/proposalpdf.php
  • Payment Receipt location: application/views/themes/perfex/views/paymentpdf.php
  • Contract PDF location: application/views/themes/perfex/views/contractpdf.php.
  • Statement PDF location: application/views/themes/perfex/views/statementpdf.php (v1.8.0 required)
  • Credit Note PDF location: application/views/themes/perfex/views/credit_note_pdf.php
The post PDF Customization first appeared on Adlis ERP-CRM Dev..]]>
Customers Templates https://help.adlis-weiyin.com/customers-templates/ Sun, 12 Feb 2017 10:29:17 +0000 https://help.adlis-weiyin.com/?p=304 If you want to change the client area look copy the existing main theme Perfex located in application/views/themes/ and rename to your theme name, eq. flat The next part is to copy the assets folder by going to root directory assets/themes/ and copy the Perfex theme and rename the folder to eq. flat. Go to admin […]

The post Customers Templates first appeared on Adlis ERP-CRM Dev..]]>
If you want to change the client area look copy the existing main theme Perfex located in application/views/themes/ and rename to your theme name, eq. flat

The next part is to copy the assets folder by going to root directory assets/themes/ and copy the Perfex theme and rename the folder to eq. flat.

Go to admin area Setup->Settings->Customers and change the active customers theme to your newly created theme.

It’s not recomended to edit the original theme becuase of updates coming in the next releases and all your changes will be overided.

After you applied the changes your folder structure for your new theme named eq. flat should be like this:

  • assets/themes/flat
  • application/views/themes/flat

When using your own theme you will need to maintain the theme in each update and make compatible with the latest version.


Template files

Main files

  • head.php
  • footer.php
  • index.php
  • scripts.php

Available theme files

Here is a list of all available theme files located in application/views/themes/yourtheme/views/ (views):

  1. announcement.php – Single view announcement.
  2. announcements.php – List view announcements
  3. calendar.php – Customer calendar area
  4. company_profile.php – Company informations
  5. contractpdf.php – Contract PDF template
  6. contracts.php – List view contracts
  7. estimatehtml.php – Estimate HTML template
  8. estimatepdf.php – Estimate PDF template
  9. files.php – Customer area for files to upload in the customer profile
  10. forgot_password.php – Customer forgot password template
  11. home.php – Customers dashboard after login
  12. invoicehtml.php – Invoice HTML template
  13. invoicepdf.php – Invoice PDF template
  14. invoices.php – List view invoices
  15. knowledge_base.php – All knowledge base articles
  16. knowledge_base_article.php – Single knowledge base article
  17. login.php – Contact login template
  18. open_ticket.php – New ticket open template
  19. paymentpdf.php – Payment Receipt PDF template
  20. profile.php – Logged in contact profile
  21. project.php – Single project
  22. proposalpdf.php – Proposal PDF template
  23. proposals.php – List view proposals
  24. register.php – Contact/Customer register template
  25. reset_password.php – Reset password template
  26. single_ticket.php – Contact view ticket template
  27. survey_view.php – Survey template
  28. tickets.php – List view tickets
  29. viewproposal.php – Proposal HTML template
The post Customers Templates first appeared on Adlis ERP-CRM Dev..]]>
Disabling Customers Area https://help.adlis-weiyin.com/disabling-customers-area/ Sun, 12 Feb 2017 10:15:02 +0000 https://help.adlis-weiyin.com/?p=299 If you want to disable the customers area, you can achieve this but adding a simple hook which is available for the customers area. Method 1 (preferred) In application/helpers create file with name my_functions_helper.php and add the following code: <?php hooks()->add_action('after_clients_area_init', 'my_disable_customers_area'); hooks()->add_action('clients_authentication_constructor', 'my_disable_customers_area'); // Uncomment to disable customers area knowledge base as well // […]

The post Disabling Customers Area first appeared on Adlis ERP-CRM Dev..]]>
If you want to disable the customers area, you can achieve this but adding a simple hook which is available for the customers area.

Method 1 (preferred)

In application/helpers create file with name my_functions_helper.php and add the following code:

<?php

hooks()->add_action('after_clients_area_init', 'my_disable_customers_area'); 
hooks()->add_action('clients_authentication_constructor', 'my_disable_customers_area'); 
// Uncomment to disable customers area knowledge base as well
//  hooks()->add_action('customers_area_knowledge_base_construct', 'my_disable_customers_area'); 

function my_disable_customers_area(){ 
    header('HTTP/1.0 401 Unauthorized'); 
    die('Access not allowed'); 
}

Now nobody will be able to access in the clients area.

Method 2

To achieve this you need to create your own view file.

Navigate to application/views/themes/perfex/head.php and copy this file and rename it to my_head.php and on the top of this file (first line) add the code

<?php die(); ?>

Now, this my_head.php will be used not head.php so when updates will come this will wont be replaced.
Or if you want to redirect somewhere you can add:

<?php redirect('http://yourdesireddomain.com/'); ?>

Disabling email templates

Additionaly if you don’t want your customer contacts to receive any emails from the CRM navigate to Setup->Email Templates and disable all the email templates you don’t need. In most email templates that are sent to the customer contacts the email template name will contain eq. (Sent to customer contacts)

The post Disabling Customers Area first appeared on Adlis ERP-CRM Dev..]]>
Add Custom Field for Company https://help.adlis-weiyin.com/add-custom-field-for-company/ Sun, 12 Feb 2017 10:06:16 +0000 https://help.adlis-weiyin.com/?p=291 From Version 1.2.7 the custom fields for company are moved in Setup->Custom Fields together with the all fields. Custom fields is feature in Perfex that allows you to add field based on your needs. With this ability Perfex can fit easily for your company requirements. Follow the steps to add new custom field for company. Navigate […]

The post Add Custom Field for Company first appeared on Adlis ERP-CRM Dev..]]>
From Version 1.2.7 the custom fields for company are moved in Setup->Custom Fields together with the all fields.

Custom fields is feature in Perfex that allows you to add field based on your needs. With this ability Perfex can fit easily for your company requirements. Follow the steps to add new custom field for company.

Navigate to Setup->Custom Fields and click New Custom Field.

Choose Field Belong to Company

Give your custom fields name eq. Address Number 2 as shown in the picture.

Choose Input Type, from the listed options this New Custom field. (in most cases this field will be input)

You can also change order of the field – This is used if you have multiple fields for the same feature and you want to re-oder how they will be shown to the customer.

After filling up the new custom field click Save.

When new custom field for company is created you need to navigate to Setup->Settings->Company to give this field value.

Give this new custom field values here eq. Street Name 553.
Click Save Settings.

Read more about custom fields

 

The post Add Custom Field for Company first appeared on Adlis ERP-CRM Dev..]]>
Add currencies in total to words feature https://help.adlis-weiyin.com/add-currencies-in-total-to-words-feature/ Sat, 11 Feb 2017 11:15:55 +0000 https://help.adlis-weiyin.com/?p=206 If you are using total to words in your transactions you need to add the currency words manually into the translation. Perfex comes with 2 predefined currency names who are already added into the converter. If you added your own currency you need to add this also to total to words converter. You need to add […]

The post Add currencies in total to words feature first appeared on Adlis ERP-CRM Dev..]]>
If you are using total to words in your transactions you need to add the currency words manually into the translation.

Perfex comes with 2 predefined currency names who are already added into the converter. If you added your own currency you need to add this also to total to words converter.

You need to add your currency database name and the currency string who will be output inside the invoice/estimate.

In this example we will add British Pound to the converter.

Create a file with name my_functions_helper.php in application/helpers/ and add the following code:

function add_total_to_words_currency($currencies){
    $currencies['GBP'] = 'British Pounds';

    return $currencies;
}

hooks()->add_filter('before_number_format_render_languge_currencies','add_total_to_words_currency');

Note that the GBP is the same as the name we have set up inside the CRM (showed in the image);

The post Add currencies in total to words feature first appeared on Adlis ERP-CRM Dev..]]>
Overwrite Translation Text https://help.adlis-weiyin.com/overwrite-translation-text/ Sat, 11 Feb 2017 10:35:14 +0000 https://help.adlis-weiyin.com/?p=195 If you need to overwrite some translation text you can create your own custom language file. This is used if you want to change some text in the main translation files which comes with Adlis ERP-CRM Dev. installation and prevent your changes to be overwritten during an update. This is an example of the English language. Navigate to […]

The post Overwrite Translation Text first appeared on Adlis ERP-CRM Dev..]]>
If you need to overwrite some translation text you can create your own custom language file.

This is used if you want to change some text in the main translation files which comes with Adlis ERP-CRM Dev. installation and prevent your changes to be overwritten during an update.

This is an example of the English language.

Navigate to application/language/english and create custom_lang.php file.

Add the following line at the top:

<?php

Copy the whole part and add it to custom_lang.php

$lang['home_stats_full_report'] = 'Report';

You can notice that is changed Report. Now Full Report will be displayed as Report

You can use the core language file located in application/language/english/english_lang.php and search for the language keys you want to change.

The full custom_lang.php will look like this:

<?php
$lang['home_stats_full_report'] = 'Report';

Encoding

Language files in Adlis ERP-CRM Dev. use the UTF-8 encoding without a Byte Order Marker, when creating language override files it is important to maintain the same encoding.

Special Characters

If you want to use the ‘ character in your translation text you have to replace it with \’

Eq:

$lang['language_text_key'] = 'Text with \'quotes';

Modules

If you are using version 2.3.0 or above you can achieve this also for the modules language files if the module is using language files and have them registered.

The process is the same for the modules too, only the location is in modules/[module-name]/language/[language-to-overwrite]/custom_lang.php

The post Overwrite Translation Text first appeared on Adlis ERP-CRM Dev..]]>