Projects:SPAINTIR Integration/Technical Specification
In this document are described all the developments needed to properly implement the Spaintir Integration module.
- Name: 'Spaintir Integration
- Java Package: org.openbravo.erputil.carrierintegration.spaintirintegration
- DB Prefix: OBCIST
- Commercial: Yes
- Carrier Integration v. 1.0.3
The module integrates with Spanish SPAINTIR carrier and aims the Spanish market so the base language is Spanish (Spain).
Spaintir Integration Module
Spaintir Integration Configuration
Single tab window based on OBEUSES_SPAINTIR_CONF table. Contains all the parameters needed to configure the integration with Spaintir. It is linked with the Carrier Integration window.
The main fields to fill are: Name: The name to the configuration report. Generate label: Check to indicate if the customer will generate the labels. If unchecked, the tracking number and the labels are generated in the carrier. If checked, is needed to specify the sequence to get the tracking number for the package. Sequence: The number sequence to generate track numbers fot the packs. Only used if the check Genarete Label is checked. URL: The ftp host to upload the generated flat file. Port: The port of the FTP server. Username: The username of the FTP server. Password: The password of the FTP server. Customer Code: The customer code to fill the header record in the flat file. Carrier Configuration: The carrier integration to be linked with.
- The volume of the package to be delivered.
- UOM of the package
- Spaintir needs to know which kind of package is going to be delivered (box, pallet, etc.). This combo only shows the UOM which UOM Type is 'Bulto'.
- The incoterms code for international deliveries.
- Conditioned goods
- If the goods are conditioned indicate explanatory.
- Determines if the package is going to be sent by air, land or sea.
- Condition amount
- The amount over the condition value.
- Currency of the condition amount.
- Delivery Notes 2
- More space to give instructions to the carrier.
- Fully Assurance
- Checked if the goods are fully assured.If checked in the generated flat file will appear 'S' in the last position.
- Check to specify if the ADR is covered in this delivery or not. If checked in the generated flat file will appear 'S' in the last position.
Carrier Integration record
Each module that integrates Openbravo with carriers have to include a record in Carrier Integration window. The window is only visible for System Administrator roles.
In this module there is a record in the table specifying the java class: org.openbravo.erputil.carrierintegration.spaintirintegration.SpaintirIntegration
Integrate with Carrier
This process is executed by the java class org.openbravo.erputil.carrierintegration.spaintirintegration.SpaintirIntegration. The objective of the process, in this case, is to generate a flat file that follows the specification stablished by SPAINTIR.
After the file generation, the process has to upload the file to the specified FTP server in Spaintir Integration Configuration window.
This class implements the following methods of the abstract class CarrierIntegration.class:
This method initializes the Integration Process global objects using the Pack that is being integrated. In this method has beend added the initialization of the global object spaintirConf. This object stores the info of Spaintir Integration Configuration window.
The following validations have been added:
- A record in Spaintir Integration Configuration window is mandatory.
- The document number of the pack cannot be null
- The weight of the package can't be 0.
- The sender address (Organization address) can't be null and has to be fullfilled (Address line 1, city, postal code and country).
- The consignee address (Partner address) can't be null and has to be fullfilled (Address line 1, city, postal code and country).
- The country of the consignee address has to have Spaintir code.
When all the validations are successful it is executed the integration process. To do so this class implements the doProcess abstract method of the CarrierIntegration.class.
This method generates a flat fixed length file as specified by SPAINTIR.
After the file is generated the process uploads it to the FTP server configured in Spaintir Integration Configuration window.
At the end of the execution, the process updates the tracking number of the boxes if the check Generate labels is checked in the configuration.