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;
<Doc>Empties a voucher, makes it invalid for any further use, but also keeps the price tag.</Doc>
<Input>
<Var name="voucherid" type="astring">ID of the voucher</Var>
+ <Var name="comment" type="string">optional comment for emptying the voucher</Var>
</Input>
<Call lang="php" method="WOOrder::emptyVoucher($this);"/>
<Output>