// // Created by arch on 27.10.17. // #include "Rent.h" Rent::Rent(const lt::local_date_time &startRentData, Vehicle *vehicle, Client *client) : startRentData(startRentData), vehicle(vehicle), client(client), stopRentData(startRentData) { std:: cout <<"\n" << this->startRentData<<"\n"; boost::uuids::uuid uuid = boost::uuids::random_generator()(); this->uniqId =boost::lexical_cast(uuid); this->price = vehicle->getrentPrice(); //std::cout<uniqId<< std::endl; } std:: string Rent::rentInfo(){ return this->uniqId + " Samochod: " + vehicle->vehicleInfo() + "\n"; } namespace lt = boost::local_time; namespace pt = boost::posix_time; float Rent::stopRent(lt::local_date_time ldt){ std::cout << ldt << std::endl; std::cout << "Roznica czasu:"<< std::endl; this->stopRentData = ldt; std::cout << this-> stopRentData; pt::time_duration dur = ldt - this->startRentData; int seconds = dur.total_seconds(); int days = seconds / 86400; if((seconds % 86400)>0){ days++; } this->rentDays = days; this->rentCost = days * this->price; std::cout <rentCost<