Added support for VAT calculations.
This commit is contained in:
+15
-6
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user