better print seller no on sale receipt
This commit is contained in:
parent
f6528bdf45
commit
e9fde76a60
3 changed files with 11 additions and 1 deletions
|
@ -35,6 +35,15 @@ std::string Seller::getLastName() const { return lastName_; }
|
|||
|
||||
int Seller::getSellerNo() const { return sellerNo_; }
|
||||
|
||||
std::string Seller::getSellerNoAsString() const
|
||||
{
|
||||
std::stringstream selNoStr;
|
||||
|
||||
selNoStr << std::setfill('0') << std::setw(3) << sellerNo_;
|
||||
|
||||
return selNoStr.str();;
|
||||
}
|
||||
|
||||
std::vector<Article*> Seller::getArticles(bool onlySold) const
|
||||
{
|
||||
std::vector<Article*> articles;
|
||||
|
|
|
@ -28,6 +28,7 @@ class Seller : public Entity
|
|||
std::string getFirstName() const;
|
||||
std::string getLastName() const;
|
||||
int getSellerNo() const;
|
||||
std::string getSellerNoAsString() const;
|
||||
int numArticlesOffered() const;
|
||||
int numArticlesSold() const;
|
||||
// int numArticlesTotal() const;
|
||||
|
|
|
@ -161,7 +161,7 @@ void PosPrinter::printSaleReceipt(Sale* sale)
|
|||
commandStream << sale->getTimestampFormatted() << "\n\n";
|
||||
commandStream << Command::LEFT_ALIGN;
|
||||
for (const auto& article : sale->getArticles()) {
|
||||
commandStream << "Art. " << article->getCompleteArticleNo() << "........... "
|
||||
commandStream << "Verk.Nr. " << article->getSeller()->getSellerNoAsString() << "........... "
|
||||
<< article->getPriceAsString() << "\n";
|
||||
}
|
||||
commandStream << "\nGesamt................. " << sale->sumAsString() << "\n";
|
||||
|
|
Loading…
Reference in a new issue