Added support for VAT calculations.

This commit is contained in:
2016-05-27 16:47:40 +02:00
parent 7b9bc06c52
commit 4ebfae307a
22 changed files with 500 additions and 59 deletions
+15 -6
View File
@@ -11,12 +11,6 @@ ShopForm::ShopForm(QWidget *parent) :
ui(new Ui::ShopForm)
{
ui->setupUi(this);
ShopService srv;
m_voucher = srv.createVoucher();
m_itemsModel = new AutoTableModel<VoucherItem>(this);
m_itemsModel->setEditableCols(QList<int>() << 1);
ui->actualReceipt->setModel(m_itemsModel);
ui->actualReceipt->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
}
ShopForm::~ShopForm()
@@ -26,6 +20,11 @@ ShopForm::~ShopForm()
void ShopForm::on_directSale_clicked()
{
if (m_voucher.isNull())
{
createVoucher();
}
DirectSaleForm *form = new DirectSaleForm(this);
connect(form, &QDialog::accepted, [this, form](){
@@ -78,3 +77,13 @@ void ShopForm::onCountChanged()
//if (m_voucher->status())
}
void ShopForm::createVoucher()
{
ShopService srv;
m_voucher = srv.createVoucher();
m_itemsModel = new AutoTableModel<VoucherItem>(this);
m_itemsModel->setEditableCols(QList<int>() << 1);
ui->actualReceipt->setModel(m_itemsModel);
ui->actualReceipt->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
}