MagicSmoke  $VERSION$
MOOrder Class Reference

this class represents a complete order More...

#include <order.h>

Inheritance diagram for MOOrder:
MOOrderAbstract

Public Member Functions

 MOOrder (qint64)
 create order by id, retrieves it automatically from the database More...
 
QString amountPaidString () const
 returns how much money has already been paid for this order, in cents More...
 
int amountToPay () const
 returns how much there is to be paid, in cents More...
 
QString amountToPayStr () const
 returns how much there is to be paid, as localized string More...
 
int amountToRefund () const
 returns how much there is to be refunded, in cents More...
 
QString amountToRefundStr () const
 returns how much there is to be refunded, as localized string More...
 
QString fullDeliveryAddress (bool allowfallback=true) const
 returns the full delivery address, or invoice address if no explicit delivery address was given and allowfallback==true More...
 
QString fullInvoiceAddress (bool allowfallback=true) const
 returns the full invoice address, or delivery address if no explicit invoice address was given and allowfallback==true More...
 
bool isReservation () const
 returns whether this order is a reservation More...
 
bool isSent () const
 returns whether the tickets of this order have already been shipped More...
 
bool isValid () const
 returns whether the order is valid (it comes from the DB and it has been understood by the parser) More...
 
bool needsPayment () const
 returns whether there is anything left to pay More...
 
bool needsRefund () const
 returns whether there is anything left to refund More...
 
QString orderDateStr ()
 returns the order date only as string More...
 
TimeStamp orderDateTime ()
 return the order date+time More...
 
QString orderDateTimeStr ()
 returns the order date+time as string More...
 
QString orderStatusString () const
 returns the status of the order as localized string More...
 
QString sentDateStr ()
 returns the shipping date only as string More...
 
TimeStamp sentDateTime ()
 returns the shipping date+time More...
 
QString sentDateTimeStr ()
 returns the shipping date+time as string More...
 
QString totalPriceString () const
 returns how much money needs to be paid in total for this order, in cents More...
 
- Public Member Functions inherited from MOOrderAbstract
 MOOrderAbstract ()
 default constructor: constructs an invalid instance of MOOrderAbstract More...
 
 MOOrderAbstract (const MOOrderAbstract &)
 copy constructor: creates a (deep) copy of the object More...
 
 MOOrderAbstract (const QDomElement &)
 special constructor: create from the XML representation, deserializing the object More...
 
virtual ~MOOrderAbstract ()
 destructor: deletes this copy of the object More...
 
virtual void additems (Nullable< MOItemInfo > a)
 
virtual void addtickets (Nullable< MOTicket > a)
 
virtual void addvouchers (Nullable< MOVoucher > a)
 
virtual Nullable< qint64 > amountdue () const
 amount that needs to be paid, negative if too much has been paid More...
 
virtual Nullable< qint64 > amountpaid () const
 amount that has been paid for this order More...
 
virtual void clearitems ()
 
virtual void cleartickets ()
 
virtual void clearvouchers ()
 
virtual Nullable< QString > comments () const
 
virtual Nullable< QString > coupondescription () const
 
virtual Nullable< QString > couponid () const
 
virtual Nullable< MOCustomerInfocustomer () const
 
virtual Nullable< qint64 > customerid () const
 
virtual Nullable< MOAddressdeliveryaddress () const
 
virtual Nullable< qint64 > deliveryaddressid () const
 
virtual Nullable< MOAddressinvoiceaddress () const
 
virtual Nullable< qint64 > invoiceaddressid () const
 
virtual QList< MOItemInfoitems () const
 
MOOrderAbstractoperator= (const MOOrderAbstract &)
 copy assignment: creates a (deep) copy of the object More...
 
virtual Nullable< qint64 > orderid () const
 
virtual Nullable< qint64 > ordertime () const
 
 Q_ENUMS (OrderState)
 
virtual Nullable< qint64 > senttime () const
 
virtual void setamountdue (Nullable< qint64 > s)
 amount that needs to be paid, negative if too much has been paid More...
 
virtual void setamountpaid (Nullable< qint64 > s)
 amount that has been paid for this order More...
 
virtual void setcomments (Nullable< QString > s)
 
virtual void setcoupondescription (Nullable< QString > s)
 
virtual void setcouponid (Nullable< QString > s)
 
virtual void setcustomer (Nullable< MOCustomerInfo > s)
 
virtual void setcustomerid (Nullable< qint64 > s)
 
virtual void setdeliveryaddress (Nullable< MOAddress > s)
 
virtual void setdeliveryaddressid (Nullable< qint64 > s)
 
virtual void setinvoiceaddress (Nullable< MOAddress > s)
 
virtual void setinvoiceaddressid (Nullable< qint64 > s)
 
virtual void setitems (QList< MOItemInfo > s)
 
virtual void setorderid (Nullable< qint64 > s)
 
virtual void setordertime (Nullable< qint64 > s)
 
virtual void setsenttime (Nullable< qint64 > s)
 
virtual void setshippingcosts (Nullable< qint64 > s)
 costs for shipping More...
 
virtual void setshippingtype (Nullable< MOShipping > s)
 
virtual void setshippingtypeid (Nullable< qint64 > s)
 
virtual void setsoldby (Nullable< QString > s)
 
virtual void setstatus (Nullable< OrderState > s)
 
virtual void settags (Nullable< QString > s)
 
virtual void settickets (QList< MOTicket > s)
 
virtual void settotalprice (Nullable< qint64 > s)
 total price for this order (including shipping and all items) More...
 
virtual void setvouchers (QList< MOVoucher > s)
 
virtual Nullable< qint64 > shippingcosts () const
 costs for shipping More...
 
virtual Nullable< MOShippingshippingtype () const
 
virtual Nullable< qint64 > shippingtypeid () const
 
virtual Nullable< QString > soldby () const
 
virtual Nullable< OrderStatestatus () const
 
virtual Nullable< QString > tags () const
 
virtual QList< MOTickettickets () const
 
QString toString ()
 Serializes the object to XML and returns the string representation of that XML. More...
 
virtual Nullable< qint64 > totalprice () const
 total price for this order (including shipping and all items) More...
 
QDomElement toXml (QDomDocument &doc, QString name="Order")
 Transforms the object into its XML representation, the element node returned is not appended to the document - you have to do that yourself. More...
 
void toXml (QDomDocument &, QDomElement &)
 Serializes the object into the given element. More...
 
virtual QList< MOVouchervouchers () const
 

Additional Inherited Members

- Public Types inherited from MOOrderAbstract
enum  OrderState {
  Placed =0, Sent =1, Sold =1, Cancelled =2,
  Reserved =4, Closed =128
}
 Status the order is in right now. More...
 
- Static Public Member Functions inherited from MOOrderAbstract
static MOOrderAbstract fromString (const QString &)
 create MOOrderAbstract from XML formatted string (inverse of toString) More...
 
static MOOrderAbstract fromXml (const QDomElement &)
 create MOOrderAbstract from XML (inverse of toXml) More...
 
static OrderState locstr2OrderState (QString, bool *ok=0)
 Converts a localized string into the corresponding enum OrderState value. More...
 
static QString OrderState2locstr (OrderState)
 Converts enum OrderState value into the corresponding localized string. More...
 
static QString OrderState2str (OrderState)
 Converts enum OrderState value into the corresponding string. More...
 
static OrderState str2OrderState (QString, bool *ok=0)
 Converts string into the corresponding enum OrderState value. More...
 
- Protected Attributes inherited from MOOrderAbstract
Nullable< qint64 > mp_amountdue
 
Nullable< qint64 > mp_amountpaid
 
Nullable< QString > mp_comments
 
Nullable< QString > mp_coupondescription
 
Nullable< QString > mp_couponid
 
Nullable< MOCustomerInfomp_customer
 
Nullable< qint64 > mp_customerid
 
Nullable< MOAddressmp_deliveryaddress
 
Nullable< qint64 > mp_deliveryaddressid
 
Nullable< MOAddressmp_invoiceaddress
 
Nullable< qint64 > mp_invoiceaddressid
 
QList< MOItemInfomp_items
 
Nullable< qint64 > mp_orderid
 
Nullable< qint64 > mp_ordertime
 
Nullable< qint64 > mp_senttime
 
Nullable< qint64 > mp_shippingcosts
 
Nullable< MOShippingmp_shippingtype
 
Nullable< qint64 > mp_shippingtypeid
 
Nullable< QString > mp_soldby
 
Nullable< OrderStatemp_status
 
Nullable< QString > mp_tags
 
QList< MOTicketmp_tickets
 
Nullable< qint64 > mp_totalprice
 
QList< MOVouchermp_vouchers
 
- Properties inherited from MOOrderAbstract
Nullable< qint64 > amountdue
 amount that needs to be paid, negative if too much has been paid More...
 
Nullable< qint64 > amountpaid
 amount that has been paid for this order More...
 
Nullable< QString > comments
 
Nullable< QString > coupondescription
 
Nullable< QString > couponid
 
Nullable< MOCustomerInfocustomer
 
Nullable< qint64 > customerid
 
Nullable< MOAddressdeliveryaddress
 
Nullable< qint64 > deliveryaddressid
 
Nullable< MOAddressinvoiceaddress
 
Nullable< qint64 > invoiceaddressid
 
QList< MOItemInfoitems
 
Nullable< qint64 > orderid
 
Nullable< qint64 > ordertime
 
Nullable< qint64 > senttime
 
Nullable< qint64 > shippingcosts
 costs for shipping More...
 
Nullable< MOShippingshippingtype
 
Nullable< qint64 > shippingtypeid
 
Nullable< QString > soldby
 
Nullable< OrderStatestatus
 
Nullable< QString > tags
 
QList< MOTickettickets
 
Nullable< qint64 > totalprice
 total price for this order (including shipping and all items) More...
 
QList< MOVouchervouchers
 

Detailed Description

this class represents a complete order

Constructor & Destructor Documentation

MOOrder::MOOrder ( qint64  id)

create order by id, retrieves it automatically from the database

References MTGetOrder::getorder(), and req.

Member Function Documentation

QString MOOrder::amountPaidString ( ) const
inline

returns how much money has already been paid for this order, in cents

References MOOrderAbstract::amountpaid(), and cent2str().

int MOOrder::amountToPay ( ) const

returns how much there is to be paid, in cents

QString MOOrder::amountToPayStr ( ) const
inline

returns how much there is to be paid, as localized string

References cent2str().

int MOOrder::amountToRefund ( ) const

returns how much there is to be refunded, in cents

QString MOOrder::amountToRefundStr ( ) const
inline

returns how much there is to be refunded, as localized string

References cent2str().

QString MOOrder::fullDeliveryAddress ( bool  allowfallback = true) const

returns the full delivery address, or invoice address if no explicit delivery address was given and allowfallback==true

References MOOrderAbstract::customer(), MOOrderAbstract::deliveryaddress(), MOOrderAbstract::invoiceaddress(), and isValid().

QString MOOrder::fullInvoiceAddress ( bool  allowfallback = true) const

returns the full invoice address, or delivery address if no explicit invoice address was given and allowfallback==true

References MOOrderAbstract::customer(), MOOrderAbstract::deliveryaddress(), MOOrderAbstract::invoiceaddress(), and isValid().

bool MOOrder::isReservation ( ) const
inline

returns whether this order is a reservation

References MOOrderAbstract::Reserved, and MOOrderAbstract::status().

bool MOOrder::isSent ( ) const

returns whether the tickets of this order have already been shipped

bool MOOrder::isValid ( ) const
inline

returns whether the order is valid (it comes from the DB and it has been understood by the parser)

References MOOrderAbstract::orderid().

Referenced by fullDeliveryAddress(), and fullInvoiceAddress().

bool MOOrder::needsPayment ( ) const

returns whether there is anything left to pay

bool MOOrder::needsRefund ( ) const

returns whether there is anything left to refund

QString MOOrder::orderDateStr ( )

returns the order date only as string

TimeStamp MOOrder::orderDateTime ( )

return the order date+time

References MOOrderAbstract::ordertime().

QString MOOrder::orderDateTimeStr ( )

returns the order date+time as string

QString MOOrder::orderStatusString ( ) const
inline

returns the status of the order as localized string

References MOOrderAbstract::OrderState2locstr(), and MOOrderAbstract::status().

QString MOOrder::sentDateStr ( )

returns the shipping date only as string

TimeStamp MOOrder::sentDateTime ( )

returns the shipping date+time

QString MOOrder::sentDateTimeStr ( )

returns the shipping date+time as string

QString MOOrder::totalPriceString ( ) const
inline

returns how much money needs to be paid in total for this order, in cents

References cent2str(), and MOOrderAbstract::totalprice().


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