code beautifying
This commit is contained in:
parent
e9fde76a60
commit
4fb6d2f98b
3 changed files with 10 additions and 9 deletions
|
@ -41,7 +41,8 @@ std::string Seller::getSellerNoAsString() const
|
||||||
|
|
||||||
selNoStr << std::setfill('0') << std::setw(3) << sellerNo_;
|
selNoStr << std::setfill('0') << std::setw(3) << sellerNo_;
|
||||||
|
|
||||||
return selNoStr.str();;
|
return selNoStr.str();
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Article*> Seller::getArticles(bool onlySold) const
|
std::vector<Article*> Seller::getArticles(bool onlySold) const
|
||||||
|
@ -103,7 +104,6 @@ int Seller::sumInCents()
|
||||||
|
|
||||||
std::string Seller::sumAsString() { return formatCentAsEuroString(sumInCents()); }
|
std::string Seller::sumAsString() { return formatCentAsEuroString(sumInCents()); }
|
||||||
|
|
||||||
|
|
||||||
bool operator<(const Seller& li, const Seller& re) { return li.sellerNo_ < re.sellerNo_; }
|
bool operator<(const Seller& li, const Seller& re) { return li.sellerNo_ < re.sellerNo_; }
|
||||||
bool operator<(const std::unique_ptr<Seller>& li, const std::unique_ptr<Seller>& re)
|
bool operator<(const std::unique_ptr<Seller>& li, const std::unique_ptr<Seller>& re)
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,7 +46,8 @@ PosPrinter::PosPrinter(const PrinterDevice& printerDevice) : printerDevice_(prin
|
||||||
|
|
||||||
if (printerDevice_.idVendor == 0) {
|
if (printerDevice_.idVendor == 0) {
|
||||||
for (const auto& supported : supportedPrinters_.models) {
|
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;
|
numDevice = i;
|
||||||
printerEndpoint_ = std::get<2>(supported);
|
printerEndpoint_ = std::get<2>(supported);
|
||||||
break;
|
break;
|
||||||
|
@ -161,8 +162,8 @@ void PosPrinter::printSaleReceipt(Sale* sale)
|
||||||
commandStream << sale->getTimestampFormatted() << "\n\n";
|
commandStream << sale->getTimestampFormatted() << "\n\n";
|
||||||
commandStream << Command::LEFT_ALIGN;
|
commandStream << Command::LEFT_ALIGN;
|
||||||
for (const auto& article : sale->getArticles()) {
|
for (const auto& article : sale->getArticles()) {
|
||||||
commandStream << "Verk.Nr. " << article->getSeller()->getSellerNoAsString() << "........... "
|
commandStream << "Verk.Nr. " << article->getSeller()->getSellerNoAsString()
|
||||||
<< article->getPriceAsString() << "\n";
|
<< "........... " << article->getPriceAsString() << "\n";
|
||||||
}
|
}
|
||||||
commandStream << "\nGesamt................. " << sale->sumAsString() << "\n";
|
commandStream << "\nGesamt................. " << sale->sumAsString() << "\n";
|
||||||
commandStream << Command::CENTERING;
|
commandStream << Command::CENTERING;
|
||||||
|
|
Loading…
Reference in a new issue