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()));
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
amtotal->setText("0");
amused->setText("0");
amopen->setText("0");
- amreserved->setText("0");
+// amreserved->setText("0");
}
\ No newline at end of file
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")));
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;
<Class name="Voucher">
<Abstract lang="qt"/>
+ <Abstract lang="php"/>
<Enum name="VoucherState">
<Value name="Ok"/>
<Value name="InvalidValue"/>
<Column name="isused" type="bool" default="false"/>
<!--remaining value in cents (0 for cancelled)-->
<Column name="value" type="int32" notnull="yes"/>
+ <!-- comments in auditing -->
+ <AuditColumn name="comment" type="string" null="yes">
+ <Call lang="php" method="WOVoucher::getTransactionComment()"/>
+ </AuditColumn>
</Table>
<Table name="product" backup="yes">
<Input>
<Var name="voucherid" type="astring">ID of the voucher to be used</Var>
<Var name="amount" type="int">Amount to be deducted. Must be positive.</Var>
+ <Var name="comment" type="string">A comment noting why it was deducted.</Var>
</Input>
<Call lang="php" method="WOOrder::deductVoucher($this);"/>
<Output>
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");
{
public function __construct()
{
+ parent::__construct();
}
protected function mkSession()
--- /dev/null
+<?
+
+class WOVoucher extends WOVoucherAbstract
+{
+ public static function getTransactionComment()
+ {
+ $inst=WobTransaction::getInstance();
+ if($inst == null)return null;
+ if(method_exists($inst,"getcomment"))
+ return $inst->getcomment();
+ else return null;
+ }
+};
+
+?>
\ No newline at end of file