|
MagicSmoke
$VERSION$
|
this class represents a complete order More...
#include <order.h>
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< MOCustomerInfo > | customer () const |
| virtual Nullable< qint64 > | customerid () const |
| virtual Nullable< MOAddress > | deliveryaddress () const |
| virtual Nullable< qint64 > | deliveryaddressid () const |
| virtual Nullable< MOAddress > | invoiceaddress () const |
| virtual Nullable< qint64 > | invoiceaddressid () const |
| virtual QList< MOItemInfo > | items () const |
| MOOrderAbstract & | operator= (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< MOShipping > | shippingtype () const |
| virtual Nullable< qint64 > | shippingtypeid () const |
| virtual Nullable< QString > | soldby () const |
| virtual Nullable< OrderState > | status () const |
| virtual Nullable< QString > | tags () const |
| virtual QList< MOTicket > | tickets () 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< MOVoucher > | vouchers () 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< MOCustomerInfo > | mp_customer |
| Nullable< qint64 > | mp_customerid |
| Nullable< MOAddress > | mp_deliveryaddress |
| Nullable< qint64 > | mp_deliveryaddressid |
| Nullable< MOAddress > | mp_invoiceaddress |
| Nullable< qint64 > | mp_invoiceaddressid |
| QList< MOItemInfo > | mp_items |
| Nullable< qint64 > | mp_orderid |
| Nullable< qint64 > | mp_ordertime |
| Nullable< qint64 > | mp_senttime |
| Nullable< qint64 > | mp_shippingcosts |
| Nullable< MOShipping > | mp_shippingtype |
| Nullable< qint64 > | mp_shippingtypeid |
| Nullable< QString > | mp_soldby |
| Nullable< OrderState > | mp_status |
| Nullable< QString > | mp_tags |
| QList< MOTicket > | mp_tickets |
| Nullable< qint64 > | mp_totalprice |
| QList< MOVoucher > | mp_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< MOCustomerInfo > | customer |
| Nullable< qint64 > | customerid |
| Nullable< MOAddress > | deliveryaddress |
| Nullable< qint64 > | deliveryaddressid |
| Nullable< MOAddress > | invoiceaddress |
| Nullable< qint64 > | invoiceaddressid |
| QList< MOItemInfo > | items |
| Nullable< qint64 > | orderid |
| Nullable< qint64 > | ordertime |
| Nullable< qint64 > | senttime |
| Nullable< qint64 > | shippingcosts |
| costs for shipping More... | |
| Nullable< MOShipping > | shippingtype |
| Nullable< qint64 > | shippingtypeid |
| Nullable< QString > | soldby |
| Nullable< OrderState > | status |
| Nullable< QString > | tags |
| QList< MOTicket > | tickets |
| Nullable< qint64 > | totalprice |
| total price for this order (including shipping and all items) More... | |
| QList< MOVoucher > | vouchers |
this class represents a complete order
| MOOrder::MOOrder | ( | qint64 | id | ) |
create order by id, retrieves it automatically from the database
References MTGetOrder::getorder(), and req.
|
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
|
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
|
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().
|
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
|
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
|
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
|
inline |
returns how much money needs to be paid in total for this order, in cents
References cent2str(), and MOOrderAbstract::totalprice().