@ -151,3 +151,9 @@ void CampGrid::currentIndexChanged(const QModelIndex ¤t)
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 ¤t);
// GridForm interface
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)));
return all(QString("status = %1 AND season = %2").arg(QString::number(Voucher::PAID), QString::number(season->id())));
QList<VoucherPtr> ShopService::vouchersForEet()