Implemented base functionality for commodity grid on shop form.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "shopservice.h"
|
||||
#include "numberseriesservice.h"
|
||||
#include "isellableservice.h"
|
||||
#include "shop-odb.hxx"
|
||||
|
||||
ShopService::ShopService()
|
||||
@@ -120,6 +121,22 @@ QList<QSharedPointer<Voucher> > ShopService::paiedVouchers()
|
||||
return all(QString("status = %1").arg(QString::number(Voucher::PAID)));
|
||||
}
|
||||
|
||||
QList<QSharedPointer<ShopItem> > ShopService::allSellableItems()
|
||||
{
|
||||
QList<QSharedPointer<ShopItem> > items;
|
||||
foreach (IPlugin *plugin, Context::instance().plugins()) {
|
||||
IService *srv = plugin->service<IService>();
|
||||
ISellableService *selSrv = dynamic_cast<ISellableService*>(srv);
|
||||
|
||||
if (selSrv != NULL)
|
||||
{
|
||||
items.append(selSrv->shopItems());
|
||||
}
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
QDecDouble ShopService::includeVat(QDecDouble price, Enums::VatType vatType)
|
||||
{
|
||||
return price * ((vatRate(vatType) / 100) + QDecDouble(1));
|
||||
|
||||
Reference in New Issue
Block a user