MagicSmoke
$VERSION$
|
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>
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< MOCartOrder > | getcart () const |
If unsuccessful: the cart with annotations. More... | |
Q_SLOT Nullable< MOOrder > | getorder () 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< MOVoucher > | getvouchers () const |
If vouchers were used: the current state of the vouchers after creating (and paying) the order. More... | |
MTCreateOrder & | operator= (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 |
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.
|
explicitprotected |
generates an instance from its properties
acart | The cart contents |
aissale | true if this is a sale, false if this is an order |
avouchers | an optional list of vouchers to be used in this order for payment (coupon is in the cart instead) |
iface | ID 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().
|
virtual |
deletes this instance
References MTCreateOrder_Private::detach().
|
static |
emits the query over the network and returns the transaction object, use isFinished() to check for the transaction's state
acart | The cart contents |
aissale | true if this is a sale, false if this is an order |
avouchers | an optional list of vouchers to be used in this order for payment (coupon is in the cart instead) |
iface | ID of the interface that the transaction will be sent on |
|
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().
|
static |
emits the query over the network and returns the finished transaction object
acart | The cart contents |
aissale | true if this is a sale, false if this is an order |
avouchers | an optional list of vouchers to be used in this order for payment (coupon is in the cart instead) |
iface | ID of the interface that the transaction will be sent on |
Referenced by MInterface::queryCreateOrder().
|
friend |
Referenced by MTCreateOrder().