From 857f06f8c4d1a8d9da199b8d7d9c128f7f14db8d Mon Sep 17 00:00:00 2001 From: konrad Date: Sat, 11 Dec 2010 17:33:12 +0000 Subject: [PATCH] comment for deduct voucher transaction git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@657 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- src/mwin/entrancetab.cpp | 30 ++++++++++++++++++++---------- src/mwin/overview.cpp | 14 ++++++++------ wob/classes/order.wolf | 1 + wob/db/order.wolf | 4 ++++ wob/transact/order.wolf | 1 + www/inc/wext/autoload.php | 1 + www/inc/wext/transaction.php | 1 + www/inc/wext/voucher.php | 15 +++++++++++++++ 8 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 www/inc/wext/voucher.php diff --git a/src/mwin/entrancetab.cpp b/src/mwin/entrancetab.cpp index 01838f2..cc9f333 100644 --- a/src/mwin/entrancetab.cpp +++ b/src/mwin/entrancetab.cpp @@ -54,17 +54,27 @@ MEntranceTab::MEntranceTab(QString pk) connect(orderbtn,SIGNAL(clicked()),this,SLOT(openOrder())); vl->addSpacing(20); vl->addLayout(hl=new QHBoxLayout,0); - hl->addWidget(new QLabel(tr("Total:"))); - hl->addWidget(amtotal=new QLabel("0")); hl->addStretch(1); - hl->addWidget(new QLabel(tr("Used:"))); + QLabel*lab; + hl->addWidget(lab=new QLabel(tr("Total:"))); + fnt=lab->font(); + fnt.setPointSizeF(fnt.pointSizeF()*1.5); + lab->setFont(fnt); + hl->addWidget(amtotal=new QLabel("0")); + amtotal->setFont(fnt); + hl->addSpacing(10); + hl->addWidget(lab=new QLabel(tr("Used:"))); + lab->setFont(fnt); hl->addWidget(amused=new QLabel("0")); - hl->addStretch(1); - hl->addWidget(new QLabel(tr("Unused:"))); + amused->setFont(fnt); + hl->addSpacing(10); + hl->addWidget(lab=new QLabel(tr("Unused:"))); + lab->setFont(fnt); hl->addWidget(amopen=new QLabel("0")); - hl->addStretch(1); - hl->addWidget(new QLabel(tr("Reserved:"))); - hl->addWidget(amreserved=new QLabel("0")); + amopen->setFont(fnt); +// hl->addStretch(1); +// hl->addWidget(new QLabel(tr("Reserved:"))); +// hl->addWidget(amreserved=new QLabel("0")); QTimer*tm=new QTimer(this); connect(tm,SIGNAL(timeout()),this,SLOT(resetLabel())); @@ -155,7 +165,7 @@ void MEntranceTab::entranceValidate() amtotal->setText(QString::number(tuse.amounttickets())); amused->setText(QString::number(tuse.amountused())); amopen->setText(QString::number(tuse.amountopen())); - amreserved->setText(QString::number(tuse.amountreserved())); +// amreserved->setText(QString::number(tuse.amountreserved())); if(tuse.usestatus().value()!=MOTicketUse::NotFound) orderbtn->setEnabled(req->hasRight(req->RGetOrderByBarcode)); else @@ -225,5 +235,5 @@ void MEntranceTab::resetAmounts() amtotal->setText("0"); amused->setText("0"); amopen->setText("0"); - amreserved->setText("0"); +// amreserved->setText("0"); } \ No newline at end of file diff --git a/src/mwin/overview.cpp b/src/mwin/overview.cpp index 565dd02..f140ad0 100644 --- a/src/mwin/overview.cpp +++ b/src/mwin/overview.cpp @@ -253,16 +253,18 @@ void MOverview::deductVoucher() d.setLayout(gl=new QGridLayout); gl->addWidget(new QLabel(tr("Using a voucher to pay outside the system.")),0,0,1,2); - QLineEdit*vid; + QLineEdit*vid,*cmt; MCentSpinBox*cent; gl->addWidget(new QLabel(tr("Amount to deduct:")),1,0); gl->addWidget(cent=new MCentSpinBox,1,1); - gl->addWidget(new QLabel(tr("Voucher ID:")),2,0); - gl->addWidget(vid=new QLineEdit,2,1); + gl->addWidget(new QLabel(tr("Reason for deducting:")),2,0); + gl->addWidget(cmt=new QLineEdit,2,1); + gl->addWidget(new QLabel(tr("Voucher ID:")),3,0); + gl->addWidget(vid=new QLineEdit,3,1); - gl->setRowMinimumHeight(3,15); + gl->setRowMinimumHeight(4,15); QHBoxLayout*hl; - gl->addLayout(hl=new QHBoxLayout,4,0,1,2); + gl->addLayout(hl=new QHBoxLayout,5,0,1,2); hl->addStretch(10); QPushButton*p; hl->addWidget(p=new QPushButton(tr("OK"))); @@ -272,7 +274,7 @@ void MOverview::deductVoucher() if(d.exec()!=QDialog::Accepted)return; if(vid->text().trimmed()=="" || cent->value()<=0)return; //query server - MTDeductVoucher dv=req->queryDeductVoucher(vid->text(),cent->value()); + MTDeductVoucher dv=req->queryDeductVoucher(vid->text(),cent->value(),cmt->text()); if(dv.hasError()){ QMessageBox::warning(this,tr("Warning"),tr("Unable to deduct voucher: %1").arg(dv.errorString())); return; diff --git a/wob/classes/order.wolf b/wob/classes/order.wolf index 3343275..dea5e59 100644 --- a/wob/classes/order.wolf +++ b/wob/classes/order.wolf @@ -53,6 +53,7 @@ + diff --git a/wob/db/order.wolf b/wob/db/order.wolf index 364f75c..b6af6b3 100644 --- a/wob/db/order.wolf +++ b/wob/db/order.wolf @@ -120,6 +120,10 @@ + + + + diff --git a/wob/transact/order.wolf b/wob/transact/order.wolf index 888df3a..e80d77b 100644 --- a/wob/transact/order.wolf +++ b/wob/transact/order.wolf @@ -177,6 +177,7 @@ ID of the voucher to be usedAmount to be deducted. Must be positive. + A comment noting why it was deducted. diff --git a/www/inc/wext/autoload.php b/www/inc/wext/autoload.php index 78d9250..48c23a2 100644 --- a/www/inc/wext/autoload.php +++ b/www/inc/wext/autoload.php @@ -26,6 +26,7 @@ wob_autoclass("WOServerFormat","inc/wext/format.php"); wob_autoclass("WOShipping","inc/wext/shipping.php"); wob_autoclass("WOTemplate","inc/wext/template.php"); wob_autoclass("WOTicket","inc/wext/ticket.php"); +wob_autoclass("WOVoucher","inc/wext/voucher.php"); wob_autoclass("WOWebCart","inc/wext/webcart.php"); wob_autoclass("MSmokeTransaction","inc/wext/transaction.php"); diff --git a/www/inc/wext/transaction.php b/www/inc/wext/transaction.php index 2f51cef..bc447a1 100644 --- a/www/inc/wext/transaction.php +++ b/www/inc/wext/transaction.php @@ -13,6 +13,7 @@ class MSmokeTransaction extends WobTransaction { public function __construct() { + parent::__construct(); } protected function mkSession() diff --git a/www/inc/wext/voucher.php b/www/inc/wext/voucher.php new file mode 100644 index 0000000..6aecf5e --- /dev/null +++ b/www/inc/wext/voucher.php @@ -0,0 +1,15 @@ +getcomment(); + else return null; + } +}; + +?> \ No newline at end of file -- 1.7.2.5