diff --git a/src/core/sale.cpp b/src/core/sale.cpp index ae3f143..075df3c 100644 --- a/src/core/sale.cpp +++ b/src/core/sale.cpp @@ -36,10 +36,4 @@ std::string Sale::sumAsString() { return formatCentAsEuroString(sumInCents()); } std::string Sale::getTimestamp() const { return timestamp_; } -void Sale::setTimestamp(const std::string& timestamp) { timestamp_ = timestamp; } - -std::string Sale::getTimestampFormatted() const -{ - boost::posix_time::ptime time = boost::posix_time::from_iso_extended_string(timestamp_); - return boost::posix_time::to_simple_string(time); -} +void Sale::setTimestamp(const std::string& timestamp) { timestamp_ = timestamp; } \ No newline at end of file diff --git a/src/core/sale.h b/src/core/sale.h index c6de317..b44ff92 100644 --- a/src/core/sale.h +++ b/src/core/sale.h @@ -22,7 +22,6 @@ class Sale : public Entity ArticlesVec& getArticles(); std::string getTimestamp() const; - std::string getTimestampFormatted() const; int sumInCents(); std::string sumAsString(); diff --git a/src/printer/posprinter.cpp b/src/printer/posprinter.cpp index 2401d01..732a519 100644 --- a/src/printer/posprinter.cpp +++ b/src/printer/posprinter.cpp @@ -144,7 +144,7 @@ void PosPrinter::printSaleReceipt(Sale* sale) std::stringstream commandStream; printHeader(); commandStream << Command::RESET << Command::ENCODING << Command::RIGHT_ALIGN; - commandStream << sale->getTimestampFormatted() << "\n\n"; + commandStream << sale->getTimestamp() << "\n\n"; commandStream << Command::LEFT_ALIGN; for (const auto& article : sale->getArticles()) { commandStream << "Art. " << article->getCompleteArticleNo() << "........... " @@ -166,7 +166,6 @@ void PosPrinter::printSellerReceipt(Seller* seller, int percent, int maxFeeInCen boost::posix_time::to_simple_string(boost::posix_time::second_clock::local_time()); commandStream << timeStr << "\n\n"; commandStream << Command::LEFT_ALIGN; - commandStream << "Name: " << seller->getFirstName() << " " << seller->getLastName() << "\n"; commandStream << "Verkäufernummer: " << std::setw(4) << seller->getSellerNo() << "\n\n"; commandStream << "Anzahl Artikel geliefert: " << std::setw(4) << seller->numArticlesOffered() << "\n"; @@ -181,10 +180,10 @@ void PosPrinter::printSellerReceipt(Seller* seller, int percent, int maxFeeInCen commandStream << "Art. " << article->getCompleteArticleNo() << "........... " << article->getPriceAsString() << "\n"; } - commandStream << "\nGesamt................. " << seller->sumAsString() << "\n"; - commandStream << "./. Gebühr............. " + commandStream << "\nGesamt................." << seller->sumAsString() << "\n"; + commandStream << "./. Gebühr............." << marketFeeAsString(seller->sumInCents(), percent, maxFeeInCent) << "\n"; - commandStream << "\nAuszahlung............. " + commandStream << "\nAuszahlung............." << paymentAsString(seller->sumInCents(), percent, maxFeeInCent) << "\n"; commandStream << Command::FEED;