BPS order utilities. More...
#include <bpsorderutils.h>
Public Types | |
| enum | OuIndex { O_unknown, O_LU, O_TU, O_CU, O_PU } |
| Order unit enumeration. More... | |
| enum | PuIndex { P_unknown, P_Piece, P_Kilo, P_Liter, P_Meter, P_SquareMeter, P_CubicMeter } |
| Price unit enumeration. More... | |
| enum | StockModeIndex { SM_unknown, SM_Regular, SM_FIFO, SM_Quick } |
| Stock handling modes. More... | |
Public Member Functions | |
| void | addToStock (const QVariantMap &aParams) |
| Adds or subtracts stock quantities and updates other stock fields. | |
| BpsOrderUtils (BpsDatastore *aDatastore, QObject *aParent=0) | |
| Constructor for the BpsOrderUtils objects. | |
| void | cancelOrderPick (const QVariant &aPickKey) |
| Cancel an existing pick by deleting the record in t_orderpicks. | |
| QVariant | cloneArticle (const QVariant &aKey) |
| Make an exact copy of the original article, with exception of the key. | |
| QVariant | clonePartner (const QVariant &aKey) |
| Make an exact copy of the original partner, with exception of the key. | |
| QVariant | cloneRecord (const QVariant &aKey, const QString &aName) |
| Make an exact copy of an arbitrary BPS record, with exception of the key. | |
| QString | cprToString (const QVariant &aCpr) |
| Convert a consumer price to string. | |
| BpsDatastore * | datastore () const |
| QString | dprToString (const QVariant &aDpr) |
| Convert a dealer price to string. | |
| QVariantMap | finishOrderRow (const QVariantMap &aParams) |
| Finish a order row. | |
| bool | finishPurchaseOrder (const QVariant &aOrderKey, bool aLock=false, int aTimeout=0) |
| Finishes a purchase order having the status ready, active or completed, and not having any blocked deliveries. | |
| bool | getSellPrices (const QVariant &aArticleKey, const QDateTime &aStart, QVariant &aDpr, QVariant &aCpr, QVariant &aCode) |
| Find the prices for a certain article and starting date/time. | |
| bool | getZoneMergeclass (const QVariant &aTripclassKey, const QVariant &aArticleclassKey, const QVariant &aPartnerclassKey, QVariant &aZoneKey, QVariant &aMergeclassKey) |
| Get the zone and merge class for a combination of trip, article and partner class. | |
| bool | isOrdercolLocked (const QVariant &aKey) |
| Checks if the order column, the open trip, or any of the details belonging to the column are locked. | |
| bool | isOrderitemLocked (const QVariant &aKey) |
| Checks if the order detail or any parent record is locked. | |
| bool | isOrderrowLocked (const QVariant &aKey) |
| Checks if the order row, the open trip, the related columns or any of the details belonging to the row are locked. | |
| bool | isOrdertripLocked (const QVariant &aKey) |
| Checks if the open trip or any of the order rows, columns or details belonging to it are locked. | |
| bool | isPurchaseItemLocked (const QVariant &aKey) |
| Checks if the purchase order item or the parent purchase order record is locked. | |
| bool | isPurchaseOrderLocked (const QVariant &aKey) |
| Checks if the purchase order or any of the items belonging to the order are locked. | |
| bool | isRobotLocked (const QVariant &aKey) |
| Checks if the zone is currently robot-locked. | |
| bool | lockAllOrderitems (const QVariant &aKID, int aTimeout=0) |
| Lock a list of order items. | |
| bool | lockAllOrderitems (const QVariantList &aKeys, int aTimeout=0) |
| Lock a list of order items. | |
| bool | lockOrdercol (const QVariant &aKey, int aTimeout=0) |
| Lock an order column. | |
| bool | lockOrderitem (const QVariant &aKey, int aTimeout=0) |
| Lock an order item. | |
| QVariantList | lockOrderitems (const QVariantList &aKeys, int aTimeout=0) |
| Lock a list of order items. | |
| bool | lockOrderrow (const QVariant &aKey, int aTimeout=0) |
| Lock an order row. | |
| bool | lockOrdertrip (const QVariant &aKey, int aTimeout=0) |
| Lock an open trip. | |
| bool | lockPurchaseItem (const QVariant &aKey, int aTimeout=0) |
| Lock a purchase order item. | |
| QVariantList | lockPurchaseItems (const QVariantList &aKeys, int aTimeout=0) |
| Lock a list of purchase order items. | |
| bool | lockPurchaseOrder (const QVariant &aKey, int aTimeout=0) |
| Lock a purchase order. | |
| bool | lockRobot (const QVariant &aKey, int aTimeout=0) |
| Lock a zone for exclusive robot access. | |
| QVariantMap | makeOrderItem (const QVariantMap &aParams) |
| Creates a new order item. | |
| QVariant | makeOrderPick (const QVariantMap &aParams) |
| Make an order pick. | |
| QVariantMap | makePurchaseItem (const QVariantMap &aParams) |
| Creates a new purchase order item. | |
| void | setStock (const QVariantMap &aParams) |
| Set the absolute stock quantities and updates other fields. | |
| QString | tripdateToString (const QVariant &aTripdate) |
| Convert a order trip date to string. | |
| void | unlockOrdercol (const QVariant &aKey) |
| Unlock the order column, in case it was locked by the current actor. | |
| void | unlockOrderitem (const QVariant &aKey) |
| Unlock the order item. | |
| void | unlockOrderitems (const QVariant &aKID) |
| Unlock a list of order items held in table t_keyids. | |
| void | unlockOrderitems (const QVariantList &aKeys) |
| Unlock a list of order items. | |
| void | unlockOrderrow (const QVariant &aKey) |
| Unlock the order row, in case it was locked by the current actor. | |
| void | unlockOrdertrip (const QVariant &aKey) |
| Unlock the open trip, in case it was locked by the current actor. | |
| void | unlockPurchaseItem (const QVariant &aKey) |
| Unlock the purchase order item, in case it was locked by the current actor. | |
| void | unlockPurchaseItems (const QVariantList &aKeys) |
| Unlock a list of purchase order items, in case they were locked by the current actor. | |
| void | unlockPurchaseOrder (const QVariant &aKey) |
| Unlock the purchase order, in case it was locked by the current actor. | |
| void | unlockRobot (const QVariant &aKey) |
| Unlock the zone, in case it was locked by the current actor. | |
Static Public Member Functions | |
| static OuIndex | orderUnitIndex (const QVariant &aOu) |
| Get the enumeration for a order unit code. | |
| static QString | orderUnitName (OuIndex aOu) |
| Get the human readable and translated order unit name (LU, TU, CU, PU) from a order unit index (O_LU, O_TU, O_CU, O_PU). | |
| static QString | orderUnitName (OuIndex aOu, PuIndex aPu) |
| Get the human readable and translated order unit name (LU, TU, CU, Piece, Kilo, Liter, Meter, M2, M3) from a order unit index and price unit index. | |
| static QString | orderUnitName (const QVariant &aOu) |
| Get the human readable and translated order unit name (LU, TU, CU, PU) from a order unit code ("L", "T", "C", "P"). | |
| static QString | orderUnitName (const QVariant &aOu, const QVariant &aPu) |
| Get the human readable and translated order unit name (LU, TU, CU, Piece, Kilo, Liter, Meter, M2, M3) from a order unit index and price unit index. | |
| static QString | priceUnitAbbreviation (PuIndex aPu) |
| Get the abbreviated, maximum 3 character price unit name (PCS, KG, L, M, M2, M3) from a price unit index (P_Piece, P_Kilo, P_Liter, P_Meter, P_SquareMeter, P_CubicMeter). | |
| static QString | priceUnitAbbreviation (const QVariant &aPu) |
| Get the abbreviated, maximum 3 character price unit name (PCS, KG, L, M, M2, M3) from a price unit code (p, k, l, m, s, c). | |
| static PuIndex | priceUnitIndex (const QVariant &aPu) |
| Get the enumeration for a price unit code. | |
| static QString | priceUnitName (PuIndex aPu) |
| Get the human readable and translated price unit name (Piece, Kilo, Liter, Meter, M2, M3) from a price unit index (P_Piece, P_Kilo, P_Liter, P_Meter, P_SquareMeter, P_CubicMeter). | |
| static QString | priceUnitName (const QVariant &aPu) |
| Get the human readable and translated price unit name (Piece, Kilo, Liter, Meter, M2, M3) from a price unit code (p, k, l, m, s, c). | |
| static StockModeIndex | stockModeIndex (const QVariant &aMode) |
| Get the enumeration for a stock mode code. | |
| static QString | stockModeName (StockModeIndex aMode) |
| Get the human readable and translated stock mode name (Regular, FIFO, Quick) from a stock mode index (SM_Regular, SM_FIFO, SM_Quick). | |
| static QString | stockModeName (const QVariant &aMode) |
| Get the human readable and translated stock mode name (Regular, FIFO, Quick) from a price unit code (r, f, q). | |
BPS order utilities.
This class assembles a collection of utilities used for order processing.
| BpsOrderUtils::BpsOrderUtils | ( | BpsDatastore * | aDatastore, |
| QObject * | aParent = 0 |
||
| ) |
Constructor for the BpsOrderUtils objects.
| aDatastore | Datastore to work on. |
| aParent | Pointer to an optional parent object. |
| void BpsOrderUtils::addToStock | ( | const QVariantMap & | aParams | ) |
Adds or subtracts stock quantities and updates other stock fields.
Lus, tus and cus are normalized in the stock, e.g. recalculated according to the factors tu/lu and cu/tu for better human readability.
| [in] | aParams | The parameters defining the stock action.
|
| void BpsOrderUtils::cancelOrderPick | ( | const QVariant & | aPickKey | ) |
Cancel an existing pick by deleting the record in t_orderpicks.
If the pick was taken from stock, this operation will also add the picked quantities back to the stock in the same transaction.
| [in] | aPickKey | Key of the record in t_orderpicks. |
| QVariant BpsOrderUtils::cloneArticle | ( | const QVariant & | aKey | ) |
Make an exact copy of the original article, with exception of the key.
Copies also all subtables of the article record like prices, bar codes, fields and whatever new subtables may come in future releases of BPS.
Stock records are excluded, although in the workplace they are found in the article master data for convenience, they do not really belong to master data but are more like transaction data.
| [in] | aKey | Key of the original article record. |
| BpsException | when original article does not exist. |
| QVariant BpsOrderUtils::clonePartner | ( | const QVariant & | aKey | ) |
Make an exact copy of the original partner, with exception of the key.
Copies also all subtables of the partner record like attributes, departments and whatever new subtables may come in future releases of BPS.
| [in] | aKey | Key of the original partner record. |
| BpsException | when original partner does not exist. |
| QVariant BpsOrderUtils::cloneRecord | ( | const QVariant & | aKey, |
| const QString & | aName | ||
| ) |
Make an exact copy of an arbitrary BPS record, with exception of the key.
The record must have a primary column c_key, the table must be the given name with prefix t_, and there must exist a sequence with the given name and prefix s_.
// clone a resource in update safe manner QVariant key = utils->cloneRecord(oldKey, bStr("resources"));
| [in] | aKey | Key of the original record. |
| [in] | aName | Name of the table and sequence, without prefixes. |
| BpsException | when original record does not exist. |
| QString BpsOrderUtils::cprToString | ( | const QVariant & | aCpr | ) |
Convert a consumer price to string.
The mask is taken from the validator for t_articleprices.c_cpr. Null values are converted to an empty string.
| [in] | aCpr | The consumer price to convert. |
| BpsDatastore* BpsOrderUtils::datastore | ( | ) | const |
| QString BpsOrderUtils::dprToString | ( | const QVariant & | aDpr | ) |
Convert a dealer price to string.
The mask is taken from the validator for t_articleprices.c_dpr. Null values are converted to an empty string.
| [in] | aDpr | The dealer price to convert. |
| QVariantMap BpsOrderUtils::finishOrderRow | ( | const QVariantMap & | aParams | ) |
Finish a order row.
There are 2 modes of operation:
| [in] | aParams | The parameters defining the finish action.
|
| Key | Description |
|---|---|
| orderpicks_delivery | The delivery ID used. |
| new_ordertrips | Keys of the new created order trips in table t_ordertrips. |
| new_orderrows | Keys of the new created partner orders in table t_orderrows. |
| new_ordercols | Keys of the new created article orders in table t_ordercols. |
| new_orderitems | Keys of the new created order items in table t_orderitems. |
| bool BpsOrderUtils::finishPurchaseOrder | ( | const QVariant & | aOrderKey, |
| bool | aLock = false, |
||
| int | aTimeout = 0 |
||
| ) |
Finishes a purchase order having the status ready, active or completed, and not having any blocked deliveries.
The following tasks are performed:
| [in] | aOrderKey | Key of the purchase order (t_purchaseorders.c_key) |
| [in] | aLock | True = lock the order while processing. False = do not lock/unlock (because order was locked in advance). |
| [in] | aTimeout | Locking time out in seconds. Special values: 0 = no wait, -1 = wait endless. |
| BpsException | on sql errors. |
| bool BpsOrderUtils::getSellPrices | ( | const QVariant & | aArticleKey, |
| const QDateTime & | aStart, | ||
| QVariant & | aDpr, | ||
| QVariant & | aCpr, | ||
| QVariant & | aCode | ||
| ) |
Find the prices for a certain article and starting date/time.
| [in] | aArticleKey | The key of the article. |
| [in] | aStart | The minimum starting date of the price to find. |
| [in] | aDpr | The found dealer price. Invalid if not found. |
| [in] | aCpr | The found consumer price. Invalid if not found. |
| [in] | aCode | The found price code. 'n' if not found. |
| bool BpsOrderUtils::getZoneMergeclass | ( | const QVariant & | aTripclassKey, |
| const QVariant & | aArticleclassKey, | ||
| const QVariant & | aPartnerclassKey, | ||
| QVariant & | aZoneKey, | ||
| QVariant & | aMergeclassKey | ||
| ) |
Get the zone and merge class for a combination of trip, article and partner class.
In case no record is found, the method retries possible combinations in the order below and just returns false if none succeeded:
| Order | Trip Class | Article Class | Partner Class |
|---|---|---|---|
| 1 | * | * | * |
| 2 | * | * | null |
| 3 | * | null | * |
| 4 | * | null | null |
| 5 | null | * | * |
| 6 | null | * | null |
| 7 | null | null | * |
| 8 | null | null | null |
| [in] | aTripclassKey | The key of the trip class. |
| [in] | aArticleclassKey | The key of the article class. |
| [in] | aPartnerclassKey | The key of the partner class. |
| [in] | aZoneKey | Key of the zone found. |
| [in] | aMergeclassKey | Key of the mergeclass found. |
| bool BpsOrderUtils::isOrdercolLocked | ( | const QVariant & | aKey | ) |
Checks if the order column, the open trip, or any of the details belonging to the column are locked.
| [in] | aKey | The primary key value (c_key) of the record in table t_ordercols. |
| bool BpsOrderUtils::isOrderitemLocked | ( | const QVariant & | aKey | ) |
Checks if the order detail or any parent record is locked.
| [in] | aKey | The primary key value (c_key) of the record in table t_orderitems. |
| bool BpsOrderUtils::isOrderrowLocked | ( | const QVariant & | aKey | ) |
Checks if the order row, the open trip, the related columns or any of the details belonging to the row are locked.
| [in] | aKey | The primary key value (c_key) of the record in table t_orderrows. |
| bool BpsOrderUtils::isOrdertripLocked | ( | const QVariant & | aKey | ) |
Checks if the open trip or any of the order rows, columns or details belonging to it are locked.
| [in] | aKey | The primary key value (c_key) of the record in table t_ordertrips. |
| bool BpsOrderUtils::isPurchaseItemLocked | ( | const QVariant & | aKey | ) |
Checks if the purchase order item or the parent purchase order record is locked.
| [in] | aKey | The primary key value (c_key) of the record in table t_purchaseitems. |
| bool BpsOrderUtils::isPurchaseOrderLocked | ( | const QVariant & | aKey | ) |
Checks if the purchase order or any of the items belonging to the order are locked.
| [in] | aKey | The primary key value (c_key) of the record in table t_purchaseorders. |
| bool BpsOrderUtils::isRobotLocked | ( | const QVariant & | aKey | ) |
Checks if the zone is currently robot-locked.
| [in] | aKey | The primary key value (c_key) in table t_zones. |
| bool BpsOrderUtils::lockAllOrderitems | ( | const QVariant & | aKID, |
| int | aTimeout = 0 |
||
| ) |
Lock a list of order items.
The method will lock all order items if possible, and none otherwise.
| [in] | aKID | ID of the list of locked order item keys in table t_keys. |
| [in] | aTimeout | Time out in seconds. Special values: 0 = no wait, -1 = wait endless |
| bool BpsOrderUtils::lockAllOrderitems | ( | const QVariantList & | aKeys, |
| int | aTimeout = 0 |
||
| ) |
Lock a list of order items.
The method will lock all order items if possible, and none otherwise.
| [in] | aKeys | The list of primary key values (c_key) of the records in table t_orderitems. |
| [in] | aTimeout | Time out in seconds. Special values: 0 = no wait, -1 = wait endless |
| bool BpsOrderUtils::lockOrdercol | ( | const QVariant & | aKey, |
| int | aTimeout = 0 |
||
| ) |
Lock an order column.
This lock will only succeed when no other actor has locked the column or any of the details belonging to it.
| [in] | aKey | The primary key value (c_key) of the record in table t_ordercols. |
| [in] | aTimeout | Time out in seconds. Special values: 0 = no wait, -1 = wait endless |
| bool BpsOrderUtils::lockOrderitem | ( | const QVariant & | aKey, |
| int | aTimeout = 0 |
||
| ) |
Lock an order item.
This lock will only succeed when no other actor has locked the detail record.
| [in] | aKey | The primary key value (c_key) of the record in table t_orderitems. |
| [in] | aTimeout | Time out in seconds. Special values: 0 = no wait, -1 = wait endless |
| QVariantList BpsOrderUtils::lockOrderitems | ( | const QVariantList & | aKeys, |
| int | aTimeout = 0 |
||
| ) |
Lock a list of order items.
The method will lock as many of the order items as possible.
| [in] | aKeys | The list of primary key values (c_key) of the records in table t_orderitems. |
| [in] | aTimeout | Time out in seconds. Special values: 0 = no wait, -1 = wait endless |
| bool BpsOrderUtils::lockOrderrow | ( | const QVariant & | aKey, |
| int | aTimeout = 0 |
||
| ) |
Lock an order row.
This lock will only succeed when no other actor has locked the row or any of the details belonging to it.
| [in] | aKey | The primary key value (c_key) of the record in table t_orderrows. |
| [in] | aTimeout | Time out in seconds. Special values: 0 = no wait, -1 = wait endless |
| bool BpsOrderUtils::lockOrdertrip | ( | const QVariant & | aKey, |
| int | aTimeout = 0 |
||
| ) |
Lock an open trip.
This lock will only succeed when no other actor has locked the open trip or any of the order rows, columns and details belonging to the open trip.
| [in] | aKey | The primary key value (c_key) of the record in table t_ordertrips. |
| [in] | aTimeout | Time out in seconds. Special values: 0 = no wait, -1 = wait endless |
| bool BpsOrderUtils::lockPurchaseItem | ( | const QVariant & | aKey, |
| int | aTimeout = 0 |
||
| ) |
Lock a purchase order item.
This lock will only succeed when no other actor has locked the item or the parent purchase order.
| [in] | aKey | The primary key value (c_key) of the record in table t_purchaseitems. |
| [in] | aTimeout | Time out in seconds. Special values: 0 = no wait, -1 = wait endless |
| QVariantList BpsOrderUtils::lockPurchaseItems | ( | const QVariantList & | aKeys, |
| int | aTimeout = 0 |
||
| ) |
Lock a list of purchase order items.
This lock will only succeed when no other actor has locked the item or the parent purchase order.
| [in] | aKeys | The list of primary key values (c_key) of the records in table t_purchaseitems. |
| [in] | aTimeout | Time out in seconds. Special values: 0 = no wait, -1 = wait endless |
| bool BpsOrderUtils::lockPurchaseOrder | ( | const QVariant & | aKey, |
| int | aTimeout = 0 |
||
| ) |
Lock a purchase order.
This lock will only succeed when no other actor has locked the order or any of the items belonging to it.
| [in] | aKey | The primary key value (c_key) of the record in table t_purchaseorders. |
| [in] | aTimeout | Time out in seconds. Special values: 0 = no wait, -1 = wait endless |
| bool BpsOrderUtils::lockRobot | ( | const QVariant & | aKey, |
| int | aTimeout = 0 |
||
| ) |
Lock a zone for exclusive robot access.
This lock will only succeed when no other actor has locked the robot.
| [in] | aKey | The primary key value (c_key) in table t_zones. |
| [in] | aTimeout | Time out in seconds. Special values: 0 = no wait, -1 = wait endless |
| QVariantMap BpsOrderUtils::makeOrderItem | ( | const QVariantMap & | aParams | ) |
Creates a new order item.
| [in] | aParams | The parameters defining the order item.
|
| Key | Description |
|---|---|
| tripkey | Key of the order trip in table t_ordertrips. |
| rowkey | Key of the partner order in table t_orderrows. |
| colkey | Key of the article order in table t_ordercols. |
| itemkey | Key of the order item in table t_orderitems. |
| newtrip | True if the order trip was created, false if it already existed before. |
| newrow | True if the partner order was created, false if it already existed before. |
| newcol | True if the article order was created, false if it already existed before. |
| QVariant BpsOrderUtils::makeOrderPick | ( | const QVariantMap & | aParams | ) |
Make an order pick.
| [in] | aParams | The parameters defining the pick action.
|
| QVariantMap BpsOrderUtils::makePurchaseItem | ( | const QVariantMap & | aParams | ) |
Creates a new purchase order item.
| [in] | aParams | The parameters defining the purchase order item.
|
| Key | Description |
|---|---|
| orderkey | Key of the new created order in table t_purchaseorders. |
| itemkey | Key of the new created item in table t_purchaseitems. |
| static OuIndex BpsOrderUtils::orderUnitIndex | ( | const QVariant & | aOu | ) | [static] |
Get the enumeration for a order unit code.
| [in] | aOu | The order unit code |
| static QString BpsOrderUtils::orderUnitName | ( | OuIndex | aOu | ) | [static] |
Get the human readable and translated order unit name (LU, TU, CU, PU) from a order unit index (O_LU, O_TU, O_CU, O_PU).
| [in] | aOu | The order unit index. |
Get the human readable and translated order unit name (LU, TU, CU, Piece, Kilo, Liter, Meter, M2, M3) from a order unit index and price unit index.
| [in] | aOu | The order unit index. |
| [in] | aPu | The price unit index, only used if aOu == O_PU. |
| static QString BpsOrderUtils::orderUnitName | ( | const QVariant & | aOu | ) | [static] |
Get the human readable and translated order unit name (LU, TU, CU, PU) from a order unit code ("L", "T", "C", "P").
| [in] | aOu | The order unit code. |
| static QString BpsOrderUtils::orderUnitName | ( | const QVariant & | aOu, |
| const QVariant & | aPu | ||
| ) | [static] |
Get the human readable and translated order unit name (LU, TU, CU, Piece, Kilo, Liter, Meter, M2, M3) from a order unit index and price unit index.
| [in] | aOu | The order unit code. |
| [in] | aPu | The price unit code, only used when aOu == "P". |
| static QString BpsOrderUtils::priceUnitAbbreviation | ( | PuIndex | aPu | ) | [static] |
Get the abbreviated, maximum 3 character price unit name (PCS, KG, L, M, M2, M3) from a price unit index (P_Piece, P_Kilo, P_Liter, P_Meter, P_SquareMeter, P_CubicMeter).
| [in] | aPu | The price unit index. |
| static QString BpsOrderUtils::priceUnitAbbreviation | ( | const QVariant & | aPu | ) | [static] |
Get the abbreviated, maximum 3 character price unit name (PCS, KG, L, M, M2, M3) from a price unit code (p, k, l, m, s, c).
| [in] | aPu | The price unit code. |
| static PuIndex BpsOrderUtils::priceUnitIndex | ( | const QVariant & | aPu | ) | [static] |
Get the enumeration for a price unit code.
| [in] | aPu | The price unit code |
| static QString BpsOrderUtils::priceUnitName | ( | PuIndex | aPu | ) | [static] |
Get the human readable and translated price unit name (Piece, Kilo, Liter, Meter, M2, M3) from a price unit index (P_Piece, P_Kilo, P_Liter, P_Meter, P_SquareMeter, P_CubicMeter).
| [in] | aPu | The price unit index. |
| static QString BpsOrderUtils::priceUnitName | ( | const QVariant & | aPu | ) | [static] |
Get the human readable and translated price unit name (Piece, Kilo, Liter, Meter, M2, M3) from a price unit code (p, k, l, m, s, c).
| [in] | aPu | The price unit code. |
| void BpsOrderUtils::setStock | ( | const QVariantMap & | aParams | ) |
Set the absolute stock quantities and updates other fields.
LU's, TU's and CU's are normalized in the stock, e.g. recalculated according to the factors TU/LU and CU/TU for better human readability.
| [in] | aParams | The parameters defining the stock action.
|
| static StockModeIndex BpsOrderUtils::stockModeIndex | ( | const QVariant & | aMode | ) | [static] |
Get the enumeration for a stock mode code.
| [in] | aMode | The stock mode code (r, f, q) |
| static QString BpsOrderUtils::stockModeName | ( | StockModeIndex | aMode | ) | [static] |
Get the human readable and translated stock mode name (Regular, FIFO, Quick) from a stock mode index (SM_Regular, SM_FIFO, SM_Quick).
| [in] | aMode | The stock mode index. |
| static QString BpsOrderUtils::stockModeName | ( | const QVariant & | aMode | ) | [static] |
Get the human readable and translated stock mode name (Regular, FIFO, Quick) from a price unit code (r, f, q).
| [in] | aMode | The stock mode code. |
| QString BpsOrderUtils::tripdateToString | ( | const QVariant & | aTripdate | ) |
Convert a order trip date to string.
The format is taken from the validator for t_ordertrips.c_date. Null values are converted to an empty string.
| [in] | aTripdate | The date to convert. |
| void BpsOrderUtils::unlockOrdercol | ( | const QVariant & | aKey | ) |
Unlock the order column, in case it was locked by the current actor.
| [in] | aKey | The primary key value (c_key) of the record in table t_ordercols. |
| void BpsOrderUtils::unlockOrderitem | ( | const QVariant & | aKey | ) |
Unlock the order item.
| [in] | aKey | The primary key value (c_key) of the record in table t_orderitems. |
| void BpsOrderUtils::unlockOrderitems | ( | const QVariant & | aKID | ) |
Unlock a list of order items held in table t_keyids.
See BpsDatastore::setKeys(const QVariantList& aKeys).
| [in] | aKID | ID of the list of locked order item keys in table t_keys. |
| void BpsOrderUtils::unlockOrderitems | ( | const QVariantList & | aKeys | ) |
Unlock a list of order items.
| [in] | aKeys | The list of primary key values (c_key) of the records in table t_orderitems. |
| void BpsOrderUtils::unlockOrderrow | ( | const QVariant & | aKey | ) |
Unlock the order row, in case it was locked by the current actor.
| [in] | aKey | The primary key value (c_key) of the record in table t_orderrows. |
| void BpsOrderUtils::unlockOrdertrip | ( | const QVariant & | aKey | ) |
Unlock the open trip, in case it was locked by the current actor.
| [in] | aKey | The primary key value (c_key) of the record in table t_ordertrips. |
| void BpsOrderUtils::unlockPurchaseItem | ( | const QVariant & | aKey | ) |
Unlock the purchase order item, in case it was locked by the current actor.
| [in] | aKey | The primary key value (c_key) of the record in table t_purchaseitems. |
| void BpsOrderUtils::unlockPurchaseItems | ( | const QVariantList & | aKeys | ) |
Unlock a list of purchase order items, in case they were locked by the current actor.
| [in] | aKeys | The list of primary key values (c_key) of the records in table t_purchaseitems. |
| void BpsOrderUtils::unlockPurchaseOrder | ( | const QVariant & | aKey | ) |
Unlock the purchase order, in case it was locked by the current actor.
| [in] | aKey | The primary key value (c_key) of the record in table t_purchaseorders. |
| void BpsOrderUtils::unlockRobot | ( | const QVariant & | aKey | ) |
Unlock the zone, in case it was locked by the current actor.
| [in] | aKey | The primary key value (c_key) in table t_zones. |