...
Select the company who need access to the carrier then click Add & Close button.
Next step is need to be done using back end process.
- Create a CarrierService for the carrier.
- Create to CarrierProviderCarrierServiceTypeMapping.
- Create to CarrierProviderCarrierMapping.
...
Change the below parameter:
INSERT INTO @Temp SELECT 'TESTINTERNATIONAL', 'TESTINTERNATIONAL' = Enter the Carrier Service Name and Carrier Service Code.
@CarrierCompanyCode = CompanyCode/CarrierCode
...
If value is 1, This is Live
SET @ServiceName = Carrier Service Name
SET @ServiceCode = Carrier Service Code
Run the below script.SET NOCOUNT ON
DECLARE @Temp TABLE(ServiceName nvarchar(max), ServiceCode nvarchar(max))
INSERT INTO @Temp SELECT 'TESTINTERNATIONAL', 'TESTINTERNATIONAL'
DECLARE @CarrierCompanyName nvarchar(max), @CarrierCompanyCode nvarchar(max), @CarrierCompanyID uniqueidentifier, @CarrierProvider nvarchar(max),
@CarrierProviderID uniqueidentifier, @CarrierServiceTypeID uniqueidentifier, @ReleaseProfile int, @ServiceName nvarchar(max), @ServiceCode nvarchar(max),
@NEWID1 uniqueidentifier, @NEWID2 uniqueidentifier, @NEWID3 uniqueidentifier, @UserID uniqueidentifier
SET @CarrierCompanyCode = 'TESTNLINDNL'
SET @CarrierCompanyName = 'TEST IND NL'
SET @CarrierProvider = 'Indigina TMS'
SET @ReleaseProfile = 0 --0-QA/UAT 1-Live
SET @ServiceName = 'INDTEST'
SET @ServiceCode = 'INDTEST'
SELECT @NEWID1 = NEWID()
SELECT @NEWID2 = NEWID()
SELECT @NEWID3 = NEWID()
SELECT TOP 1 @CarrierCompanyID = CompanyID FROM Company WHERE CompanyDescription = @CarrierCompanyName AND OwnerCompanyID = CompanyID AND DisableLevel = 0 ORDER BY CreateDate
SELECT TOP 1 @CarrierProviderID = CarrierProviderID FROM CarrierProvider WHERE Name = @CarrierProvider
SELECT TOP 1 @UserID = UserID FROM Users WHERE UserName = 'SystemDefault' AND DisableLevel = 0 ORDER BY CreateDateIF NOT EXISTS(SELECT * FROM CarrierServiceType WHERE ServiceCode IN (SELECT ServiceCode FROM @Temp))
BEGIN
INSERT INTO CarrierServiceType(CarrierServiceTypeID, CarrierID, ServiceCode, ServiceName, CreateDate, CreateUserID, DisableLevel, LastModifiedDate, LastModifiedUserID)
SELECT @NEWID1, @CarrierCompanyID, ServiceCode@ServiceCode, ServiceName@ServiceName, GETUTCDATE(), @UserID, 0, GETUTCDATE(), @UserID FROM @Temp
SELECT TOP 1 @CarrierServiceTypeID = CarrierServiceTypeID FROM CarrierServiceType WHERE ServiceName IN (SELECT ServiceName FROM @Temp)= @ServiceName
INSERT INTO CarrierProviderCarrierServiceTypeMapping (CarrierProviderCarrierServiceTypeMappingID, CarrierProviderID, CarrierServiceTypeID, MappedID, MappedCode, CreateDate, CreateUserID, DisableLevel, ReleaseProfile, LastModifiedDate, LastModifiedUserID)
SELECT @NEWID2, @CarrierProviderID, @CarrierServiceTypeID, NULL, ServiceCode@ServiceCode, GETUTCDATE(), @UserID, 0, @ReleaseProfile, GETUTCDATE(), @UserID FROM @Temp
INSERT INTO CarrierProviderCarrierMapping (CarrierProviderCarrierMappingID, CarrierProviderID, CarrierID, CreateDate, CreateUserID, DisableLevel, MappedCode, ReleaseProfile, LastModifiedDate, LastModifiedUserID)
SELECT @NEWID3, @CarrierProviderID, @CarrierCompanyID, GETUTCDATE(), @UserID, 0, @CarrierCompanyCode, @ReleaseProfile, GETUTCDATE(), @UserID
END
ELSE
BEGIN
SELECT 'ServiceCodes already exist!!!'
END
MANUAL ADD CARRIER TO PROVIDER INTEGRATION
Notes: If the carrier is newly created then it is required to activate TMS dispatch.
DECLARE @CarrierProviderID uniqueidentifier, @CarrierID uniqueidentifier, @NEWID uniqueidentifier, @CarrierName nvarchar(max), @CarrierProvider nvarchar(max)
SET @CarrierName = 'IND NL'
SET @CarrierProvider = 'Indigina TMS'
SET @NEWID = NEWID()
SELECT TOP 1 @CarrierProviderID = CarrierProviderID FROM CarrierProvider WHERE Name = @CarrierProvider
SELECT TOP 1 @CarrierID = CompanyID FROM Company WHERE CompanyDescription = @CarrierName AND OwnerCompanyID = CompanyID AND DisableLevel = 0 ORDER BY CreateDate
INSERT INTO CarrierProviderIntegration (CarrierProviderIntegrationID, CarrierProviderID, CustomerID, DCID, CarrierID, CreateDate)
VALUES (@NEWID, @CarrierProviderID, NULL, NULL, @CarrierID, GETUTCDATE())
MANUAL ADD PROVIDER SETTING / RULES
Notes: This is just an optional if customer requested for the carrier.
DECLARE @CarrierProviderID uniqueidentifier, @CarrierID uniqueidentifier, @NEWID uniqueidentifier, @CarrierName nvarchar(max), @CarrierProvider nvarchar(max),
@Setting nvarchar(max), @Value nvarchar(max)
SET @CarrierName = 'P2P NL'
SET @CarrierProvider = 'Indigina TMS'
SET @Setting = 'SendParcelContent'
SET @Value = 'All'
SET @NEWID = NEWID()
...