Utility class to process scanned bar codes. More...
#include <bpsbarcode.h>
Public Types | |
| enum | Function { SSCC = 0, LotID = 100, StockLocation = 200, ArticleCU = 300, ArticleTU = 301, ArticleLU = 302, Partner = 400, ShipToPartner = 401, BillToPartner = 402, SellingPartner = 403, DeliveringPartner = 404, InvoicingPartner = 405 } |
| Bar code function types. More... | |
Public Member Functions | |
| BpsBarcode (BpsDatastore *aDatastore) | |
| BpsBarcode (BpsDatastore *aDatastore, char aCode, const QString &aData) | |
| BpsBarcode (BpsDatastore *aDatastore, const QString &aName, const QString &aData) | |
| BpsBarcode (const BpsBarcode &aOther) | |
| The copy constructor. | |
| char | code () const |
| QString | data () const |
| QString | data (Function aFunction, bool aForLookup) const |
| QStringList | names () const |
| QStringList | names (Function aFunction) const |
| void | setCode (char aCode) |
| Set code identifier. | |
| void | setData (const QString &aData) |
| Set bar code data (without the code type identifier). | |
| void | setName (const QString &aName) |
| Set code type name. | |
Static Public Member Functions | |
| static QMap< char, QStringList > | codeNames () |
| static QList < BpsBarcode::Function > | partnerFunctions () |
Utility class to process scanned bar codes.
The mapping of bar code types and application identifiers is taken from the central system settings. For each function the settings in Central System Settings/Scanning can hold a comma separated list of bar codes.
Example bar code lists in those settings:
See chapter Barcode scanning in the manual for more details.
The barcode data retrieved can be preprocessed for lookup. In this case only the length of the returned data should be matched against the code in the lookup table.
| CI | Name | Preprocessing |
|---|---|---|
| A | EAN8 | The check digit is truncated and the returned data length is 7. |
| B | EAN13 | In case the flag is 21, 22, 28 or 29 a code containing price or weight is assumed. The 5 price/weight digits and the check digit is truncated, and the returned data length is 7. For all other flags only the check digit is truncated and the returned data length is 12. |
| enum BpsBarcode::Function |
Bar code function types.
| BpsBarcode::BpsBarcode | ( | BpsDatastore * | aDatastore | ) |
| [in] | aDatastore | The current datastore object. |
| BpsBarcode::BpsBarcode | ( | BpsDatastore * | aDatastore, |
| char | aCode, | ||
| const QString & | aData | ||
| ) |
| [in] | aDatastore | The current datastore object. |
| [in] | aCode | The code type identifier. |
| [in] | aData | The code without prefix, suffix and code type identifier. |
| BpsBarcode::BpsBarcode | ( | BpsDatastore * | aDatastore, |
| const QString & | aName, | ||
| const QString & | aData | ||
| ) |
| [in] | aDatastore | The current datastore object. |
| [in] | aName | The code type name. |
| [in] | aData | The data without prefix, suffix and code type identifier. |
| BpsBarcode::BpsBarcode | ( | const BpsBarcode & | aOther | ) |
The copy constructor.
| [in] | aOther | The original object to clone. |
| char BpsBarcode::code | ( | ) | const |
| static QMap<char,QStringList> BpsBarcode::codeNames | ( | ) | [static] |
| QString BpsBarcode::data | ( | ) | const |
| QString BpsBarcode::data | ( | Function | aFunction, |
| bool | aForLookup | ||
| ) | const |
| [in] | aFunction | The function to find the data for. |
| [in] | aForLookup | When true, the data is preprocessed for lookup. |
| QStringList BpsBarcode::names | ( | ) | const |
| QStringList BpsBarcode::names | ( | Function | aFunction | ) | const |
| [in] | aFunction | The function to find the type names for. |
| static QList<BpsBarcode::Function> BpsBarcode::partnerFunctions | ( | ) | [static] |
| void BpsBarcode::setCode | ( | char | aCode | ) |
Set code identifier.
| [in] | aCode | The new code identifier. |
| void BpsBarcode::setData | ( | const QString & | aData | ) |
Set bar code data (without the code type identifier).
| [in] | aData | The new bar code data. |
| void BpsBarcode::setName | ( | const QString & | aName | ) |
Set code type name.
| [in] | aName | The new code type name. |