int idx=0;
foreach(MOPaymentType p,pt){
if(req->checkFlags(p.flags())){
- m_ptype->addItem(p.name(),QVariant::fromValue<MOPaymentType>(p));
+ m_ptype->addItem(p.description(),QVariant::fromValue<MOPaymentType>(p));
if(p.name()==dp)idx=m_ptype->count()-1;
}
}
<Column name="flags" type="string">filter: who can log payments with this method</Column>
<Preset><V col="paytype" val="cash"/><V col="description" val="default paytype: cash"/></Preset>
- <Preset><V col="paytype" val="credit card"/><V col="description" val="credit card payment"/><V col="dataname" val="card data"/><V col="datapreset" val="date: %Y-%M-%D, card: ..."/></Preset>
+ <Preset><V col="paytype" val="credit card"/><V col="description" val="credit card payment"/><V col="dataname" val="card data"/><V col="datapreset" val="date: %Y-%M-%D, card: ..."/></Preset>
+ <Preset><V col="paytype" val="voucher"/><V col="description" val="payment with voucher"/><V col="dataname" val="voucher ID"/><V col="flags" val="+_admin"/></Preset>
</Table>
<Table name="order" backup="yes" audit="yes">
<Doc>This table contains all orders and sales.</Doc>
}
//make corrections
$ord->amountpaid+=$pay;
+ //set payment type for audit
+ if(WTpaymenttype::getFromDB("voucher")!==false){
+ $ord->paytype="voucher";//see db/order.wolf for this default paytype
+ $ord->paydata=$vou->voucherid;
+ }else{
+ $ord->paydata=tr("Voucher: ").$vou->voucherid;
+ }
$ord->update();
$vou->value-=$pay;
$vou->isused=true;