Ga naar inhoud

Modules bring

Bring Module

The BRING module implements the interaction between Bring API and warta. The actual Bring API is implemented in the bringapi unit.

The methods of this module are exported in the bring service

BookAndGetPDF

This method will book a parcel/letter order with Bring using Booking, Label or Mailbox API, depending on service code and settings.

Declaration

Function BookAndGetPDF(Const aCode : String; APDF : TStream) : Boolean;
The code is an ID of table OUT (field AVIZ). On successs true is returned, and the aPDF stream will contain the label to be printed.

The database is updated with the result of the call.

BookAndGetZPL

This method will book a parcel/letter order using booking, label or Mailbox API depending on service code and settings.

Declaration

Function BookAndGetZPL(Const aCode : String; AZPL, APDF : TStream) : Boolean;
The code is an ID of table OUT (field AVIZ). On successs true is returned, and the aPDF stream will contain the label to be printed (if one is returned), the aZPL contains a ZPL printer command file for RFID Tracking (if one is returned).

The call will update the database with the package number returned by the BRING API.

ConvertOrder

Convert an order to the given service code.

Declaration

procedure ConvertOrder(const aCode: String; AServiceCode: String);
This updates the database.

GetLettersToConfirm

Get a list of 3570 service code orders that must be confirmed on the given date.

Declaration

Function GetLettersToConfirm(aDate : TDateTime; AList : TConfirmList) : Integer;
The function returns the number of orders, aList contains a list of IDs and package numbers (as returned by the booking call)

ConfirmLetters

Confirm the letter orders in the list using the Bring API. The database is updated with the Bring order ID.

Declaration

Function ConfirmLetters(AList : TConfirmList) : Integer;
The function returns the number of confirmed items from the list, as returned by the BRING API.

ConfirmLettersOnDate

This call combines the GetLettersToConfirm and ConfirmLetters calls, executing the second if the first returned a non-empty list.

Declaration

Function ConfirmLettersOnDate(aDate : TDateTime) : Integer;