pixiGetPosJournal
Returns the POS cash journal (register events with amounts, invoices and running register value) for a date range, location and register.
Returns the cash journal (Kassenbuch) of the Pixi POS module. The work is done by the internal procedure CR_POS_Kassenbuch. Its rows are buffered, and a reduced set of columns is returned.
Steps:
- The common API envelope checks the call frequency. If the minimum interval configured for this function has not passed, only a status row with
ResultCode502is returned and no journal data is read. - Defaults are applied:
FromDateandToDatedefault to today.FromDateis used as given, including its time.ToDateis extended to the end of its day.
- POS session events in the range are selected. Events of type
Iare excluded.LocIDlimits the result to one location.NULLor empty means all locations.RegisterIDlimits the result to one register.''orNULLmeans all registers.
- Each event is joined with the POS invoice header, if one exists, and with a description of the event type:
S= POS StartE= POS StopP= InvoiceD= Drawer Open
RegisterValueis the running total ofAmountIn - AmountOutover all selected events with anEventTimeup to and including the current one.EventCommentcombines the event comment and the invoice comment, separated by a line break.
The internal procedure sorts by EventTime.
Notes
- Call statistics: the API envelope writes the time of the call into
API_STATISTICS. This is the only write access. - Reads: all reads of journal data use
NOLOCK, so uncommitted data may appear. - Sort order: the final
SELECTreads from a table variable without its ownORDER BY. The order byEventTimeis therefore not strictly guaranteed. - Running total:
RegisterValueis calculated over all selected events, not per register or per location. When several registers or locations are queried at once, the value mixes them. It also starts at 0 atFromDate; there is no opening balance from before the range. - End of range:
ToDateis converted withCAST(... AS INTEGER). Fordatetimevalues this rounds to the nearest day, so aToDatewith a time of 12:00 or later extends the range to the end of the following day. PassToDatewithout a time. - VAT rates: events are inner-joined with VAT rates from
fPixi_GetVATRate(not attached). If that function returns no rate for a location, the events of that location are missing from the result. - Always empty:
CreatedByandUpdatedByare alwaysNULL. - Unknown types:
EventDescriptionisNULLfor event types other thanS,E,PandD.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
FromDate
|
datetime dateTime |
NULL |
Start of the period (inclusive, time is respected). Example: |
ToDate
|
datetime dateTime |
NULL |
End of the period. It is extended to the end of its day; times of 12:00 or later round to the next day. Example: |
LocID
|
varchar(3) string |
NULL |
Location (Lager) of the POS session. Example: |
RegisterID
|
varchar(30) string |
– |
POS register ID. Empty or Example: |
ResultCode
OUTPUT
|
char(3) string |
NULL |
Result code of the API envelope. Allowed values
Example: |
ResultText
OUTPUT
|
varchar(1024) string |
NULL |
Result text: Example: |
Result set 1 · If the call frequency check passes (ResultCode = 200)
One row per POS session event in the period, except events of type I.
| Column | Type | Description |
|---|---|---|
EventTime
Nullable |
datetime dateTime |
Time of the event. |
RegisterID
Nullable |
varchar(30) string |
POS register of the session. |
CreatedBy
Nullable |
varchar(50) string |
Always |
UpdatedBy
Nullable |
varchar(50) string |
Always |
EventType
Nullable |
char(1) string |
Event type: |
EventDescription
Nullable |
varchar(100) string |
English name of the event type ( |
InvoiceNr
Nullable |
varchar(20) string |
Document number of the linked POS invoice. |
InvoiceAmount
Nullable |
money decimal |
Total of the linked POS invoice. |
EventComment
Nullable |
varchar(max) string |
Event comment and invoice comment, separated by a line break if both exist. |
AmountOut
Nullable |
money decimal |
Amount taken out of the register. |
VatHigh
Nullable |
money decimal |
VAT amount at the standard rate of the invoice. |
VatLow
Nullable |
money decimal |
VAT amount at the reduced rate of the invoice. |
AmountIn
Nullable |
money decimal |
Amount paid into the register. |
RegisterValue
Nullable |
money decimal |
Running total of |
Result set 2 · If the call frequency limit is exceeded (ResultCode = 502)
Status row from the API envelope; no journal data follows.
| Column | Type | Description |
|---|---|---|
ResultCode
|
char(3) string |
Always |
ResultText
|
varchar(1024) string |
Message with the remaining wait time in milliseconds. |
Response example
<SqlRowSet1>
<row>
<EventTime>2024-05-01T08:00:12</EventTime>
<RegisterID>KASSE01</RegisterID>
<EventType>S</EventType>
<EventDescription>POS Start</EventDescription>
<AmountOut>0.0000</AmountOut>
<AmountIn>150.0000</AmountIn>
<RegisterValue>150.0000</RegisterValue>
</row>
<row>
<EventTime>2024-05-01T09:15:40</EventTime>
<RegisterID>KASSE01</RegisterID>
<EventType>P</EventType>
<EventDescription>Invoice</EventDescription>
<InvoiceNr>K2024-000123</InvoiceNr>
<InvoiceAmount>39.9000</InvoiceAmount>
<AmountOut>0.0000</AmountOut>
<VatHigh>6.3700</VatHigh>
<VatLow>0.0000</VatLow>
<AmountIn>39.9000</AmountIn>
<RegisterValue>189.9000</RegisterValue>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| 502 | ({WaitMsec}) Frequency quote exceeded. Next call to this function can be made in ca. {WaitMsec} milliseconds | The call was made before the minimum interval configured in `API_CONTROL` for this function had passed. Wait the given time and call again. |
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
Authorization: Basic BASE64(USERNAME:PASSWORD)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiGetPosJournal>
<!-- <FromDate>2024-05-01T00:00:00</FromDate> -->
<!-- <ToDate>2024-05-31T00:00:00</ToDate> -->
<!-- <LocID>001</LocID> -->
<!-- <RegisterID>KASSE01</RegisterID> -->
<!-- <ResultCode>200</ResultCode> -->
<!-- <ResultText>OK</ResultText> -->
</ns1:pixiGetPosJournal>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
curl -X POST 'https://apigateway.descartes.com/tms/pixi/' \
--user 'USERNAME:PASSWORD' \
--header 'Content-Type: text/xml; charset=utf-8' \
--data-binary @- <<'XML'
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiGetPosJournal>
<!-- <FromDate>2024-05-01T00:00:00</FromDate> -->
<!-- <ToDate>2024-05-31T00:00:00</ToDate> -->
<!-- <LocID>001</LocID> -->
<!-- <RegisterID>KASSE01</RegisterID> -->
<!-- <ResultCode>200</ResultCode> -->
<!-- <ResultText>OK</ResultText> -->
</ns1:pixiGetPosJournal>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML
<?php
$soapClient = new SoapClient(null, [
'login' => 'USERNAME',
'password' => 'PASSWORD',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
]);
$arguments = [
// 'FromDate' => '2024-05-01T00:00:00',
// 'ToDate' => '2024-05-31T00:00:00',
// 'LocID' => '001',
// 'RegisterID' => 'KASSE01',
// 'ResultCode' => '200',
// 'ResultText' => 'OK',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetPosJournal', $soapArguments);
- SQL object:
- dbo.pipiGetPosJournal