#include "eetrequest.h" EetRequest::EetRequest(QObject *parent) : QObject(parent) { m_prvniZaslani = true; m_rezim = STANDARD; } QDateTime EetRequest::datOdesl() const { return m_datOdesl; } void EetRequest::setDatOdesl(const QDateTime &datOdesl) { m_datOdesl = datOdesl; } QString EetRequest::datOdeslStr() const { return m_datOdesl.toTimeSpec(Qt::OffsetFromUTC).toString(Qt::ISODate); } QTimeZone EetRequest::datOdeslZone() const { return m_datOdeslZone; } void EetRequest::setDatOdeslZone(const QTimeZone &datOdeslZone) { m_datOdeslZone = datOdeslZone; } bool EetRequest::prvniZaslani() const { return m_prvniZaslani; } void EetRequest::setPrvniZaslani(bool prvniZaslani) { m_prvniZaslani = prvniZaslani; } QString EetRequest::prvniZaslaniStr() const { return m_prvniZaslani ? "true" : "false"; } QUuid EetRequest::uuidZpravy() const { return m_uuidZpravy; } void EetRequest::setUuidZpravy(const QUuid &uuidZpravy) { m_uuidZpravy = uuidZpravy; } QString EetRequest::uuidZpravyStr() const { QString ret = m_uuidZpravy.toString(); ret = ret.replace(0, 1, ""); ret = ret.replace(ret.size() - 1, 1, ""); return ret; } bool EetRequest::overeni() const { return m_overeni.isNull() ? false : *m_overeni.data(); } void EetRequest::setOvereni(bool overeni) { m_overeni = QSharedPointer(new bool); *m_overeni.data() = overeni; } QString EetRequest::overeniStr() const { return m_overeni.isNull() ? NULL_VAL : (*m_overeni.data() ? "true" : "false"); } QString EetRequest::dicPopl() const { return m_dicPopl.isNull() ? NULL_VAL : QString(*m_dicPopl.data()); } void EetRequest::setDicPopl(const QString &dicPopl) { m_dicPopl = QSharedPointer(new QString(dicPopl)); } QString EetRequest::dicPoverujiciho() const { return m_dicPoverujiciho.isNull() ? NULL_VAL : QString(*m_dicPoverujiciho.data()); } void EetRequest::setDicPoverujiciho(const QString &dicPoverujiciho) { m_dicPoverujiciho = QSharedPointer(new QString(dicPoverujiciho)); } QString EetRequest::idProvoz() const { return m_idProvoz; } void EetRequest::setIdProvoz(const QString &idProvoz) { m_idProvoz = idProvoz; } QString EetRequest::idPokl() const { return m_idPokl; } void EetRequest::setIdPokl(const QString &idPokl) { m_idPokl = idPokl; } QString EetRequest::poradCis() const { return m_poradCis; } void EetRequest::setPoradCis(const QString &poradCis) { m_poradCis = poradCis; } QDateTime EetRequest::datTrzby() const { return m_datTrzby; } void EetRequest::setDatTrzby(const QDateTime &datTrzby) { m_datTrzby = datTrzby; } QString EetRequest::datTrzbyStr() const { return m_datTrzby.toTimeSpec(Qt::OffsetFromUTC).toString(Qt::ISODate); } QTimeZone EetRequest::datTrzbyZone() const { return m_datTrzbyZone; } void EetRequest::setDatTrzbyZone(const QTimeZone &datTrzbyZone) { m_datTrzbyZone = datTrzbyZone; } double EetRequest::celkTrzba() const { return m_celkTrzba.isNull() ? 0 : *m_celkTrzba.data(); } void EetRequest::setCelkTrzba(double celkTrzba) { m_celkTrzba = QSharedPointer(new double); *m_celkTrzba.data() = celkTrzba; } QString EetRequest::celkTrzbaStr() const { return m_celkTrzba.isNull() ? NULL_VAL : QString::number(*m_celkTrzba.data(), 'f', 2); } double EetRequest::zaklNepodlDph() const { return m_zaklNepodlDph.isNull() ? 0 : *m_zaklNepodlDph.data(); } void EetRequest::setZaklNepodlDph(double zaklNepodlDph) { m_zaklNepodlDph = QSharedPointer(new double); *m_zaklNepodlDph.data() = zaklNepodlDph; } QString EetRequest::zaklNepodlDphStr() const { return m_zaklNepodlDph.isNull() ? NULL_VAL : QString::number(*m_zaklNepodlDph.data(), 'f', 2); } double EetRequest::zaklDan1() const { return m_zaklDan1.isNull() ? 0 : *m_zaklDan1.data(); } void EetRequest::setZaklDan1(double zaklDan1) { m_zaklDan1 = QSharedPointer(new double); *m_zaklDan1.data() = zaklDan1; } QString EetRequest::zaklDan1Str() const { return m_zaklDan1.isNull() ? NULL_VAL : QString::number(*m_zaklDan1.data(), 'f', 2); } double EetRequest::dan1() const { return m_dan1.isNull() ? 0 : *m_dan1.data(); } void EetRequest::setDan1(double dan1) { m_dan1 = QSharedPointer(new double); *m_dan1.data() = dan1; } QString EetRequest::dan1Str() const { return m_dan1.isNull() ? NULL_VAL : QString::number(*m_dan1.data(), 'f', 2); } double EetRequest::zaklDan2() const { return m_zaklDan2.isNull() ? 0 : *m_zaklDan2.data(); } void EetRequest::setZaklDan2(double zaklDan2) { m_zaklDan2 = QSharedPointer(new double); *m_zaklDan2.data() = zaklDan2; } QString EetRequest::zaklDan2Str() const { return m_zaklDan2.isNull() ? NULL_VAL : QString::number(*m_zaklDan2.data(), 'f', 2); } double EetRequest::dan2() const { return m_dan2.isNull() ? 0 : *m_dan2.data(); } void EetRequest::setDan2(double dan2) { m_dan2 = QSharedPointer(new double); *m_dan2.data() = dan2; } QString EetRequest::dan2Str() const { return m_dan2.isNull() ? NULL_VAL : QString::number(*m_dan2.data(), 'f', 2); } double EetRequest::zaklDan3() const { return m_zaklDan3.isNull() ? 0 : *m_zaklDan3.data(); } void EetRequest::setZaklDan3(double zaklDan3) { m_zaklDan3 = QSharedPointer(new double); *m_zaklDan3.data() = zaklDan3; } QString EetRequest::zaklDan3Str() const { return m_zaklDan3.isNull() ? NULL_VAL : QString::number(*m_zaklDan3.data(), 'f', 2); } QString EetRequest::dan3Str() const { return m_dan3.isNull() ? NULL_VAL : QString::number(*m_dan3.data(), 'f', 2); } double EetRequest::dan3() const { return m_dan3.isNull() ? 0 : *m_dan3.data(); } void EetRequest::setDan3(double dan3) { m_dan3 = QSharedPointer(new double); *m_dan3.data() = dan3; } double EetRequest::cestSluz() const { return m_cestSluz.isNull() ? 0 : *m_cestSluz.data(); } void EetRequest::setCestSluz(double cestSluz) { m_cestSluz = QSharedPointer(new double); *m_cestSluz.data() = cestSluz; } QString EetRequest::cestSluzStr() const { return m_cestSluz.isNull() ? NULL_VAL : QString::number(*m_cestSluz.data(), 'f', 2); } double EetRequest::pouzitZboz1() const { return m_pouzitZboz1.isNull() ? 0 : *m_pouzitZboz1.data(); } void EetRequest::setPouzitZboz1(double pouzitZboz1) { m_pouzitZboz1 = QSharedPointer(new double); *m_pouzitZboz1.data() = pouzitZboz1; } QString EetRequest::pouzitZboz1Str() const { return m_pouzitZboz1.isNull() ? NULL_VAL : QString::number(*m_pouzitZboz1.data(), 'f', 2); } double EetRequest::pouzitZboz2() const { return m_pouzitZboz2.isNull() ? 0 : *m_pouzitZboz2.data(); } void EetRequest::setPouzitZboz2(double pouzitZboz2) { m_pouzitZboz2 = QSharedPointer(new double); *m_pouzitZboz2.data() = pouzitZboz2; } QString EetRequest::pouzitZboz2Str() const { return m_pouzitZboz2.isNull() ? NULL_VAL : QString::number(*m_pouzitZboz2.data(), 'f', 2); } double EetRequest::pouzitZboz3() const { return m_pouzitZboz3.isNull() ? 0 : *m_pouzitZboz3.data(); } void EetRequest::setPouzitZboz3(double pouzitZboz3) { m_pouzitZboz3 = QSharedPointer(new double); *m_pouzitZboz3.data() = pouzitZboz3; } QString EetRequest::pouzitZboz3Str() const { return m_pouzitZboz3.isNull() ? NULL_VAL : QString::number(*m_pouzitZboz3.data(), 'f', 2); } double EetRequest::urcenoCerpZuct() const { return m_urcenoCerpZuct.isNull() ? 0 : *m_urcenoCerpZuct.data(); } void EetRequest::setUrcenoCerpZuct(double urcenoCerpZuct) { m_urcenoCerpZuct = QSharedPointer(new double); *m_urcenoCerpZuct.data() = urcenoCerpZuct; } QString EetRequest::urcenoCerpZuctStr() const { return m_urcenoCerpZuct.isNull() ? NULL_VAL : QString::number(*m_urcenoCerpZuct.data(), 'f', 2); } double EetRequest::cerpZuct() const { return m_cerpZuct.isNull() ? 0 : *m_cerpZuct.data(); } void EetRequest::setCerpZuct(double cerpZuct) { m_cerpZuct = QSharedPointer(new double); *m_cerpZuct.data() = cerpZuct; } QString EetRequest::cerpZuctStr() const { return m_cerpZuct.isNull() ? NULL_VAL : QString::number(*m_cerpZuct.data(), 'f', 2); } EetRequest::EetRezim EetRequest::rezim() const { return m_rezim; } void EetRequest::setRezim(const EetRequest::EetRezim &rezim) { m_rezim = rezim; } QString EetRequest::rezimStr() const { switch (m_rezim) { case ZJEDNODUSENY: return "1"; case STANDARD: return "0"; default: return "0"; } }