4 #ifndef BPSORDERUTILS_H
5 #define BPSORDERUTILS_H
Public include file for Bps class.
#define BPSCORE_EXPORT
Declare class to be an import from the shared library.
Definition: bpscore_global.h:22
#define BPS_PRIVATE(Class)
Declare pointer to private object in a public class.
Definition: bpsglobals.h:102
BPS datastore class.
Definition: bpsdatastore.h:61
EPCIS utilities.
Definition: bpsepcis.h:17
Status
General purpose return status.
Definition: bps.h:80
BPS order utilities.
Definition: bpsorderutils.h:19
void unlockOrderitem(const QVariant &aKey)
Unlock the order item.
void unlockPurchaseOrder(const QVariant &aKey)
Unlock the purchase order, in case it was locked by the current actor.
PuIndex
Price unit enumeration.
Definition: bpsorderutils.h:47
@ P_Liter
Liters.
Definition: bpsorderutils.h:51
@ P_SquareMeter
Square meters.
Definition: bpsorderutils.h:53
@ P_Piece
Pieces.
Definition: bpsorderutils.h:49
@ P_unknown
Unknown unit.
Definition: bpsorderutils.h:48
@ P_Meter
Meters.
Definition: bpsorderutils.h:52
@ P_Kilo
Kilos.
Definition: bpsorderutils.h:50
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.
void addToStock(const QVariantMap &aParams)
Adds (or subtracts) stock quantities and updates other stock fields.
static QString stockModeName(StockModeIndex aMode)
Get the human readable and translated stock mode name (Regular, FIFO, Quick) from a stock mode index ...
Bps::Status lockPackjob(const QVariant &aKey, bool aExclusive=true, int aTimeout=0, bool aFullcheck=true)
Lock a packing job.
Bps::Status adoptLu(const QVariantMap &aParams)
Adopt an orphaned new logistic unit.
QVariantMap getPartner(const QVariant &aPartnerKey)
Get partner record.
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 de...
QVariantMap finalizeLu(const QVariantMap &aParams)
Finalize a logistic unit.
void setPurchaseDeliveryStock(const QVariant &aDeliveryKey, const QVariant &aStockKey=QVariant())
Register stock of purchase delivery record.
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,...
static QString priceUnitName(PuIndex aPu)
Get the human readable and translated price unit name (Piece, Kilo, Liter, Meter, M2,...
QString dprToString(const QVariant &aDpr)
Convert a dealer price to string.
static OuIndex orderUnitIndex(const QVariant &aOu)
Get the enumeration for a order unit code.
QVariantMap makePurchaseEntry(const QVariantMap &aParams)
Registration of an entry on an existing purchase delivery.
bool isOrderitemLocked(const QVariant &aKey)
Checks if the order detail or any parent record is locked.
static StockModeIndex stockModeIndex(const QVariant &aMode)
Get the enumeration for a stock mode code.
void cancelOrderPick(const QVariant &aPickKey)
Cancel an existing pick by deleting the record in t_orderpicks.
QVariant getStockReason(StockReasonIndex aIndex)
Get the stock reason for a certain stock reason index from table t_stockreasons.
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 co...
bool isOrdertripLocked(const QVariant &aKey)
Checks if the order trip or any of the order rows, columns or details belonging to it are locked.
Bps::Status lockLu(const QVariant &aKey, int aTimeout=0)
Lock an logistic unit in table t_newlogisticunits.
static QString orderUnitName(OuIndex aOu, PuIndex aPu)
Get the human readable and translated order unit name (LU, TU, CU, Piece, Kilo, Liter,...
QVariant cloneRecord(const QVariant &aKey, const QString &aName)
Make an exact copy of an arbitrary BPS record, with exception of the key.
void refreshLu(const QVariant &aKey)
Refresh the timestamp of the logistic unit, in case it is locked by the current actor.
void unlockPackprod(const QVariant &aKey)
Unlock the packing production, in case it was locked by the current actor.
bool isPurchaseOrderLocked(const QVariant &aKey)
Checks if the purchase order or any of the items belonging to the order are locked.
void unlockOrderrow(const QVariant &aKey)
Unlock the order row, in case it was locked by the current actor.
void unlockOrdercol(const QVariant &aKey)
Unlock the order column, in case it was locked by the current actor.
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",...
static QString priceUnitAbbreviation(PuIndex aPu)
Get the abbreviated, maximum 3 character price unit name (PCS, KG, L, M, M2, M3) from a price unit in...
StockReasonIndex
Stock change reason index.
Definition: bpsorderutils.h:70
@ SR_ManualMinus
Manual - change (m-)
Definition: bpsorderutils.h:74
@ SR_StockOK
Stocktaking confirmation (s0)
Definition: bpsorderutils.h:81
@ SR_Unknown
Unknown stock reason.
Definition: bpsorderutils.h:71
@ SR_Manual
Manual change (m)
Definition: bpsorderutils.h:72
@ SR_PickReturn
Picking return (p+)
Definition: bpsorderutils.h:79
@ SR_StockPlus
Stocktaking + change (s+)
Definition: bpsorderutils.h:82
@ SR_SupplyReturn
Supply return (i-)
Definition: bpsorderutils.h:78
@ SR_StockMinus
Stocktaking - change (s-)
Definition: bpsorderutils.h:83
@ SR_ManualPlus
Manual + change (m+)
Definition: bpsorderutils.h:73
@ SR_Withdraw
General withdraw (g-)
Definition: bpsorderutils.h:76
@ SR_PickDraw
Picking draw (p-)
Definition: bpsorderutils.h:80
@ SR_SupplyIntake
Supply intake (i+)
Definition: bpsorderutils.h:77
@ SR_Storage
General storage (g+)
Definition: bpsorderutils.h:75
QString cprToString(const QVariant &aCpr)
Convert a consumer price to string.
void unlockOrderitems(const QVariantList &aKeys)
Unlock a list of order items.
bool isPackjobLocked(const QVariant &aKey, bool aExclusive=true)
Checks if the packing job or the production it belongs to are locked.
QVariantMap findOrMakeSharedLu(const QVariantMap &aParams)
Find and lock an orphaned new logistic unit, or create a new one.
OrderGenMode orderGenMode(const QString &aTripid)
Get the order generation mode for a given trip ID.
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.
QVariant clearPurchaseDeliveryStock(const QVariant &aDeliveryKey)
Clear stock registration of purchase delivery record.
QVariant makeOrderPick(const QVariantMap &aParams)
Make an order pick.
BpsOrderUtils(BpsDatastore *aDatastore, QObject *aParent=nullptr)
Constructor for the BpsOrderUtils objects.
Bps::Status lockPurchaseItem(const QVariant &aKey, int aTimeout=0)
Lock a purchase order item.
QList< BpsRobot * > robots() const
Get a list of all active robot.
QVariantMap finishOrderRow(const QVariantMap &aParams)
Finish a order row.
QVariant makeLu(const QVariantMap &aParams)
Create a new logistic unit.
QVariant clearPackStock(const QVariant &aPackRecKey)
Clear stock registration of a packing record.
Bps::Status lockPurchaseOrder(const QVariant &aKey, int aTimeout=0)
Lock a purchase order.
QVariant cloneArticle(const QVariant &aKey)
Make an exact copy of the original article, with exception of the key.
QVariantList makeErpOrders(const QList< QVariantMap > &aParams)
Create ERP orders in table t_erporders and t_erporderitems.
bool anyPicksOnLu(const QVariant &aKey)
Check if there are any picks on the logistic unit.
QVariant getStockReason(const QString &aType)
Get the stock reason for a certain type from table t_stockreasons.
Bps::Status lockOrdercol(const QVariant &aKey, int aTimeout=0, bool aFullcheck=true)
Lock an order column.
QList< QPair< QString, QString > > getDefaultStockReasons()
Get the default stock reason types and names as a list.
Bps::Status lockOrderitem(const QVariant &aKey, int aTimeout=0, bool aFullcheck=true)
Lock an order item.
QVariantMap makePurchaseItem(const QVariantMap &aParams)
Creates a new purchase order item.
void unlockLu(const QVariant &aKey)
Unlock the logistic unit, in case it is locked by the current actor.
QString tripdateToString(const QVariant &aTripdate)
Convert a order trip date to string.
QVariantMap getZone(const QVariant &aZoneKey)
Get zone record.
QVariant makePackRec(const QVariantMap &aParams)
Make a packing record.
StockModeIndex
Stock handling modes.
Definition: bpsorderutils.h:60
@ SM_Regular
Regular stock mode.
Definition: bpsorderutils.h:62
@ SM_FIFO
Regular stock mode.
Definition: bpsorderutils.h:63
@ SM_unknown
Unknown stock mode.
Definition: bpsorderutils.h:61
QVariantMap getPackjob(const QVariant &aPackjobKey)
Get packing job record.
bool isOrderrowLocked(const QVariant &aKey)
Checks if the order row, the order trip, the related columns or any of the details belonging to the r...
QVariantMap getTrip(const QVariant &aTripKey)
Get trip record.
bool isPurchaseItemLocked(const QVariant &aKey)
Checks if the purchase order item or the parent purchase order record is locked.
void unlockPurchaseItem(const QVariant &aKey)
Unlock the purchase order item, in case it was locked by the current actor.
Bps::Status lockOrdertrip(const QVariant &aKey, int aTimeout=0, bool aFullcheck=true)
Lock an order trip.
bool anyRobots() const
Check if there are any active robots.
QVariant saveZoneStock(const QVariantMap &aParams)
Adds a quantity to an existing stock in the given zone, or creates a new stock in the zone when no ex...
QVariantMap findLockLu(const QVariantMap &aParams)
Find and lock an orphaned new logistic unit.
QVariantMap getArticle(const QVariant &aArticleKey)
Get article record.
OuIndex
Order unit enumeration.
Definition: bpsorderutils.h:36
@ O_TU
Traded unit.
Definition: bpsorderutils.h:40
@ O_unknown
Unknown unit.
Definition: bpsorderutils.h:37
@ O_PU
Price unit.
Definition: bpsorderutils.h:38
@ O_CU
Consumer unit.
Definition: bpsorderutils.h:39
void setStock(const QVariantMap &aParams)
Set the absolute stock quantities and updates other fields on an existing stock.
QVariantMap makePackJob(const QVariantMap &aParams)
Creates or updates a packing job.
bool isPackprodLocked(const QVariant &aKey)
Checks if the packing production or any of the jobs belonging to it are locked.
OrderGenMode
Order generation modes.
Definition: bpsorderutils.h:28
@ OM_BPS
Create BPS orders.
Definition: bpsorderutils.h:29
QVariant clonePartner(const QVariant &aKey)
Make an exact copy of the original partner, with exception of the key.
void unlockOrdertrip(const QVariant &aKey)
Unlock the order trip, in case it was locked by the current actor.
static QString priceUnitName(const QVariant &aPu)
Get the human readable and translated price unit name (Piece, Kilo, Liter, Meter, M2,...
QVariant makeStock(const QVariantMap &aParams)
Create a new stock.
BpsRobot * robot(const QVariant &aZone) const
Get robot of a given zone.
static QString stockModeName(const QVariant &aMode)
Get the human readable and translated stock mode name (Regular, FIFO, Quick) from a price unit code (...
static PuIndex priceUnitIndex(const QVariant &aPu)
Get the enumeration for a price unit code.
QVariant findLu(const QVariantMap &aParams)
Find a new logistic unit.
bool isOrdercolLocked(const QVariant &aKey)
Checks if the order column, the order trip, or any of the details belonging to the column are locked.
QVariantMap makeOrderItem(const QVariantMap &aParams)
Creates a new order item.
void unlockOrderitems(const QVariant &aKID)
Unlock a list of order items held in table t_keyids.
void unlockPackjob(const QVariant &aKey)
Unlock the packing job, in case it was locked by the current actor.
QVariantMap makePurchaseDelivery(const QVariantMap &aParams)
Creates a new purchase order delivery.
BpsDatastore * datastore() const
Bps::Status lockOrderrow(const QVariant &aKey, int aTimeout=0, bool aFullcheck=true)
Lock an order row.
QVariantMap getProd(const QVariant &aProdKey)
Get production record.
Bps::Status lockPackprod(const QVariant &aKey, int aTimeout=0, bool aFullcheck=true)
Lock an packing production.
static QString orderUnitName(const QVariant &aOu, const QVariant &aPu)
Get the human readable and translated order unit name (LU, TU, CU, Piece, Kilo, Liter,...
Pick robot interface.
Definition: bpsrobot.h:19