Added sales to people. Print button on Camp wizard is now functional. Added item grids below Camp main grid.
This commit is contained in:
+16
-1
@@ -212,6 +212,8 @@ void CampService::calcPeople(CampDataPtr data)
|
||||
Service<PersonPrice> srvPrices;
|
||||
QList<PersonPricePtr> prices = srvPrices.all("active = 1");
|
||||
int days = data->start().daysTo(data->end());
|
||||
QDecDouble sale = data->sale();
|
||||
bool fixedSale = data->fixedSale();
|
||||
|
||||
foreach (AddressItemPtr item, data->people()) {
|
||||
QDate first(1,1,1);
|
||||
@@ -249,6 +251,18 @@ void CampService::calcPeople(CampDataPtr data)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sale != QDecDouble(0) && !fixedSale)
|
||||
{
|
||||
QDecDouble itemSale = (item->price() * sale) / 100;
|
||||
item->setSale(itemSale);
|
||||
item->setTotalPrice(item->price() - itemSale);
|
||||
}
|
||||
else
|
||||
{
|
||||
item->setSale(0);
|
||||
item->setTotalPrice(item->price());
|
||||
}
|
||||
|
||||
addAccFee(data, item, startAge, endAge, days);
|
||||
}
|
||||
}
|
||||
@@ -287,7 +301,8 @@ void CampService::calcPrice(CampDataPtr data)
|
||||
}
|
||||
|
||||
foreach (AddressItemPtr addr, data->people()) {
|
||||
totalPrice += addr->price();
|
||||
totalPrice += addr->totalPrice();
|
||||
sale += addr->sale();
|
||||
}
|
||||
|
||||
if (data->fixedSale())
|
||||
|
||||
Reference in New Issue
Block a user