use delivery address and comment in order, show them
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sun, 29 Jun 2008 09:56:46 +0000 (09:56 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sun, 29 Jun 2008 09:56:46 +0000 (09:56 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@162 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

src/customer.cpp
src/orderwin.cpp
src/overview.cpp
www/inc/classes/order.php

index ff00c32..8e4eaf5 100644 (file)
@@ -219,6 +219,7 @@ MCustomerListDialog::MCustomerListDialog(MWebRequest*r,QWidget*par,bool isselect
        if(isselect){
                hl->addWidget(p=new QPushButton(tr("Select")),0);
                connect(p,SIGNAL(clicked()),this,SLOT(accept()));
+               connect(m_listview,SIGNAL(doubleClicked(const QModelIndex&)),this,SLOT(accept()));
                hl->addWidget(p=new QPushButton(tr("Cancel")),0);
                connect(p,SIGNAL(clicked()),this,SLOT(reject()));
        }else{
index a290dcf..6c4d311 100644 (file)
@@ -84,6 +84,7 @@ MOrderWindow::MOrderWindow(QWidget*par,MWebRequest*r,const MOrder&o)
        QGridLayout*gl;
        vl->addLayout(gl=new QGridLayout,0);
        int rw=0;
+       QLabel*lab;
        gl->addWidget(new QLabel(tr("Order ID:")),rw,0);
        gl->addWidget(m_orderid=new QLabel(QString::number(m_order.orderID())),rw,1);
        gl->addWidget(new QLabel(tr("Order Date:")),++rw,0);
@@ -92,6 +93,9 @@ MOrderWindow::MOrderWindow(QWidget*par,MWebRequest*r,const MOrder&o)
        gl->addWidget(m_sentdate=new QLabel(m_order.sentDateTimeStr()),rw,1);
        gl->addWidget(new QLabel(tr("Customer:")),++rw,0);
        gl->addWidget(new QLabel(m_order.customer().getNameAddress()),rw,1);
+       gl->addWidget(new QLabel(tr("Delivery Address:")),++rw,0);
+       gl->addWidget(lab=new QLabel(m_order.deliveryAddress()),rw,1);
+       lab->setWordWrap(true);
        gl->addWidget(new QLabel(tr("Sold by:")),++rw,0);
        gl->addWidget(new QLabel(m_order.seller()),rw,1);
        gl->addWidget(new QLabel(tr("Total Price:")),++rw,0);
@@ -100,6 +104,9 @@ MOrderWindow::MOrderWindow(QWidget*par,MWebRequest*r,const MOrder&o)
        gl->addWidget(m_paid=new QLabel(m_order.amountPaidString()),rw,1);
        gl->addWidget(new QLabel(tr("Order State:")),++rw,0);
        gl->addWidget(m_state=new QLabel(m_order.orderStatusString()),rw,1);
+       gl->addWidget(new QLabel(tr("Order Comment:")),++rw,0);
+       gl->addWidget(lab=new QLabel(m_order.comment()),rw,1);
+       lab->setWordWrap(true);
        gl->setColumnStretch(0,0);
        gl->setColumnStretch(1,10);
        
index f90b94b..a7ddc07 100644 (file)
@@ -177,6 +177,7 @@ MOverview::MOverview(MWebRequest*mw,QString pk)
        ordertable->setModel(ordermodel=new QStandardItemModel(this));
        ordertable->setSelectionMode(QAbstractItemView::SingleSelection);
        ordertable->setEditTriggers(QAbstractItemView::NoEditTriggers);
+       connect(ordertable,SIGNAL(doubleClicked(const QModelIndex&)),this,SLOT(orderDetails()));
        hl->addLayout(vl=new QVBoxLayout,0);
        vl->addWidget(p=new QPushButton(tr("Update")),0);
        connect(p,SIGNAL(clicked()),this,SLOT(updateOrders()));
@@ -739,6 +740,7 @@ void MOverview::cartAddTicket()
        QPushButton*p;
        hl->addWidget(p=new QPushButton(tr("Select")),0);
        connect(p,SIGNAL(clicked()),&dlg,SLOT(accept()));
+       connect(tv,SIGNAL(doubleClicked(const QModelIndex&)),&dlg,SLOT(accept()));
        hl->addWidget(p=new QPushButton(tr("Cancel")),0);
        connect(p,SIGNAL(clicked()),&dlg,SLOT(reject()));
        //wait for it
index d0afd56..c1926f7 100644 (file)
@@ -421,6 +421,18 @@ class Order
                
                return true;
        }
+       
+       /**creating orders: set a delivery address*/
+       public function setDeliveryAddress($da)
+       {
+               $this->deliveryaddress=trim($da);
+       }
+       
+       /**creating orders: set comment*/
+       public function setComment($cm)
+       {
+               $this->comment=trim($cm);
+       }
 };
 
 function createOrderXml($xmldata,$action)
@@ -445,6 +457,18 @@ function createOrderXml($xmldata,$action)
        }
        //TODO: get vouchers
        
+       //get opt. address
+       foreach($doc->getElementsByTagName("DeliveryAddress") as $da){
+               foreach($da->childNodes as $cn)
+                       if($cn->nodeType==XML_TEXT_NODE)
+                               $order->setDeliveryAddress($cn->wholeText);
+       }
+       foreach($doc->getElementsByTagName("Comment") as $da){
+               foreach($da->childNodes as $cn)
+                       if($cn->nodeType==XML_TEXT_NODE)
+                               $order->setComment($cn->wholeText);
+       }
+       //get opt. comment
        //check action
        switch($action){
                case "check":