From af95189c66d800c54bc33a25bbbfa9f265f94993 Mon Sep 17 00:00:00 2001 From: Konrad Rosenbaum Date: Fri, 22 Nov 2013 08:51:13 +0100 Subject: [PATCH] add comment when emptyig voucher --- src/mwin/overview.cpp | 5 +++-- wob/transact/order.wolf | 1 + www/inc/wext/order.php | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mwin/overview.cpp b/src/mwin/overview.cpp index 4ca1eec..cbd9d9b 100644 --- a/src/mwin/overview.cpp +++ b/src/mwin/overview.cpp @@ -327,10 +327,11 @@ void MOverview::deductVoucher() void MOverview::emptyVoucher() { //get voucher ID - QString vid=QInputDialog::getText(this,tr("Invalidate Voucher"),tr("Please enter/scan the barcode of the voucher to invalidate/empty - the voucher will no longer be usable afterwards, but still has to be paid for.")); + const QString vid=QInputDialog::getText(this,tr("Invalidate Voucher"),tr("Please enter/scan the barcode of the voucher to invalidate/empty - the voucher will no longer be usable afterwards, but still has to be paid for.")); if(vid=="")return; + const QString comment=QInputDialog::getText(this,tr("Invalidate Voucher"),tr("Please enter a comment why this voucher was emptied:")); //query server - MTEmptyVoucher dv=req->queryEmptyVoucher(vid); + MTEmptyVoucher dv=req->queryEmptyVoucher(vid,comment); if(dv.hasError()){ QMessageBox::warning(this,tr("Warning"),tr("Unable to invalidate voucher: %1").arg(dv.errorString())); return; diff --git a/wob/transact/order.wolf b/wob/transact/order.wolf index 2bceab6..d9fc7dc 100644 --- a/wob/transact/order.wolf +++ b/wob/transact/order.wolf @@ -231,6 +231,7 @@ Empties a voucher, makes it invalid for any further use, but also keeps the price tag. ID of the voucher + optional comment for emptying the voucher diff --git a/www/inc/wext/order.php b/www/inc/wext/order.php index d48acc6..d7acd7d 100644 --- a/www/inc/wext/order.php +++ b/www/inc/wext/order.php @@ -764,6 +764,7 @@ class WOOrder extends WOOrderAbstract //empty it $vou->value=0; $vou->isused=true; + $vou->comment=$trans->getcomment(); $vou->update(); //return $trans->setvoucher(WOVoucher::fromTablevoucher($vou)); -- 1.7.2.5