Introduction
As globalization accelerates, international trade and logistics operations are becoming increasingly complex. Companies working in the logistics sector face growing pressure to optimize operations, ensure compliance with international regulations, and manage intricate workflows. In response to these challenges, advanced technological solutions are needed to enhance the efficiency and transparency of multimodal freight management.
This CRM system offers a comprehensive solution for logistics operators, integrating cargo tracking, customs clearance, and financial transaction management functionalities. The system’s architecture, based on a client-server model, is designed to handle large volumes of data while ensuring security, transparency, and regulatory compliance. In this article, we will discuss the technological approaches and implementation underlying the system, and how they are revolutionizing logistics operations by automating document flow, enhancing transaction security, and improving collaboration between logistics operators and their clients.
Main Section
Programming Languages and Technology Stack
The following programming languages were used to develop this CRM system:
- Delphi: The primary language used for developing the system’s interface and business logic, particularly for data processing and integration with financial modules.
- SQL (Structured Query Language): Used for database management and handling complex queries for financial transactions, order tracking, and operations.
- JavaScript: Applied for creating dynamic and responsive client-side interfaces.
- PHP: Utilized in the server-side development to handle business logic and integrate with external APIs.
Technology Stack:
- Frontend: Angular, HTML5, CSS3, Bootstrap for responsive interfaces and user experience.
- Backend: Delphi for managing core business processes, REST API for connecting with external systems.
- Database: MySQL for storing data related to orders, cargo, and transactions.
- API Integrations: RESTful APIs for interacting with external systems such as 1C and customs authorities.
- Security: JWT (JSON Web Tokens) for user authentication and data security.
Key Program Features:
- Order and Transportation Management
- The system allows tracking and managing the statuses of orders and shipments (e.g., "No Order", "Shipment Available", "Order and Shipment Available").
- Visualization of order and shipment information in user-friendly tables and reports.
- Cargo Unit Management
- The program supports the creation and management of cargo types, subtypes, identifiers, and statuses.
- Functionality for merging and deleting cargo units with the ability to specify unique identifiers (GUID).
- Verification of checksums and other technical data for each cargo unit.
- Database Integration and Data Storage
- Interaction with databases using ADO commands for executing stored procedures, ensuring stable and efficient performance with large datasets.
- Data filtering capabilities by key parameters such as arrival date, order status, client name, or manager.
- Customs Clearance
- Tracking the statuses of documents and customs procedures, including inspection dates, document verification, and various customs review statuses.
- Support for interacting with different document types, with capabilities for entry and editing within the system.
- Client and Contact Management
- Built-in tools for tracking clients, including unique client identifiers, their data, and linking orders and shipments to specific clients.
- Management of contacts for managers and other responsible parties involved in freight transport and customs clearance.
- Reports and Analytics
- The system offers report generation capabilities for orders, shipments, cargo units, and customs procedures.
- Built-in functions for calculations and data aggregation, such as shipment amounts, commissions, and other financial indicators.
- Interface and Usability
- The program features an intuitive interface with tables, edit buttons, and data entry fields, making it user-friendly for daily operations.
- The ability to customize data displays and apply filters for quick retrieval of necessary information.
Target Audience
The program is designed for logistics companies, freight operators, customs brokers, and international shipping specialists. It will benefit organizations involved in managing freight operations, including order status tracking, logistics process management, and customs document processing.
Program Features:
- Flexibility and Scalability:
- The system supports large volumes of data and provides robust filtering and sorting capabilities, making it ideal for companies operating in international freight and handling a high number of orders.
- Database Integration:
- The use of ADO commands and stored procedures enables the system to operate efficiently, even with large data sets, allowing quick access to information on orders, shipments, and cargo statuses.
- Multi-level Cargo Tracking:
- The ability to track various types and subtypes of cargo units, their identifiers, and characteristics is especially important for companies transporting diverse categories of goods.
- Comprehensive Transportation Process Control:
- The system allows full-cycle tracking of orders and shipments – from order creation to completion, including all stages of customs clearance and transportation.
Program Strengths:
- Flexibility and Adaptability:
- The program offers numerous customization options, allowing it to be tailored to the specific needs of any company.
- User-friendly Interface:
- The program's interface is designed to facilitate ease of data interaction and minimize the time spent searching for information.
- High Performance:
- The system can process large volumes of data without significant performance loss, which is especially important for large companies with many orders and cargoes.
- Integration with Financial and Management Processes:
- The ability to work with financial indicators, reports, and commissions makes the program valuable not only for logisticians but also for company finance departments.
One of the key features of this CRM system is the closed-loop financial system, which provides comprehensive and automated management of all financial aspects of logistics operations. This is critically important for businesses involved in international transportation and customs clearance, where not only order fulfillment needs to be monitored, but full financial transparency and accountability are also required.
Indicators of a Closed-Loop Financial System:
Order and Shipment Tracking: The system tracks all stages of logistics operationsfrom the moment an order is created to its completion. The following data is monitored in the system:
1. Orders (Order entity): The primary entity that records all information related to logistics operations. Each order includes details about cargo type, route, timelines, and costs.
Fig. 1. Order Creation
Example code for creating an order entity:
TOrder = class
private
FOrderID: string;
FClientID: string;
FTransportID: string;
FOrderStatus: TOrderStatus;
FTotalAmount: Currency;
public
procedure CreateOrder(ClientID, TransportID: string);
procedure UpdateOrderStatus(NewStatus: TOrderStatus);
end;
Transport (Transport entity): Data is recorded about the vehicles involved in the transportation, as well as the current status of the shipment. This includes dispatch dates, arrival dates, and intermediate statuses. The creation of a shipment is impossible without the creation of an order, meaning that the shipment can only exist within the framework of an order. This ensures the integrity of the closed-loop financial system.
Fig. 2. Shipment Creation
Clients and Contractors (Client, Supplier entities): The CRM stores comprehensive data on clients, suppliers, and other contractors, allowing for easy management of orders and relationships with participants in the logistics chain.
Fig. 3. Creation of the Client Entity
Order and Shipment Management:
The system allows for tracking the movement of goods and automatically updating financial data for each order at all stages of execution.
2. Financial Transactions:
The system provides full control over financial transactions associated with each order. This includes managing payment types, currencies, payment statuses, commissions, and other financial aspects.
Stored procedures such as GetCityInfo and GetList and database tables process financial data, allowing the system to automatically track all inflows and outflows related to each order.
For each payment, information about the transaction status, amount, date, and currency is saved, ensuring accurate financial accounting.
Example code for handling payments:
TPaymentTransaction = class
private
FTransactionID: string;
FOrderID: string;
FAmount: Currency;
FCurrency: string;
FStatus: TTransactionStatus;
public
procedure InitiatePayment(OrderID: string; Amount: Currency);
procedure CompletePayment(TransactionID: string);
end;
Support for various currencies and payment types allows the system to adapt to international operations, which is particularly important for global logistics operators.
3. Financial Reports and Monitoring:
The CRM incorporates mechanisms for generating financial reports that track both revenues and expenses for each order. This enables real-time analysis of operational efficiency and monitoring of financial obligations.
The system automatically calculates total amounts and can generate reports across various categories such as orders, shipments, or clients. These data can be used for profitability analysis, cost assessments, and other financial indicators.
Example of creating a financial report:
TFinancialReport = class
private
FReportID: string;
FTotalIncome: Currency;
FTotalExpenses: Currency;
public
procedure GenerateReport(StartDate, EndDate: TDateTime);
procedure DisplayReport;
end;
4. Modules for Handling Commissions and Taxes:
The system contains functionality for automatically accounting for commissions, taxes, and other expenses. Fields for storing percentage rates and commission data allow the system to automatically calculate taxes related to each transaction, greatly simplifying the work of operators and accountants.
For each payment, the system saves the commission rate, which is used to calculate the final amount.
Example of commission calculation:
TCommissionCalculator = class
private
FCommissionRate: Double;
public
function CalculateCommission(Amount: Currency): Currency;
end;
function TCommissionCalculator.CalculateCommission(Amount: Currency): Currency;
begin
Result := Amount * FCommissionRate;
end;
The automation of commission and tax calculations makes the system more convenient and efficient, minimizing errors during calculations.
5. Integration with Financial Modules:
One of the key features of the system is the ability to integrate with external financial systems such as 1C. This allows for synchronization of order and financial transaction data with management and accounting systems, creating a unified closed-loop financial system.
The system automatically transmits data on orders, payments, and expenses to financial management systems, eliminating the need for manual input and minimizing errors.
Example of code for integration with external systems:
procedure TIntegrationModule.ExportTo1C(OrderID: string);
begin
// Prepare data for export
ExportData := PrepareDataForExport(OrderID);
// Send data to external system
SendTo1C(ExportData);
end;
6. Debt and Payment Tracking:
The CRM includes functionality for tracking debts and payments. For each order and client, the system stores information on the current payment status, payment dates, and outstanding amounts. This ensures precise control over financial obligations, both on the client side and the operator side.
Full payment status information (e.g., “Paid,” “Pending,” “Overdue”) is stored in the system and can be used to analyze payment discipline and improve financial control.
Example of debt tracking:
TDebtTracker = class
private
FClientID: string;
FOutstandingAmount: Currency;
FDueDate: TDateTime;
public
procedure TrackDebt(ClientID: string; Amount: Currency; DueDate: TDateTime);
procedure UpdateDebtStatus(ClientID: string);
end;
The closed-loop financial system in this CRM enables full automation and control over all financial aspects of logistics operations, ensuring security, transparency, and accuracy of transactions. The system integrates modules for order tracking, document flow automation, financial report generation, and handling commissions and taxes, significantly improving the efficiency of logistics operators.
An example of code demonstrating the closed-loop financial system within this CRM can be observed through the functionality related to order processing, payment tracking, and automatic integration with financial modules (e.g., commission and tax calculation, as well as revenue and expense tracking). The focus is on how the system handles transactions and ensures their completion, a hallmark of the closed-loop financial system.
Example code for order and payment processing with commission handling:
TOrder = class
private
FOrderID: string;
FClientID: string;
FTotalAmount: Currency;
FPaymentStatus: TPaymentStatus;
FCommissionRate: Double;
FReservedFunds: Currency;
public
procedure CreateOrder(ClientID: string; Amount: Currency);
procedure ReserveFunds(Amount: Currency);
procedure ProcessPayment(OrderID: string);
procedure CalculateCommission;
procedure CompleteOrder;
end;
procedure TOrder.CreateOrder(ClientID: string; Amount: Currency);
begin
FOrderID := GenerateOrderID;
FClientID := ClientID;
FTotalAmount := Amount;
FPaymentStatus := psPending;
end;
procedure TOrder.ReserveFunds(Amount: Currency);
begin
// Function to reserve client funds
FReservedFunds := Amount;
FPaymentStatus := psReserved;
end;
procedure TOrder.CalculateCommission;
var
CommissionAmount: Currency;
begin
// Commission calculation based on the given rate
CommissionAmount := FTotalAmount * FCommissionRate;
FTotalAmount := FTotalAmount - CommissionAmount;
end;
procedure TOrder.ProcessPayment(OrderID: string);
begin
if FPaymentStatus = psReserved then
begin
// Logic to transfer funds to the contractor
TransferFunds(FReservedFunds);
FPaymentStatus := psCompleted;
end;
end;
procedure TOrder.CompleteOrder;
begin
// Finalize the order after successful payment
if FPaymentStatus = psCompleted then
begin
FinalizeOrder(FOrderID);
end;
end;
Example of a stored procedure for integration with financial modules:
CREATE PROCEDURE CompleteOrderTransaction
@OrderID INT,
@ClientID INT,
@Amount DECIMAL(10,2),
@CommissionRate DECIMAL(5,2)
AS
BEGIN
-- Reserve client funds
UPDATE Accounts
SET ReservedFunds = ReservedFunds + @Amount
WHERE ClientID = @ClientID;
-- Calculate commission
DECLARE @CommissionAmount DECIMAL(10,2);
SET @CommissionAmount = @Amount * @CommissionRate;
-- Update balance considering the commission
UPDATE Accounts
SET Balance = Balance - @Amount + @CommissionAmount
WHERE ClientID = @ClientID;
-- Finalize the transaction
INSERT INTO Transactions (OrderID, Amount, Commission, Status)
VALUES (@OrderID, @Amount, @CommissionAmount, 'Completed');
END;
Procedure Description:
- Reserve Funds: Initially, the client’s funds are reserved in their account.
- Calculate Commission: The commission is then calculated and recorded in the database.
- Update Balance: After the commission is calculated, the client’s balance is updated, and the reserved funds are deducted.
- Finalize the Transaction: Once all steps are successfully completed, the transaction is recorded in the financial operations table, and the order is marked as completed.
This code demonstrates how the system ensures a closed-loop financial system by automating order management, reserving funds, calculating commissions, and completing transactions. Financial data is synchronized across system modules, ensuring full financial transparency and completion of each operation.
Conclusion
This CRM system offers a unique solution for the logistics industry, providing full automation, operational transparency, and secure transactions within a closed-loop financial system. The technologies applied in this system allow for reduced order processing time and improved operational efficiency, which is particularly crucial in the context of global international logistics operations.