sgrRetornaAECompartilhada
Returns the data of a specific Shipment Authorization, where this SA can belong to the informed customer or to the shippers who are registered for this customer.
PARAMETERS
| Field | Type | Required? | Description |
|---|---|---|---|
| keyaccess | string | Yes | Key returned by the sgrLogin method. |
| cdpas | integer | Yes | PAS code, returned by the sgrListPASUser method |
| cdcliente | integer | Yes | Customer code, returned by the sgrListaEmpresasPASUsuario method. |
| cdviag | integer | Yes | Shipment authorization number. |
METHOD RETURN:
ReturnDataset: If the parameters are correctly filled in, the sgrData object property will be composed of the following tables: sgrTrip, sgrProducts and sgrDocuments.
sgrTrip:
| Field | Type | Description |
|---|---|---|
| CDVIAG | integer | Shipment Authorization Number |
| CDCLI | integer | Customer code |
| DSNOME | string | Customer name |
| CDOPINICIO | integer | Code of the user who initiated the trip |
| DSOPINICIO | string | Name of user who started the trip |
| CDOPENCERROU | integer | Code of the user who ended the trip |
| DSOPENCERROU | string | Name of the user who ended the trip |
| NRPLACACARRETA | string | License plate number 1 |
| NRPLACACARRETA2 | string | License plate number of trailer 2 |
| CHASSICARRETA2 | string | chassis number of trailer 2 |
| CHASSICARRETA | string | chassis number of trailer 1 |
| FLSITUATION | integer | Shipment authorization status code |
| DSFLSITUATION | string | SA status (New, In progress, Completed, Canceled) |
| DTPREVINI | datetime | Expected date/time to start the trip |
| DTPREVFIM | datetime | Estimated date/time for end of trip |
| DTINI | datetime | Trip start date/time |
| DTFIM | datetime | Trip end date/time |
| VLCARGE | float | Cargo value |
| CDCIDORIG | integer | City of origin code |
| DSCIDORIGEM | string | Name of city of origin |
| ESTADOORI | string | State of origin |
| CDCIDDEST | string | Destination city code |
| DSCIDDESTINATION | string | Destination city name |
| ESTADODES | string | Destination state |
| CDOPINCL | integer | Code of the user who included the AE |
| DSOPINCL | string | Name of the user who included the AE |
| CDOP | integer | Code of the last user who changed the AE |
| DSOPALTEROU | string | Name of the last user who changed the AE |
| NRPLACACAVALO | string | Horse license plate number |
| CHASSICAVALO | string | Horse's chassis number |
| DTINCL | datetime | AE inclusion date-time |
| DTALTER | datetime | Date-Time of last SA change |
| HORSE MODEL | string | Horse model |
| TRAILER MODEL | string | Trailer model 1 |
| MODELOCARRETA2 | string | Model of trailer 2 |
| MARCACAVALO | string | Horse brand |
| MARCACARRETA | string | Trailer brand 1 |
| MARCACARRETA2 | string | Trailer brand 2 |
| HORSE YEAR | whole | Horse year |
| ANOCARRETA | integer | Year of trailer 1 |
| ANOCARRETA2 | whole | Year of trailer 2 |
| HORSE | string | horse color |
| TRAILER | string | TRAILER1 color |
| CORCARRETA2 | string | Color of trailer 2 |
| TPCARCAVALO | string | Horse body type |
| TPCARCARRETA | string | Cart body type 1 |
| TPCARCARRETA2 | string | Body type of trailer 2 |
| NRCPFMOT1 | string | Driver's CPF number 1 |
| DSMOTORISTA1 | string | Driver's name 1 |
| RGMOT1 | string | Driver's ID number 1 |
| EMISRGMOT1 | string | Driver's ID issuing agency 1 |
| NRCPFMOT2 | string | Driver's CPF number 2 |
| DSMOTORISTA2 | string | Driver 2's name |
| RGMOT2 | string | Driver's ID number 2 |
| EMISRGMOT2 | string | Driver 2's ID issuing agency |
| CDROTA | integer | Route code |
| DSROTA | string | Route name |
| CDTRANSP | integer | Carrier code |
| DSNOMETRANSP | string | Carrier Name |
| CDENDRASTR | string | Horse tracker number |
| CDEMPRASTREA | integer | Tracking Company Code |
| DSNOMEEMPRASTREA | string | Tracking company name |
| CDGERRISCOCLI | integer | Management rule code |
| DSNOMEREGRA | string | Management rule description |
| NRFONECEL | string | Driver's cell phone |
| DSMOTIVOCANCELA | string | Description |
| CDEMBARCADOR | integer | Shipper code |
| NOMEBARCADOR | string | Name of the shipper |
| NRCONTROLECARGO | string | Field for free use by the customer (20 characters). |
| VINCMOT1 | string | Driver 1 link type code |
| DSVINCMOT1 | string | Description |
| VINCMOT2 | string | Driver 2 link type code |
| DSVINCMOT2 | string | Description |
| FLTPOPER | integer | Operation type code |
| DSFLTPOPER | string Description | type of operation (Transfer, Pickup, Delivery, Pickup/Delivery). |
| PHOTOMOTORIST | byte[] | Driver photo 1 |
| DSMSGAE | string | Message to print on AE |
| TIPOMSG | string | Message type |
| DSFONE0800 | string | 0800 number |
| NRFROTACAVALO | string | Horse fleet number |
| FLNAOIMPRIMEAE | integer | Indicates whether the data for this AE can be printed in the system (AE print report). |
| vlTotalTimeContinuousDirection | string | Vehicle Moving Time |
| vlTotalTimeStopped | string | Time the vehicle was stopped |
| vlTotalTimeFeeding | string | Time in Feeding |
| vlTotalTimeOvernight | string | Overnight Time |
| vlTotalTimeTravel | string | TimeTraveling |
| CurrentTripSituation | string | The current trip situation can be: In Collection/Delivery, Stopped for Food, Stopped, Moving, Trip Ended, Loading/Unloading, End of Loading/Unloading, Stopped for Overnight. |
| CurrentTripSituationTimeMinutes | datetime | Time the trip is in this situation (in minutes). |
| FLIGNITION | integer | Ignition situation |
| DSIGNICAO | string | Ignition status (Off, On, Undefined, Trip not in progress) |
sgrProducts:
| Field | Type | Description |
|---|---|---|
| CDPROD | integer | Product code |
| DSPPROD | string | Product Description |
| VLPROD | float | Product value |
sgrDocuments:
| Field | Type | Description |
|---|---|---|
| CDCLI | integer | Shipper code |
| NRDOC | string | Shipper document number |
| FLTPDOC | integer | Document type |
| VLVALUE | float | Document value |
| FLSITUATION | integer | Document status |
| NRCGCCPF | string | recipient's CNPJ/CPF |
| CDPAISORIGIN | integer | Recipient's country of origin code |
| DSSITUATION | string | Document status description |
| FLTPOPER | integer | Transaction type code |
| DSTPOPER | string | Type of operation (Transfer, Collection, Delivery, Collection/Delivery). |
| CDDOC | Integer | Document code |
| DTPREVISTA | datetime | Estimated date/time for collection/delivery |
| DTREALIZED | datetime | Date/Time of collection/delivery |
| DTPREVISTASAIDA | datetime | Expected date/time to leave pickup/delivery location |
| DSRUA | string | Collection/delivery address |
| NRRUA | string | Pickup/delivery address number |
| DSBAIRRO | string | Pickup/delivery neighborhood |
| NRCEP | string | ZIP code of collection/delivery address |
| DSNAME | string | Name of collection/delivery location |
| CDCID | integer | Recipient/delivery/collection city code |
| DSNOMECID | string | Recipient/delivery/pickup city name |
| DSCOMPLRUA | string | Recipient/delivery/collection address complement |
| NRFONE1 | string | Recipient/delivery/collection phone number |
| NRFONE2 | string | Recipient/delivery/pickup phone number |
| VLLAT | float | Latitude |
| VLLONG | float | Longitude |
| VLSEQDEST | string | Secondary address string of recipient/pickup/delivery |
| VLQTDEPECAS | integer | Number of pieces transported |
| VLQTDEVOL | integer | Number of volumes transported |
| NRCONTROLLER1 | string | Customer control 1 |
| NRCONTROLECLIENT2 | string | Client control 2 |
| NRCONTROLECLIENTE3 | string | Client control 3 |
| NRLACRESIF | string | Client control 4 |
| NRLACREARMADOR | string | Client control 5 |
| DSNAVIO | string | Client control 6 |
| NRCGCCPFEMITENTE | string | CNPJ of issuer |
| CDPAISORIGINEMITENT | string | Issuer's country of origin code |
| FLTROCANOTA | Boolean | Indicates whether this document can be replaced. |
| NRDOCTROCA | string | Number of the document chosen for replacement. |
ReturnDescription: If there is an error when executing the method, the property will be displayed:
| Error | Description |
|---|---|
| Trip risk management rule does not allow printing/return of boarding authorization data. | This trip is linked to a GR rule that does not allow printing. If you need to do this, ask your account manager for assistance. |
| The requested trip was not found! |