diff --git a/src/core/seller.cpp b/src/core/seller.cpp index e8380bc..9147934 100644 --- a/src/core/seller.cpp +++ b/src/core/seller.cpp @@ -35,13 +35,14 @@ std::string Seller::getLastName() const { return lastName_; } int Seller::getSellerNo() const { return sellerNo_; } -std::string Seller::getSellerNoAsString() const +std::string Seller::getSellerNoAsString() const { std::stringstream selNoStr; - + selNoStr << std::setfill('0') << std::setw(3) << sellerNo_; - return selNoStr.str();; + return selNoStr.str(); + ; } std::vector Seller::getArticles(bool onlySold) const @@ -103,7 +104,6 @@ int Seller::sumInCents() std::string Seller::sumAsString() { return formatCentAsEuroString(sumInCents()); } - bool operator<(const Seller& li, const Seller& re) { return li.sellerNo_ < re.sellerNo_; } bool operator<(const std::unique_ptr& li, const std::unique_ptr& re) { diff --git a/src/core/seller.h b/src/core/seller.h index 37a9be3..db44a0f 100644 --- a/src/core/seller.h +++ b/src/core/seller.h @@ -8,13 +8,13 @@ #include #include -//class Article; +// class Article; class Seller : public Entity { public: Seller() = default; - //virtual ~Seller() = default; + // virtual ~Seller() = default; Seller(const std::string& firstName, const std::string& lastName, int sellerNo = 0, int numArticlesOffered = 0); diff --git a/src/printer/posprinter.cpp b/src/printer/posprinter.cpp index 1fbf70c..5636e87 100644 --- a/src/printer/posprinter.cpp +++ b/src/printer/posprinter.cpp @@ -46,7 +46,8 @@ PosPrinter::PosPrinter(const PrinterDevice& printerDevice) : printerDevice_(prin if (printerDevice_.idVendor == 0) { for (const auto& supported : supportedPrinters_.models) { - if (desc.idVendor == std::get<0>(supported) && desc.idProduct == std::get<1>(supported)) { + if (desc.idVendor == std::get<0>(supported) && + desc.idProduct == std::get<1>(supported)) { numDevice = i; printerEndpoint_ = std::get<2>(supported); break; @@ -161,8 +162,8 @@ void PosPrinter::printSaleReceipt(Sale* sale) commandStream << sale->getTimestampFormatted() << "\n\n"; commandStream << Command::LEFT_ALIGN; for (const auto& article : sale->getArticles()) { - commandStream << "Verk.Nr. " << article->getSeller()->getSellerNoAsString() << "........... " - << article->getPriceAsString() << "\n"; + commandStream << "Verk.Nr. " << article->getSeller()->getSellerNoAsString() + << "........... " << article->getPriceAsString() << "\n"; } commandStream << "\nGesamt................. " << sale->sumAsString() << "\n"; commandStream << Command::CENTERING;