show last sum
This commit is contained in:
parent
527241a0f3
commit
3efa289b5b
4 changed files with 48 additions and 47 deletions
|
@ -55,7 +55,10 @@ void MainWindow::on_actionEditSeller_triggered()
|
|||
void MainWindow::on_paidButton_triggered()
|
||||
{
|
||||
if (marketplace_->basketSize() > 0) {
|
||||
QString lastPrice{marketplace_->getBasketSumAsString().c_str()};
|
||||
dynamic_cast<BasketModel*>(ui_.basketView->model())->finishSale();
|
||||
ui_.lastPriceLabel1->setText(lastPrice);
|
||||
ui_.lastPriceLabel2->setText(lastPrice);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,9 +69,7 @@ void MainWindow::on_sellerNoEdit_checkSellerNo()
|
|||
auto inputText = ui_.sellerNoEdit->text().toStdString();
|
||||
|
||||
if (inputText.empty()) {
|
||||
if (marketplace_->basketSize() > 0) {
|
||||
dynamic_cast<BasketModel*>(ui_.basketView->model())->finishSale();
|
||||
}
|
||||
on_paidButton_triggered();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -76,6 +77,7 @@ void MainWindow::on_sellerNoEdit_checkSellerNo()
|
|||
smatch result;
|
||||
|
||||
if (!regex_match(inputText, result, pattern)) {
|
||||
ui_.sellerNoEdit->clear();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -139,6 +141,6 @@ void MainWindow::onCancelAllArticlesButtonClicked([[maybe_unused]] bool checked)
|
|||
.exec();
|
||||
if (dlgResult == QMessageBox::No)
|
||||
return;
|
||||
|
||||
|
||||
dynamic_cast<BasketModel*>(ui_.basketView->model())->cancelSale();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue