Camp and Shop now shows data for actual season only.

master
Josef Rokos 6 years ago
parent b113d5fca1
commit da9b062dbb

@ -151,3 +151,9 @@ void CampGrid::currentIndexChanged(const QModelIndex &current)
m_detail->setData(currentEntity());
}
}
QList<CampDataPtr> CampGrid::listForGrid()
{
CampService srv;
return srv.allForSeason();
}

@ -30,6 +30,10 @@ private:
// IGridForm interface
protected:
void currentIndexChanged(const QModelIndex &current);
// GridForm interface
protected:
virtual QList<CampDataPtr> listForGrid() override;
};
#endif // CAMPGRID_H

@ -204,6 +204,14 @@ void CampService::loadItems(CampDataPtr data)
data->setServices(srvService.all(QString("campData = %1").arg(data->id())));
}
QList<CampDataPtr> CampService::allForSeason()
{
SeasonService seasonSrv;
SeasonPtr season = seasonSrv.active();
return all(QString("season = %1").arg(QString::number(season->id())));
}
void CampService::calcPeople(CampDataPtr data)
{
foreach (ServiceItemPtr service, data->services()) {

@ -24,6 +24,7 @@ public:
void updateCamp(CampDataPtr data);
void eraseCamp(CampDataPtr data);
void loadItems(CampDataPtr data);
QList<CampDataPtr> allForSeason();
private:
ServiceItemPtr addServiceInt(CampDataPtr data, AccServicePtr service);

@ -406,7 +406,10 @@ QList<VoucherPtr> ShopService::tempVouchers()
QList<VoucherPtr> ShopService::paiedVouchers()
{
return all(QString("status = %1").arg(QString::number(Voucher::PAID)));
SeasonService seasonSrv;
SeasonPtr season = seasonSrv.active();
return all(QString("status = %1 AND season = %2").arg(QString::number(Voucher::PAID), QString::number(season->id())));
}
QList<VoucherPtr> ShopService::vouchersForEet()

Loading…
Cancel
Save