From 1df897e5c8787f7c1ae9b6e87752e13e66534e83 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Wed, 14 Jun 2017 11:04:57 +0200 Subject: [PATCH] Fixed price calculation in camp module. UI fixes. closes #309 --- camp/campservice.cpp | 10 +++++----- camp/campwizard.cpp | 5 +++++ camp/detailwidget.cpp | 5 +++++ shop/paydvouchersdialog.cpp | 4 ++++ shop/shopform.cpp | 5 +++++ 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/camp/campservice.cpp b/camp/campservice.cpp index ae96cef..3c66315 100644 --- a/camp/campservice.cpp +++ b/camp/campservice.cpp @@ -246,11 +246,6 @@ void CampService::calcPeople(CampDataPtr data) } } - if (item->adbItem()->ztp()) - { - continue; - } - if (sale != QDecDouble(0) && !fixedSale) { QDecDouble itemSale = (item->price() * sale) / 100; @@ -331,6 +326,11 @@ void CampService::calcPrice(CampDataPtr data) void CampService::addAccFee(CampDataPtr data, AddressItemPtr item, int startAge, int endAge, int days) { + if (item->adbItem()->ztp()) + { + return; + } + auto addAccService = [this, item, data](int count){ ServiceItemPtr srvItem(new ServiceItem); diff --git a/camp/campwizard.cpp b/camp/campwizard.cpp index 4764b79..4593799 100644 --- a/camp/campwizard.cpp +++ b/camp/campwizard.cpp @@ -8,6 +8,8 @@ #include #include +#include + //////////////////////////////////// /// \brief AddressHelper::AddressHelper /// \param parent @@ -204,6 +206,9 @@ CampWizard::CampWizard(QWidget *parent) : ui->tabServices->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); ui->tabServices->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch); + QScroller::grabGesture(ui->tabServices, QScroller::LeftMouseButtonGesture); + QScroller::grabGesture(ui->tabPeople, QScroller::LeftMouseButtonGesture); + m_newRecord = false; } diff --git a/camp/detailwidget.cpp b/camp/detailwidget.cpp index 340d098..8595fef 100644 --- a/camp/detailwidget.cpp +++ b/camp/detailwidget.cpp @@ -1,6 +1,8 @@ #include "detailwidget.h" #include "ui_detailwidget.h" +#include + #include "campservice.h" DetailWidget::DetailWidget(QWidget *parent) : @@ -28,6 +30,9 @@ DetailWidget::DetailWidget(QWidget *parent) : ui->tabServices->hideColumn(7); ui->tabServices->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); ui->tabServices->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch); + + QScroller::grabGesture(ui->tabServices, QScroller::LeftMouseButtonGesture); + QScroller::grabGesture(ui->tabPeople, QScroller::LeftMouseButtonGesture); } DetailWidget::~DetailWidget() diff --git a/shop/paydvouchersdialog.cpp b/shop/paydvouchersdialog.cpp index 8a0407f..5819e60 100644 --- a/shop/paydvouchersdialog.cpp +++ b/shop/paydvouchersdialog.cpp @@ -2,6 +2,7 @@ #include "ui_paydvouchersdialog.h" #include +#include #include "receiptgenerator.h" #include "shopservice.h" @@ -48,6 +49,9 @@ PaydVouchersDialog::PaydVouchersDialog(QWidget *parent) : m_voucherModel->setData(srv.paiedVouchers()); ui->tableVouchers->sortByColumn(0,Qt::AscendingOrder); + QScroller::grabGesture(ui->tableVouchers, QScroller::LeftMouseButtonGesture); + QScroller::grabGesture(ui->tableItems, QScroller::LeftMouseButtonGesture); + connect(ui->tableVouchers->selectionModel(), &QItemSelectionModel::currentRowChanged, [this, &srv](const QModelIndex ¤t, const QModelIndex &) { QSharedPointer voucher = m_voucherModel->itemFromIndex(current); srv.loadItems(voucher); diff --git a/shop/shopform.cpp b/shop/shopform.cpp index d8d65d3..4ed4416 100644 --- a/shop/shopform.cpp +++ b/shop/shopform.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include "data/favorititem.h" #include "favbutton.h" @@ -127,6 +128,10 @@ void ShopForm::loadLast() ui->commodityTable->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch); ui->commodityTable->setColumnHidden(4, true); ui->commodityTable->setColumnHidden(2, true); + ui->commodityTable->setColumnWidth(3, 90); + + QScroller::grabGesture(ui->commodityTable, QScroller::LeftMouseButtonGesture); + QScroller::grabGesture(ui->actualReceipt, QScroller::LeftMouseButtonGesture); if (srv.isEetEnabled()) {