MagicSmoke  $VERSION$
MTCreateOrder Class Reference

CreateOrder creates orders that are queued to be executed immediately or sales that are marked executed and paid for immediately; they may contain tickets, vouchers, or shopping items. More...

#include <srcMTCreateOrder.h>

Inheritance diagram for MTCreateOrder:
MTransaction

Public Member Functions

 MTCreateOrder ()
 default constructor: generates an invalid transaction More...
 
 MTCreateOrder (const MTCreateOrder &)
 copy constructor: the two copies share their state More...
 
virtual ~MTCreateOrder ()
 deletes this instance More...
 
Q_SLOT Nullable< MOCartOrdergetcart () const
 If unsuccessful: the cart with annotations. More...
 
Q_SLOT Nullable< MOOrdergetorder () const
 If successful: the created order. More...
 
Q_SLOT Nullable< qint64 > getpaidcash () const
 If this is a sale: the amount paid in cash (in cents) More...
 
Q_SLOT QList< MOVouchergetvouchers () const
 If vouchers were used: the current state of the vouchers after creating (and paying) the order. More...
 
MTCreateOrderoperator= (const MTCreateOrder &)
 copy assignment: the copy shares the state of the original object More...
 

Static Public Member Functions

static MTCreateOrder asyncQuery (const MOCartOrder &acart, const bool &aissale, const QList< QString > &avouchers, QString iface="MagicSmoke")
 emits the query over the network and returns the transaction object, use isFinished() to check for the transaction's state More...
 
static MTCreateOrder query (const MOCartOrder &acart, const bool &aissale, const QList< QString > &avouchers, QString iface="MagicSmoke")
 emits the query over the network and returns the finished transaction object More...
 
- Static Public Member Functions inherited from MTransaction
static void setStartStopActions (const MTStartStop &start, const MTStartStop &stop)
 set actions to be executed at start/stop More...
 

Protected Member Functions

 MTCreateOrder (const MOCartOrder &acart, const bool &aissale, const QList< QString > &avouchers, QString iface)
 generates an instance from its properties More...
 
virtual void endQuery ()
 
- Protected Member Functions inherited from MTransaction
 MTransaction (QString iface=QString())
 internal: construct the transaction More...
 
 MTransaction (const WTransaction &)
 internal: copy the transaction More...
 
 MTransaction (const MTransaction &)
 internal: copy the transaction More...
 
QByteArray executeQuery (QString, QByteArray)
 internal: extend executeQuery to show a wait cursor More...
 

Friends

class MTCreateOrder_Private
 

Detailed Description

CreateOrder creates orders that are queued to be executed immediately or sales that are marked executed and paid for immediately; they may contain tickets, vouchers, or shopping items.

Constructor & Destructor Documentation

MTCreateOrder::MTCreateOrder ( const MOCartOrder acart,
const bool &  aissale,
const QList< QString > &  avouchers,
QString  iface 
)
explicitprotected

generates an instance from its properties

Parameters
acartThe cart contents
aissaletrue if this is a sale, false if this is an order
avouchersan optional list of vouchers to be used in this order for payment (coupon is in the cart instead)
ifaceID of the interface that the transaction will be sent on

References MTCreateOrder_Private::in_cart, MTCreateOrder_Private::in_issale, MTCreateOrder_Private::in_vouchers, and MTCreateOrder_Private.

MTCreateOrder::MTCreateOrder ( )

default constructor: generates an invalid transaction

References MTCreateOrder_Private.

MTCreateOrder::MTCreateOrder ( const MTCreateOrder t)

copy constructor: the two copies share their state

References MTCreateOrder_Private::attach().

MTCreateOrder::~MTCreateOrder ( )
virtual

deletes this instance

References MTCreateOrder_Private::detach().

Member Function Documentation

MTCreateOrder MTCreateOrder::asyncQuery ( const MOCartOrder acart,
const bool &  aissale,
const QList< QString > &  avouchers,
QString  iface = "MagicSmoke" 
)
static

emits the query over the network and returns the transaction object, use isFinished() to check for the transaction's state

Parameters
acartThe cart contents
aissaletrue if this is a sale, false if this is an order
avouchersan optional list of vouchers to be used in this order for payment (coupon is in the cart instead)
ifaceID of the interface that the transaction will be sent on
void MTCreateOrder::endQuery ( )
protectedvirtual
Nullable< MOCartOrder > MTCreateOrder::getcart ( ) const

If unsuccessful: the cart with annotations.

References MTCreateOrder_Private::out_cart.

Nullable< MOOrder > MTCreateOrder::getorder ( ) const

If successful: the created order.

References MTCreateOrder_Private::out_order.

Nullable< qint64 > MTCreateOrder::getpaidcash ( ) const

If this is a sale: the amount paid in cash (in cents)

References MTCreateOrder_Private::out_paidcash.

QList< MOVoucher > MTCreateOrder::getvouchers ( ) const

If vouchers were used: the current state of the vouchers after creating (and paying) the order.

References MTCreateOrder_Private::out_vouchers.

MTCreateOrder & MTCreateOrder::operator= ( const MTCreateOrder t)

copy assignment: the copy shares the state of the original object

References MTCreateOrder_Private::attach(), and MTCreateOrder_Private::detach().

MTCreateOrder MTCreateOrder::query ( const MOCartOrder acart,
const bool &  aissale,
const QList< QString > &  avouchers,
QString  iface = "MagicSmoke" 
)
static

emits the query over the network and returns the finished transaction object

Parameters
acartThe cart contents
aissaletrue if this is a sale, false if this is an order
avouchersan optional list of vouchers to be used in this order for payment (coupon is in the cart instead)
ifaceID of the interface that the transaction will be sent on

Referenced by MInterface::queryCreateOrder().

Friends And Related Function Documentation

friend class MTCreateOrder_Private
friend

Referenced by MTCreateOrder().


The documentation for this class was generated from the following files: