|
|
@ -7,6 +7,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include <eetcpp.h>
|
|
|
|
#include <eetcpp.h>
|
|
|
|
#include <QEventLoop>
|
|
|
|
#include <QEventLoop>
|
|
|
|
|
|
|
|
#include <seasonservice.h>
|
|
|
|
|
|
|
|
|
|
|
|
ShopService::ShopService()
|
|
|
|
ShopService::ShopService()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -101,11 +102,7 @@ void ShopService::pay(VoucherPtr voucher)
|
|
|
|
Transaction tx;
|
|
|
|
Transaction tx;
|
|
|
|
NumberSeriesService srvNs;
|
|
|
|
NumberSeriesService srvNs;
|
|
|
|
|
|
|
|
|
|
|
|
NumberSeriesPtr numSer = srvNs.nextForPlugin("SHOP");
|
|
|
|
voucher->setNumSer(srvNs.nextStrForPlugin("SHOP"));
|
|
|
|
QString numSerStr;
|
|
|
|
|
|
|
|
numSerStr.sprintf("%s%05d", numSer->prefix().toStdString().c_str(), numSer->lastNumber());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
voucher->setNumSer(numSerStr);
|
|
|
|
|
|
|
|
voucher->setStatus(Voucher::PAID);
|
|
|
|
voucher->setStatus(Voucher::PAID);
|
|
|
|
voucher->setEetStatus(Voucher::EET_FOR_SEND);
|
|
|
|
voucher->setEetStatus(Voucher::EET_FOR_SEND);
|
|
|
|
voucher->setPayDateTime(QDateTime::currentDateTime());
|
|
|
|
voucher->setPayDateTime(QDateTime::currentDateTime());
|
|
|
@ -345,6 +342,10 @@ QDecDouble ShopService::vatRate(Enums::VatType vatType)
|
|
|
|
|
|
|
|
|
|
|
|
void ShopService::saveVoucher(VoucherPtr entity)
|
|
|
|
void ShopService::saveVoucher(VoucherPtr entity)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
SeasonService seasonSrv;
|
|
|
|
|
|
|
|
SeasonPtr season = seasonSrv.active();
|
|
|
|
|
|
|
|
entity->setSeason(season);
|
|
|
|
|
|
|
|
|
|
|
|
Transaction tr;
|
|
|
|
Transaction tr;
|
|
|
|
odb::database *db = Context::instance().db();
|
|
|
|
odb::database *db = Context::instance().db();
|
|
|
|
|
|
|
|
|
|
|
|