A powerful module for Perfex CRM that allows administrators to merge duplicate customer records while preserving all associated data. Simplify your customer database management by combining duplicate entries without losing any important information.
- Features
- Requirements
- Installation
- Usage
- Data Handling
- Custom Fields Merging
- Primary Contact Handling
- Permissions
- Language Support
- Contributing
- Changelog
- Support
- License
- Intuitive Interface: Simple, user-friendly interface for merging duplicate customers
- Comprehensive Data Migration: Preserves all customer-related data during merges
- Selective Merging: Choose which data elements to merge
- Smart Custom Fields Handling: Intelligently combines values for select-type fields
- Primary Contact Management: Smart handling of primary contacts
- Merge History: Track all customer merges with detailed logs
- Permission-Based Access: Control who can view and perform merges
- Multilingual Support: Available in multiple languages (English and Swedish)
- Rollback Functionality: Undo merge operations
- Perfex CRM version 2.3.2 or higher
- PHP 7.3 or higher
- MySQL 5.6 or higher
- Download the latest release from the Releases page
- Extract the downloaded ZIP file
- Upload the
customer_merge
folder to themodules
directory of your Perfex CRM installation - Navigate to
Setup β Modules
in your Perfex CRM admin panel - Find the Customer Merge module and click the "Activate" button
- Refresh your browser to complete the installation
composer require owgit/customer_merge
cd /path/to/perfex/modules
git clone https://github.com/owgit/customer_merge.git
- Navigate to
Customers β Customer Merge
in the main menu - Alternatively, access the merge function directly from any customer's profile page via the "Merge with another customer" button
- Select Source Customer: Choose the customer that will be merged (this customer will be deleted after the merge)
- Select Target Customer: Choose the customer that will receive all the data (this customer will be kept)
- Configure Merge Options: Select which data elements to merge
- Review Customer Data: Optionally select specific customer data fields to transfer
- Confirm and Execute: Review the warning message, check the confirmation box, and click "Merge Customers"
- Go to
Customers β Customer Merge
- View the list of all merge operations performed
If you need to undo a merge operation:
- Go to
Customers β Customer Merge
- Find the merge operation you want to rollback
- Click the rollback button (undo icon)
- Confirm the rollback
The rollback process will:
- Create a new customer with the original source customer name
- Move data created after the merge back to the new customer
- Mark the merge operation as rolled back
Note: The rollback process is not a perfect undo. It creates a new customer (with a new ID) and only moves data created after the merge. Data that existed before the merge will remain with the target customer.
The following data is migrated during the merge process:
Data Type | Description |
---|---|
Contacts | All contacts and their permissions |
Invoices | All invoices and their items |
Estimates | All estimates and their items |
Projects | All projects and their tasks |
Expenses | All expenses and their receipts |
Payments | All payment records |
Tasks | All tasks and their comments |
Notes | All customer notes |
Files | All uploaded files |
Contracts | All contracts and their renewals |
Tickets | All support tickets and their replies |
Proposals | All proposals and their content |
Custom Fields | All custom field values with intelligent merging |
Customer Groups | All group memberships |
The module features an enhanced custom fields merging system that intelligently handles different field types:
- Values are combined rather than replaced when both customers have different values
- The system creates a comma-separated list of unique values from both customers
- Special handling for "customers_kundtyp" ensures customer type information is preserved from both records
- Checkboxes: If source is checked but target isn't, the target will be checked
- Dates: The most recent date is kept
- Text/Textarea: Text is combined with a separator if both have content
- Other types: Source value is used only if target is empty
- No information is lost during merging
- Values are combined in a way that makes sense for each field type
- Detailed logs show exactly what happened during the merge
When merging customers, the primary contact is handled as follows:
- The target customer's primary contact is always preserved as the primary contact
- Any primary contact from the source customer will be transferred but will no longer be marked as primary
- If the target customer has no primary contact, the first transferred contact may be set as primary
The module adds two custom permissions:
Permission | Description |
---|---|
View Customer Merge | Allows staff to view the merge history |
Create Customer Merge | Allows staff to perform customer merges and rollback merges |
By default, only administrators have full permissions. You can modify permissions in Setup β Staff β Roles
.
The module currently supports the following languages:
- English
- Swedish
To add support for additional languages:
- Create a new directory in
modules/customer_merge/language/
with the language name (e.g.,french
) - Copy the
customer_merge_lang.php
file from theenglish
directory to your new language directory - Translate all strings in the file
- The module will automatically detect and use the new language file
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Clone the repository to your local Perfex CRM modules directory
- Make your changes
- Test thoroughly before submitting a pull request
- Follow the Perfex CRM coding standards
- Use meaningful variable and function names
- Add comments to explain complex logic
- Write unit tests for new features when possible
- Added comprehensive rollback functionality for all customer data types
- Enhanced database column detection for better compatibility
- Fixed issues with contacts and primary contacts during rollback
- Improved error handling in rollback process
- Fixed "Unknown column" errors in various tables
- Added rollback functionality to undo merge operations
- Added status indicators in merge history
- Added Swedish translations for rollback functionality
- Initial release
- Support for merging all customer data
- Primary contact handling
- Merge history tracking
- Permission-based access control
- English and Swedish language support
- Enhanced custom fields merging with special handling for "customers_kundtyp"
For support, bug reports, or feature requests, please:
- Visit my website at uygarduzgun.com
- Email me at [email protected]
- Create an issue on the GitHub repository
This module is released under the MIT License.
Developed with β€οΈ by Uygar Duzgun