Browse Source

refs #1 Syncronizing with release commit: 04e5899d3e

qt5
parent
commit
9c70b19d42
100 changed files with 1993 additions and 2383 deletions
  1. +5
    -2
      3.0/scripts/build/runtimes/terminal_common.xml
  2. +3
    -4
      3.0/scripts/build/runtimes/terminal_ru.xml
  3. +34
    -34
      3.0/src/apps/PaymentProcessor/src/DatabaseUtils/PaymentDatabaseUtils.cpp
  4. +3
    -1
      3.0/src/apps/PaymentProcessor/src/Services/GUIService.cpp
  5. +10
    -12
      3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.cpp
  6. +0
    -5
      3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.h
  7. +1
    -1
      3.0/src/apps/PaymentProcessor/src/Services/PrintingService.cpp
  8. +1
    -0
      3.0/src/apps/PaymentProcessor/src/Services/SchedulerService.cpp
  9. +2
    -1
      3.0/src/apps/PaymentProcessor/src/Services/SettingsService.cpp
  10. +6
    -1
      3.0/src/apps/PaymentProcessor/src/Services/TerminalService.cpp
  11. +1
    -1
      3.0/src/apps/Updater/src/UpdaterApp.cpp
  12. +1
    -2
      3.0/src/apps/WatchService/src/WatchService.cpp
  13. +11
    -10
      3.0/src/includes/Hardware/Common/BaseStatus.h
  14. +1
    -0
      3.0/src/includes/Hardware/Common/BaseStatusDescriptions.h
  15. +8
    -1
      3.0/src/includes/Hardware/Common/CommandResults.h
  16. +4
    -2
      3.0/src/includes/Hardware/Common/DeviceDataConstants.h
  17. +3
    -1
      3.0/src/includes/Hardware/Common/HardwareConstants.h
  18. +24
    -5
      3.0/src/includes/Hardware/FR/FRBaseConstants.h
  19. +12
    -5
      3.0/src/includes/Hardware/FR/FRErrorDescription.h
  20. +7
    -6
      3.0/src/includes/Hardware/FR/FRStatusCodes.h
  21. +2
    -1
      3.0/src/includes/Hardware/FR/FRStatusesDescriptions.h
  22. +77
    -33
      3.0/src/includes/Hardware/FR/FiscalFieldDescriptions.h
  23. +1
    -0
      3.0/src/includes/Hardware/Protocols/Common/ProtocolNames.h
  24. +44
    -33
      3.0/src/includes/SDK/Drivers/FR/FiscalFields.h
  25. +22
    -4
      3.0/src/includes/SDK/Drivers/IFiscalPrinter.h
  26. +2
    -0
      3.0/src/includes/SDK/GUI/MessageBoxParams.h
  27. +3
    -3
      3.0/src/includes/SDK/PaymentProcessor/Core/Encashment.h
  28. +18
    -11
      3.0/src/includes/SysUtils/ISysUtils.h
  29. +2
    -0
      3.0/src/interface/modern/controls/input_field.qml
  30. +62
    -6
      3.0/src/interface/modern/main_menu_scene.qml
  31. +5
    -6
      3.0/src/interface/modern/modern.qmlproject
  32. +2
    -1
      3.0/src/interface/modern/widgets/input_field.qml
  33. +1
    -2
      3.0/src/interface/modern/widgets/list.qml
  34. +1
    -1
      3.0/src/interface/modern/widgets/text_editor.qml
  35. +23
    -1
      3.0/src/interface/plugins/Utils/src/GroupModel.cpp
  36. +3
    -1
      3.0/src/modules/AdBackend/src/Client.cpp
  37. +3
    -3
      3.0/src/modules/Common/Application/src/BasicApplication.cpp
  38. +3
    -3
      3.0/src/modules/Common/Log/QFile based/src/SimpleLog.cpp
  39. +1
    -1
      3.0/src/modules/DebugUtils/msvc/DebugUtils.vcxproj
  40. +10
    -8
      3.0/src/modules/GraphicsEngine/src/GraphicsEngine.cpp
  41. +2
    -0
      3.0/src/modules/GraphicsEngine/src/GraphicsEngine.h
  42. +9
    -0
      3.0/src/modules/Hardware.sln
  43. +19
    -13
      3.0/src/modules/Hardware/Cardreaders/msvc/CardReaders.vcxproj
  44. +47
    -25
      3.0/src/modules/Hardware/Cardreaders/msvc/CardReaders.vcxproj.filters
  45. +0
    -380
      3.0/src/modules/Hardware/Cardreaders/src/CreatorReader.cpp
  46. +0
    -65
      3.0/src/modules/Hardware/Cardreaders/src/CreatorReader.h
  47. +0
    -202
      3.0/src/modules/Hardware/Cardreaders/src/CreatorReaderConstants.h
  48. +0
    -16
      3.0/src/modules/Hardware/Cardreaders/src/CreatorReaderDataTypes.h
  49. +0
    -24
      3.0/src/modules/Hardware/Cardreaders/src/CreatorReaderModelData.h
  50. +0
    -156
      3.0/src/modules/Hardware/Cardreaders/src/EMVAdapter.cpp
  51. +0
    -61
      3.0/src/modules/Hardware/Cardreaders/src/EMVAdapter.h
  52. +0
    -45
      3.0/src/modules/Hardware/Cardreaders/src/EMVConstants.h
  53. +0
    -143
      3.0/src/modules/Hardware/Cardreaders/src/TLV.cpp
  54. +0
    -75
      3.0/src/modules/Hardware/Cardreaders/src/TLV.h
  55. +1
    -1
      3.0/src/modules/Hardware/CashAcceptors/src/CCTalk/CCTalkCashAcceptor.cpp
  56. +1
    -1
      3.0/src/modules/Hardware/CashAcceptors/src/EBDS/EBDSCashAcceptor.cpp
  57. +12
    -1
      3.0/src/modules/Hardware/Common/src/Base/DeviceBase.cpp
  58. +7
    -1
      3.0/src/modules/Hardware/Common/src/Base/DeviceBase.h
  59. +2
    -5
      3.0/src/modules/Hardware/Common/src/OPOS/OPOSPollingDeviceBase.cpp
  60. +19
    -0
      3.0/src/modules/Hardware/Common/src/Utils/DeviceUtils.h
  61. +1
    -0
      3.0/src/modules/Hardware/Common/src/Utils/ProtocolUtils.cpp
  62. +1
    -1
      3.0/src/modules/Hardware/Common/src/WorkingThreadProxy.cpp
  63. +31
    -26
      3.0/src/modules/Hardware/Common/src/locale/common_en.ts
  64. +31
    -26
      3.0/src/modules/Hardware/Common/src/locale/common_kk.ts
  65. +31
    -26
      3.0/src/modules/Hardware/Common/src/locale/common_ru.ts
  66. +5
    -0
      3.0/src/modules/Hardware/FR/msvc/FR.vcxproj
  67. +18
    -0
      3.0/src/modules/Hardware/FR/msvc/FR.vcxproj.filters
  68. +1
    -0
      3.0/src/modules/Hardware/FR/src/Atol/AtolDataTypes.h
  69. +1
    -1
      3.0/src/modules/Hardware/FR/src/Atol/AtolFRConstants.h
  70. +153
    -175
      3.0/src/modules/Hardware/FR/src/Atol/Base/AtolFRBase.cpp
  71. +11
    -18
      3.0/src/modules/Hardware/FR/src/Atol/Base/AtolFRBase.h
  72. +2
    -2
      3.0/src/modules/Hardware/FR/src/Atol/Base/AtolFRBaseConstants.h
  73. +3
    -3
      3.0/src/modules/Hardware/FR/src/Atol/Base/AtolSerialFR.cpp
  74. +1
    -1
      3.0/src/modules/Hardware/FR/src/Atol/Base/AtolSerialFR.h
  75. +2
    -2
      3.0/src/modules/Hardware/FR/src/Atol/Ejector/AtolVKP80BasedFR.cpp
  76. +1
    -1
      3.0/src/modules/Hardware/FR/src/Atol/Ejector/AtolVKP80BasedFR.h
  77. +92
    -56
      3.0/src/modules/Hardware/FR/src/Atol/Online/AtolOnlineFRBase.cpp
  78. +11
    -2
      3.0/src/modules/Hardware/FR/src/Atol/Online/AtolOnlineFRBase.h
  79. +24
    -20
      3.0/src/modules/Hardware/FR/src/Atol/Online/AtolOnlineFRConstants.h
  80. +3
    -1
      3.0/src/modules/Hardware/FR/src/Atol/Online/Paymaster.cpp
  81. +3
    -0
      3.0/src/modules/Hardware/FR/src/Atol/Online/Paymaster.h
  82. +22
    -2
      3.0/src/modules/Hardware/FR/src/Base/FFEngine.cpp
  83. +6
    -3
      3.0/src/modules/Hardware/FR/src/Base/FFEngine.h
  84. +263
    -94
      3.0/src/modules/Hardware/FR/src/Base/FRBase.cpp
  85. +38
    -7
      3.0/src/modules/Hardware/FR/src/Base/FRBase.h
  86. +156
    -4
      3.0/src/modules/Hardware/FR/src/Base/Port/PortFRBase.cpp
  87. +37
    -3
      3.0/src/modules/Hardware/FR/src/Base/Port/PortFRBase.h
  88. +60
    -68
      3.0/src/modules/Hardware/FR/src/Kasbi/KasbiFRBase.cpp
  89. +7
    -4
      3.0/src/modules/Hardware/FR/src/Kasbi/KasbiFRBase.h
  90. +22
    -21
      3.0/src/modules/Hardware/FR/src/Kasbi/KasbiFRConstants.h
  91. +23
    -17
      3.0/src/modules/Hardware/FR/src/OPOSMStarTUPK/OPOSMStarTUPK.cpp
  92. +6
    -3
      3.0/src/modules/Hardware/FR/src/OPOSMStarTUPK/OPOSMStarTUPK.h
  93. +85
    -69
      3.0/src/modules/Hardware/FR/src/Prim/Online/PrimOnlineFRBase.cpp
  94. +4
    -1
      3.0/src/modules/Hardware/FR/src/Prim/Online/PrimOnlineFRBase.h
  95. +92
    -97
      3.0/src/modules/Hardware/FR/src/Prim/Online/PrimOnlineFRConstants.h
  96. +68
    -12
      3.0/src/modules/Hardware/FR/src/Prim/PrimFRBase.cpp
  97. +7
    -4
      3.0/src/modules/Hardware/FR/src/Prim/PrimFRBase.h
  98. +35
    -40
      3.0/src/modules/Hardware/FR/src/Prim/PrimFRConstants.h
  99. +4
    -37
      3.0/src/modules/Hardware/FR/src/Prim/PrimFRDataTypes.h
  100. +91
    -110
      3.0/src/modules/Hardware/FR/src/Shtrih/Base/ProtoShtrihFR.cpp

+ 5
- 2
3.0/scripts/build/runtimes/terminal_common.xml View File

@@ -9,5 +9,8 @@
<file source="{QBS_RESULT_PATH}/plugins/drivers/coin_acceptors.dll" target="drivers/plugins/drivers/coin_acceptors.dll"/>
<file source="{QBS_RESULT_PATH}/plugins/drivers/scanners.dll" target="drivers/plugins/drivers/scanners.dll"/>
<file source="{QBS_RESULT_PATH}/plugins/drivers/card_readers.dll" target="drivers/plugins/drivers/card_readers.dll"/>
<file source="{QBS_RESULT_PATH}/plugins/drivers/health.dll" target="drivers/plugins/drivers/health.dll"/>
</runtime>
<file source="{QBS_RESULT_PATH}/plugins/drivers/health.dll" target="drivers/plugins/drivers/health.dll"/>
<!-- Интерфейс modern, компонент interface_plugins -->
<file source="{QBS_RESULT_PATH}/plugins/interface/utils.dll" target="interface_plugins/interface/modern/plugins/utils.dll"/>
</runtime>

+ 3
- 4
3.0/scripts/build/runtimes/terminal_ru.xml View File

@@ -8,7 +8,6 @@
<directory source="src/interface/modern/build" target="interface/interface/modern" recursive="true">
<exclude>*.wav</exclude>
</directory>
<file source="{QBS_RESULT_PATH}/plugins/interface/utils.dll" target="interface/interface/modern/plugins/utils.dll"/>
<!-- Звуки интерфейса modern -->
<directory source="src/interface/modern/build/sounds" target="sounds/interface/modern/sounds" recursive="true"/>
@@ -62,8 +61,8 @@
<!-- <file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/uniteller.dll" target="plugins/plugins/uniteller.dll"/> -->
<!-- UCS plugin -->
<option target="user/user/plugins/ucs.ini" key="PaymentProcessor.ChargeProvider.UcsChargeProvider.configuration_singleton/ucs_runtime_path" value="C:/UCS/BIN" />
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/ucs.dll" target="plugins/plugins/ucs.dll"/>
<!--<option target="user/user/plugins/ucs.ini" key="PaymentProcessor.ChargeProvider.UcsChargeProvider.configuration_singleton/ucs_runtime_path" value="C:/UCS/BIN" />
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/ucs.dll" target="plugins/plugins/ucs.dll"/>-->
<!-- Драйверы, компонент drivers -->
<file source="{QBS_RESULT_PATH}/plugins/drivers/fr.dll" target="drivers/plugins/drivers/fr.dll"/>
@@ -95,7 +94,7 @@
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/locale/platru_ru.qm" target="locale/plugins/platru_ru.qm"/>
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/locale/cyberchange_ru.qm" target="locale/plugins/cyberchange_ru.qm"/>
<!-- <file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/locale/uniteller_ru.qm" target="locale/plugins/uniteller_ru.qm"/> -->
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/locale/ucs_ru.qm" target="locale/plugins/ucs_ru.qm"/> -->
<!--<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/locale/ucs_ru.qm" target="locale/plugins/ucs_ru.qm"/> -->
<!-- ###################################################################################### -->


+ 34
- 34
3.0/src/apps/PaymentProcessor/src/DatabaseUtils/PaymentDatabaseUtils.cpp View File

@@ -738,7 +738,7 @@ void DatabaseUtils::fillEncashmentReport(PPSDK::SEncashment & aEncashment)
PPSDK::DealerSettings * settings = SettingsService::instance(mApplication)->getAdapter<PPSDK::DealerSettings>();
auto provider = settings->getProvider(PPSDK::IPayment::parameterByName(PPSDK::CPayment::Parameters::Provider, parameters).value.toLongLong());

foreach(auto field, provider.fields)
for (auto & field : provider.fields)
{
auto parameter = PPSDK::IPayment::parameterByName(field.id, parameters);

@@ -844,7 +844,7 @@ PPSDK::SEncashment DatabaseUtils::performEncashment(const QVariantMap & aParamet

foreach (auto & bal, result.balance.detailedSums)
{
foreach (auto amount, bal.amounts)
for (auto & amount : bal.amounts)
{
auto elem = QString("%1:%2").arg(amount.value.toString()).arg(amount.count);

@@ -985,23 +985,23 @@ QList<SDK::PaymentProcessor::SEncashment> DatabaseUtils::getLastEncashments(int
// 2. Получаем дату предыдущей инкассации
{
queryStr = "SELECT `date` FROM `encashment` WHERE `id` = :id";
QScopedPointer<IDatabaseQuery> query(mDatabase.createQuery(queryStr));
QScopedPointer<IDatabaseQuery> q(mDatabase.createQuery(queryStr));

if (!query)
if (!q)
{
LOG(mLog, LogLevel::Error, QString("failed to get previous encashment date"));

break;
}

query->bindValue(":id", encashment.id - 1);
q->bindValue(":id", encashment.id - 1);

if (query->exec() && query->first())
if (q->exec() && q->first())
{
if (query->isValid())
if (q->isValid())
{
encashment.balance.lastEncashmentId = encashment.id;
encashment.balance.lastEncashmentDate = query->value(0).toDateTime();
encashment.balance.lastEncashmentDate = q->value(0).toDateTime();
}
}
}
@@ -1010,31 +1010,31 @@ QList<SDK::PaymentProcessor::SEncashment> DatabaseUtils::getLastEncashments(int
{
queryStr = "SELECT `type`, `nominal`, COUNT(*), GROUP_CONCAT(`serial`, ',') FROM `payment_note` WHERE `ejection` = :ejection "
"GROUP BY `type`, `nominal` ORDER BY `type` ASC, `nominal` DESC";
QScopedPointer<IDatabaseQuery> query(mDatabase.createQuery(queryStr));
QScopedPointer<IDatabaseQuery> q(mDatabase.createQuery(queryStr));

if (!query)
if (!q)
{
LOG(mLog, LogLevel::Error, QString("failed to calculate notes"));

break;
}

query->bindValue(":ejection", encashment.date.toString(CIDatabaseProxy::DateFormat));
q->bindValue(":ejection", encashment.date.toString(CIDatabaseProxy::DateFormat));

if (query->exec() && query->first())
if (q->exec() && q->first())
{
QMap<PPSDK::EAmountType::Enum, PPSDK::SBalance::SAmounts> amounts;

for (; query->isValid(); query->next())
for (; q->isValid(); q->next())
{
PPSDK::EAmountType::Enum type = static_cast<PPSDK::EAmountType::Enum>(query->value(0).toInt());
PPSDK::EAmountType::Enum type = static_cast<PPSDK::EAmountType::Enum>(q->value(0).toInt());

if (!amounts.contains(type))
{
amounts[type].type = type;
}

amounts[type].amounts << PPSDK::SBalance::SAmounts::SAmount(query->value(1).toDouble(), query->value(2).toInt(), query->value(3).toString());
amounts[type].amounts << PPSDK::SBalance::SAmounts::SAmount(q->value(1).toDouble(), q->value(2).toInt(), q->value(3).toString());
}

if (!amounts.isEmpty())
@@ -1069,31 +1069,31 @@ QList<SDK::PaymentProcessor::SEncashment> DatabaseUtils::getLastEncashments(int
{
queryStr = "SELECT `type`, `nominal`, COUNT(*), GROUP_CONCAT(`serial`, ',') FROM `dispensed_note` WHERE `reported` = :reported "
"GROUP BY `type`, `nominal` ORDER BY `type` ASC, `nominal` DESC";
QScopedPointer<IDatabaseQuery> query(mDatabase.createQuery(queryStr));
QScopedPointer<IDatabaseQuery> q(mDatabase.createQuery(queryStr));

if (!query)
if (!q)
{
LOG(mLog, LogLevel::Error, QString("failed to calculate notes"));

break;
}

query->bindValue(":reported", encashment.date.toString(CIDatabaseProxy::DateFormat));
q->bindValue(":reported", encashment.date.toString(CIDatabaseProxy::DateFormat));

if (query->exec() && query->first())
if (q->exec() && q->first())
{
QMap<PPSDK::EAmountType::Enum, PPSDK::SBalance::SAmounts> amounts;

for (; query->isValid(); query->next())
for (; q->isValid(); q->next())
{
PPSDK::EAmountType::Enum type = static_cast<PPSDK::EAmountType::Enum>(query->value(0).toInt());
PPSDK::EAmountType::Enum type = static_cast<PPSDK::EAmountType::Enum>(q->value(0).toInt());

if (!amounts.contains(type))
{
amounts[type].type = type;
}

amounts[type].amounts << PPSDK::SBalance::SAmounts::SAmount(query->value(1).toDouble(), query->value(2).toInt(), query->value(3).toString());
amounts[type].amounts << PPSDK::SBalance::SAmounts::SAmount(q->value(1).toDouble(), q->value(2).toInt(), q->value(3).toString());
}

if (!amounts.isEmpty())
@@ -1107,46 +1107,46 @@ QList<SDK::PaymentProcessor::SEncashment> DatabaseUtils::getLastEncashments(int
{
queryStr = "SELECT P.`id` FROM `payment` AS P, `payment_note` AS PN WHERE PN.`fk_payment_id` = P.`id` "
"AND PN.`ejection` = :ejection ORDER BY P.`id`";
QScopedPointer<IDatabaseQuery> query(mDatabase.createQuery(queryStr));
QScopedPointer<IDatabaseQuery> q(mDatabase.createQuery(queryStr));

if (!query)
if (!q)
{
LOG(mLog, LogLevel::Error, QString("failed get payment list for last encashment (prepare query error)."));

break;
}

query->bindValue(":ejection", encashment.date.toString(CIDatabaseProxy::DateFormat));
q->bindValue(":ejection", encashment.date.toString(CIDatabaseProxy::DateFormat));

if (query->exec() && query->first())
if (q->exec() && q->first())
{
do
{
encashment.balance.payments << query->value(0).toLongLong();
} while (query->next());
encashment.balance.payments << q->value(0).toLongLong();
} while (q->next());
}
}

// 7. Загружаем параметры инкассации
{
queryStr = "SELECT `name`, `value` FROM `encashment_param` WHERE `fk_encashment_id` = :id";
QScopedPointer<IDatabaseQuery> query(mDatabase.createQuery(queryStr));
QScopedPointer<IDatabaseQuery> q(mDatabase.createQuery(queryStr));

if (!query)
if (!q)
{
LOG(mLog, LogLevel::Error, QString("failed get encashment params for encashment (prepare query error)."));

break;
}

query->bindValue(":id", encashment.id);
q->bindValue(":id", encashment.id);

if (query->exec() && query->first())
if (q->exec() && q->first())
{
do
{
encashment.parameters.insert(query->value(0).toString(), query->value(1).toString());
} while (query->next());
encashment.parameters.insert(q->value(0).toString(), q->value(1).toString());
} while (q->next());
}
}



+ 3
- 1
3.0/src/apps/PaymentProcessor/src/Services/GUIService.cpp View File

@@ -127,7 +127,7 @@ bool GUIService::initialize()
auto parseIni = [&](const QString & aIniFile)
{
QSettings settings(aIniFile, QSettings::IniFormat);
QSettings settings(ISysUtils::rmBOM(aIniFile), QSettings::IniFormat);
settings.setIniCodec("UTF-8");
foreach (auto key, settings.allKeys())
@@ -515,7 +515,9 @@ void GUIService::onIntruderActivity()
break;
}
#ifndef _DEBUG
mEventManager->sendEvent(PPSDK::Event(event, CGUIService::LogName, message));
#endif
}
//---------------------------------------------------------------------------


+ 10
- 12
3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.cpp View File

@@ -257,10 +257,10 @@ bool PrintPayment::print(DSDK::IPrinter * aPrinter, const QVariantMap & aParamet
else if (canFiscalPrint(aPrinter, false))
{
DSDK::SPaymentData paymentData = getPaymentData(actualParameters);
DSDK::IFiscalPrinter * fiscalPrinter = static_cast<DSDK::IFiscalPrinter *>(aPrinter);
mFiscalPaymentData.clear();
mPayOffSubjectData.clear();
result = static_cast<DSDK::IFiscalPrinter *>(aPrinter)->printFiscal(receipt, paymentData, mFiscalPaymentData, mPayOffSubjectData);
quint32 FDNumber = 0;
result = fiscalPrinter->printFiscal(receipt, paymentData, &FDNumber);
if (result)
{
@@ -269,11 +269,15 @@ bool PrintPayment::print(DSDK::IPrinter * aPrinter, const QVariantMap & aParamet
mFiscalFieldData = aPrinter->getDeviceConfiguration().value(CHardwareSDK::FR::FiscalFieldData).value<DSDK::TFiscalFieldData>();
}
addFiscalPaymentData(mFiscalPaymentData, receipt);
SDK::Driver::TFiscalPaymentData fiscalPaymentData;
SDK::Driver::TComplexFiscalPaymentData payOffSubjectData;
fiscalPrinter->checkFiscalFields(FDNumber, fiscalPaymentData, payOffSubjectData);
for (int i = 0; i < mPayOffSubjectData.size(); ++i)
addFiscalPaymentData(fiscalPaymentData, receipt);
for (int i = 0; i < payOffSubjectData.size(); ++i)
{
addFiscalPaymentData(mPayOffSubjectData[i], receipt);
addFiscalPaymentData(payOffSubjectData[i], receipt);
}
}
}
@@ -309,12 +313,6 @@ void PrintPayment::addFiscalPaymentData(const DSDK::TFiscalPaymentData & aFPData
}
//---------------------------------------------------------------------------
const DSDK::TFiscalPaymentData & PrintPayment::getFiscalData() const
{
return mFiscalPaymentData;
}
//---------------------------------------------------------------------------
bool PrintPayment::isFiscal(DSDK::IPrinter * aPrinter)
{
DSDK::IFiscalPrinter * fiscalPrinter = dynamic_cast<DSDK::IFiscalPrinter *>(aPrinter);


+ 0
- 5
3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.h View File

@@ -90,8 +90,6 @@ class PrintPayment : public PrintFiscalCommand
{
Q_DECLARE_TR_FUNCTIONS(PrintPayment)
SDK::Driver::TFiscalPaymentData mFiscalPaymentData;
SDK::Driver::TComplexFiscalPaymentData mPayOffSubjectData;
SDK::Driver::TFiscalFieldData mFiscalFieldData;
public:
@@ -104,9 +102,6 @@ public:
/// Печать.
virtual bool print(SDK::Driver::IPrinter * aPrinter, const QVariantMap & aParameters);
/// Получить выходные параметры, после печати фискального чека
const SDK::Driver::TFiscalPaymentData & getFiscalData() const;
private:
/// Добавить данные платежа.
void addFiscalPaymentData(const SDK::Driver::TFiscalPaymentData & aFPData, QStringList & aData);


+ 1
- 1
3.0/src/apps/PaymentProcessor/src/Services/PrintingService.cpp View File

@@ -1315,7 +1315,7 @@ void PrintingService::saveReceipt(const QVariantMap & aParameters, const QString
}
//---------------------------------------------------------------------------
QString & replaceTags(QString & aMessage)
QString replaceTags(QString aMessage)
{
aMessage.replace("[br]", "\n", Qt::CaseInsensitive);
aMessage.remove(QRegExp("\\[(b|dw|dh)\\]", Qt::CaseInsensitive));


+ 1
- 0
3.0/src/apps/PaymentProcessor/src/Services/SchedulerService.cpp View File

@@ -12,6 +12,7 @@
#include <SDK/PaymentProcessor/Core/ISettingsService.h>
// Модули
#include <SysUtils/ISysUtils.h>
#include <System/IApplication.h>
#include <System/SettingsConstants.h>
#include <Services/ServiceNames.h>


+ 2
- 1
3.0/src/apps/PaymentProcessor/src/Services/SettingsService.cpp View File

@@ -15,6 +15,7 @@
#include <SDK/PaymentProcessor/Settings/ExtensionsSettings.h>

// Modules
#include <SysUtils/ISysUtils.h>
#include <SettingsManager/SettingsManager.h>

// Project
@@ -56,7 +57,7 @@ bool SettingsService::initialize()
// Регистрируем все конфиги.
QList<SSettingsSource> settingsSources;
settingsSources
<< SSettingsSource(mApplication->getWorkingDirectory() + "/data/system.ini", AdapterNames::TerminalAdapter, true)
<< SSettingsSource(ISysUtils::rmBOM(mApplication->getWorkingDirectory() + "/data/system.ini"), AdapterNames::TerminalAdapter, true)
<< SSettingsSource("terminal.ini", AdapterNames::TerminalAdapter, false)
<< SSettingsSource("keys.xml", AdapterNames::TerminalAdapter, false)
<< SSettingsSource("config.xml", AdapterNames::TerminalAdapter, true)


+ 6
- 1
3.0/src/apps/PaymentProcessor/src/Services/TerminalService.cpp View File

@@ -4,6 +4,7 @@
#include <Common/QtHeadersBegin.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QTimer>
#include <QtCore/QSet>
#include <QtCore/QDateTime>
#include <Common/QtHeadersEnd.h>

@@ -595,10 +596,13 @@ void TerminalService::checkConfigsIntegrity()
//---------------------------------------------------------------------------
void TerminalService::sendFeedback(const QString & aSenderSubsystem, const QString & aMessage)
{
// Отбрасываем дубли сообщений
static QSet<QString> sentMessages;

QString url = static_cast<PPSDK::TerminalSettings *>(mApplication->getCore()
->getSettingsService()->getAdapter(PPSDK::CAdapterNames::TerminalAdapter))->getFeedbackURL();

if (!url.isEmpty())
if (!url.isEmpty() && !sentMessages.contains(aMessage))
{
QByteArray sendBody;

@@ -662,6 +666,7 @@ void TerminalService::sendFeedback(const QString & aSenderSubsystem, const QStri
task->getDataStream()->write(sendBody);

mApplication->getCore()->getNetworkService()->getNetworkTaskManager()->addTask(task);
sentMessages.insert(aMessage);
}
}



+ 1
- 1
3.0/src/apps/Updater/src/UpdaterApp.cpp View File

@@ -570,7 +570,7 @@ bool UpdaterApp::reRunFromTempDirectory()

{
QString programSettingsFile = QDir(getUpdaterTempDir()).absoluteFilePath(QFileInfo(QCoreApplication::arguments()[0]).baseName()) + ".ini";
QSettings tempSettings(programSettingsFile, QSettings::IniFormat);
QSettings tempSettings(ISysUtils::rmBOM(programSettingsFile), QSettings::IniFormat);

tempSettings.setValue("common/working_directory", getWorkingDirectory());
}


+ 1
- 2
3.0/src/apps/WatchService/src/WatchService.cpp View File

@@ -16,7 +16,6 @@
// Modules
#include <Common/Application.h>
#include <Common/SleepHelper.h>

#include <SysUtils/ISysUtils.h>
#include <WatchServiceClient/Constants.h>

@@ -337,7 +336,7 @@ void WatchService::loadConfiguration()
}

#if 0 // #40592 Пока выключаем данную опцию
QSettings userSettings(BasicApplication::getInstance()->getWorkingDirectory() + "/user/user.ini", QSettings::IniFormat);
QSettings userSettings(ISysUtils::rmBOM(BasicApplication::getInstance()->getWorkingDirectory() + "/user/user.ini"), QSettings::IniFormat);
userSettings.setIniCodec("UTF-8");

if (userSettings.value("guard/taboo_enabled").toString() == "true")


+ 11
- 10
3.0/src/includes/Hardware/Common/BaseStatus.h View File

@@ -18,16 +18,17 @@ namespace DeviceStatusCode
namespace Warning
{
const int Firmware = 30; /// Необходимо обновить прошивку.
const int NeedReboot = 31; /// Необходимо перезагрузить устройство по питанию.
const int ThirdPartyDriver = 32; /// Ошибка драйвера стороннего ПО и/или прошивки устройства при выполнении операции.
const int WrongSwitchesConfig = 33; /// Устройство неверно сконфигурировано.
const int Developing = 34; /// Ошибка проектирования (прошивки).
const int Compatibility = 35; /// Версия плагина не соответствует версии PP.
const int OperationError = 36; /// Ошибка выполнения команды.
const int UnknownDataExchange = 37; /// Ошибка при получении данных от устройства.
const int ModelNotVerified = 38; /// Не гарантирована полная совместимость с ПО.
const int ModelNotCompatible = 39; /// Модель соответствует другому плагину.
const int Unknown = 40; /// Неизвестное (подозрительное) состояние.
const int BootFirmware = 31; /// Необходимо обновить прошивку загрузчика.
const int NeedReboot = 32; /// Необходимо перезагрузить устройство по питанию.
const int ThirdPartyDriver = 33; /// Ошибка драйвера стороннего ПО и/или прошивки устройства при выполнении операции.
const int WrongSwitchesConfig = 34; /// Устройство неверно сконфигурировано.
const int Developing = 35; /// Ошибка проектирования (прошивки).
const int Compatibility = 36; /// Версия плагина не соответствует версии PP.
const int OperationError = 37; /// Ошибка выполнения команды.
const int UnknownDataExchange = 38; /// Ошибка при получении данных от устройства.
const int ModelNotVerified = 39; /// Не гарантирована полная совместимость с ПО.
const int ModelNotCompatible = 40; /// Модель соответствует другому плагину.
const int Unknown = 41; /// Неизвестное (подозрительное) состояние.
}

/// Ошибки.


+ 1
- 0
3.0/src/includes/Hardware/Common/BaseStatusDescriptions.h View File

@@ -57,6 +57,7 @@ namespace DeviceStatusCode
ADD_OK_STATUS(Unknown, QCoreApplication::translate("GeneralStatuses", "#unknown_state"));

ADD_WARNING_STATUS(Firmware, QCoreApplication::translate("GeneralStatuses", "#need_firmware_update"));
ADD_WARNING_STATUS(BootFirmware, QCoreApplication::translate("GeneralStatuses", "#need_boot_firmware_update"));
ADD_WARNING_STATUS(NeedReboot, QCoreApplication::translate("GeneralStatuses", "#need_reboot"));
ADD_WARNING_STATUS(ThirdPartyDriver, QCoreApplication::translate("GeneralStatuses", "#thirdparty_driver_warning"));
ADD_WARNING_STATUS(WrongSwitchesConfig, QCoreApplication::translate("GeneralStatuses", "#wrong_switches_configuration"));


+ 8
- 1
3.0/src/includes/Hardware/Common/CommandResults.h View File

@@ -20,15 +20,22 @@ namespace CommandResult
const int Protocol = 3; /// Ответ некорректен по протоколу.
const int Driver = 4; /// Ошибка драйвера.
const int NoAnswer = 5; /// Нет ответа.
const int Id = 6; /// Id пакета или команда.
const int CRC = 7; /// CRC.

// девайс
const int Answer = 100; /// Ответ логически некорректен.
const int Device = 101; /// Логическая ошибка устройства.

typedef QSet<int> TResults;
const TResults ProtocolErrors = TResults() << Port << Transport << Protocol << Driver << NoAnswer;
const TResults ProtocolErrors = TResults() << Port << Transport << Protocol << Driver << NoAnswer << Id << CRC;
}

#define CORRECT(aResult) !CommandResult::ProtocolErrors.contains(aResult)

namespace EResult
{
enum Enum { OK, Fail, Error };
}

//--------------------------------------------------------------------------------

+ 4
- 2
3.0/src/includes/Hardware/Common/DeviceDataConstants.h View File

@@ -14,10 +14,9 @@ namespace CDeviceData
const char ModelNumber[] = "model_number";
const char Revision[] = "revision";
const char Firmware[] = "firmware";
const char BootFirmware[] = "boot_firmware";
const char CheckSum[] = "check_sum";
const char SerialNumber[] = "serial_number";
const char BootVersion[] = "boot_version";
const char BootFirmware[] = "boot_firmware";
const char BoardVersion[] = "board_version";
const char Build[] = "build";
const char Switches[] = "switches";
@@ -32,6 +31,7 @@ namespace CDeviceData
const char ProtocolVersion[] = "protocol_version";
const char SDCard[] = "sd_card";
const char Error[] = "error";
const char NotConnected[] = "not_connected";
const char Identity[] = "identity";
const char Token[] = "token_data";
const char InternalFirmware[] = "device_id_key";
@@ -124,6 +124,7 @@ namespace CDeviceData
const char OwnerId[] = "owner_id";
const char ReregistrationNumber[] = "reregistration_number";
const char FreeReregistrations[] = "free_reregistrations";
const char LastRegistrationDate[] = "last_registration_date";
const char Activated[] = "activated";
const char Language[] = "language";
const char CurrentDate[] = "fr_current_date";
@@ -137,6 +138,7 @@ namespace CDeviceData
const char OperationModes[] = "operation_modes";
const char AutomaticNumber[] = "automatic_number";
const char DTDBuild[] = "dtd_build"; // data transfer device
const char CanProcessZBuffer[] = "can_process_z_buffer";
}
/// ЭКЛЗ.


+ 3
- 1
3.0/src/includes/Hardware/Common/HardwareConstants.h View File

@@ -132,7 +132,6 @@ namespace CHardware
const char NeedSeparating[] = "need_separating";
const char ByteString[] = "byte_string";
const char Receipt[] = "receipt";
const char PrintPageNumber[] = "print_page_number";
const char PresenterEnable[] = "presenter_enable";
const char RetractorEnable[] = "retractor_enable";
const char PresenterStatusEnable[] = "presenter_status_enable";
@@ -179,6 +178,8 @@ namespace CHardware
const char PaperWeightSensors[] = "paper_weight_sensors";
const char DocumentCap[] = "document_cap";
const char BackFeed[] = "back_feed";
const char PrintPageNumber[] = "print_page_number";
const char LeftMargin[] = "left_margin";
}
/// Параметры обработки чека после отрезки.
@@ -237,6 +238,7 @@ namespace CHardware
const char CVCNumber[] = "cvc_number";
const char ForcePerformZReport[] = "force_perform_z_report";
const char PrinterModel[] = "printer_model";
const char CanZReportWithoutPrinting[] = "can_z_report_without_printing";
/// Команды.
namespace Commands


+ 24
- 5
3.0/src/includes/Hardware/FR/FRBaseConstants.h View File

@@ -4,7 +4,6 @@
// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QDateTime>
#include <QtCore/QRegExp>
#include <Common/QtHeadersEnd.h>
@@ -107,6 +106,13 @@ namespace CFR
/// Признак способа расчета по умолчанию для платежей (тег 1214) (не интернет-магазинов) - Полный расчет.
const SDK::Driver::EPayOffSubjectMethodTypes::Enum PayOffSubjectMethodType = SDK::Driver::EPayOffSubjectMethodTypes::Full;
/// Результаты запроса статуса.
namespace Result
{
const char Error[] = "__ERROR__"; /// Ошибка устройства, либо ответ неверно скомпонован.
const char Fail[] = "__FAIL__"; /// Транспортная/протокольная ошибка.
}
/// ИНН.
namespace INN
{
@@ -164,10 +170,7 @@ namespace CFR
const TStatusCodes XReportFiscalErrors = getFiscalStatusCodes(SDK::Driver::EWarningLevel::Error)
<< DeviceStatusCode::Error::Unknown
<< FRStatusCode::Error::EKLZ
<< FRStatusCode::Error::FiscalMemory;
/// Сменилась ли ставка НДС с 18% на 20% в РФ.
inline bool isRFVAT20() { return QDate::currentDate() >= QDate(2019, 1, 1); }
<< FRStatusCode::Error::FM;
/// Актуальные ставки НДС в России.
const SDK::Driver::TVATs RFActualVATs = SDK::Driver::TVATs() << 18 << 10 << 0;
@@ -390,6 +393,22 @@ namespace CFR
static CAgentFlags AgentFlags;
//--------------------------------------------------------------------------------
/// Причины перерегистрации (1101).
class CReregistrationCauses : public CBitmapDescription<char>
{
public:
CReregistrationCauses()
{
append(1, "Замена ФН");
append(2, "Замена ОФД");
append(3, "Изменение реквизитов");
append(4, "Изменение настроек ККТ");
}
};
static CReregistrationCauses ReregistrationCauses;
//--------------------------------------------------------------------------------
/// Спецификация флагов ФН.
class CFSFlagData : public CSpecification<char, int>
{


+ 12
- 5
3.0/src/includes/Hardware/FR/FRErrorDescription.h View File

@@ -18,7 +18,8 @@ namespace FRError
Printer, /// Принтер.
FM, /// Фискальная память.
EKLZ, /// ЭКЛЗ.
FS /// ФН.
FS, /// ФН.
SD /// Ошибка карты памяти.
};
}

@@ -26,15 +27,16 @@ namespace FRError
{
QString description;
EType::Enum type;
bool extraData;

SData() : type(EType::FR) {}
SData(const QString & aDescription, EType::Enum aType = EType::FR) : description(aDescription), type(aType) {}
SData() : type(EType::FR), extraData(false) {}
SData(const QString & aDescription, EType::Enum aType = EType::FR, bool aExtraData = false) : description(aDescription), type(aType), extraData(aExtraData) {}
};

class CData : public CSpecification<char, SData>
class Data : public CSpecification<char, SData>
{
public:
CData()
Data()
{
setDefault(SData(QString::fromUtf8("Неизвестная"), EType::Unknown));
}
@@ -43,6 +45,11 @@ namespace FRError
{
mBuffer.insert(aKey, SData(QString::fromUtf8(aDescription), aType));
}

void add(char aKey, const char * aDescription, bool aExtraData)
{
mBuffer.insert(aKey, SData(QString::fromUtf8(aDescription), EType::FR, aExtraData));
}
};
}



+ 7
- 6
3.0/src/includes/Hardware/FR/FRStatusCodes.h View File

@@ -32,18 +32,19 @@ namespace FRStatusCode
const int FR = 270; /// Неизвестная ошибка фискальной доработки.
const int EKLZ = 271; /// Ошибка ЭКЛЗ.
const int FiscalCollapse = 272; /// Глобальная ошибка фискальной части ФР, печать невозможна.
const int FiscalMemory = 273; /// Ошибка фискальной памяти.
const int FM = 273; /// Ошибка фискальной памяти.
const int ZBuffer = 274; /// Ошибка буфера Z-отчетов ФР.
const int ZBufferOverflow = 275; /// Переполнен буфер z-отчётов.
const int NeedCloseSession = 276; /// Необходимо выполнить Z-отчет.
const int FSEnd = 277; /// Срок действия ФН кончился.
const int NeedOFDConnection = 278; /// Необходимо подключение к серверу ОФД.
const int FS = 279; /// Ошибка ФН.
const int NoMoney = 280; /// Не хватает денег для какой-либо операции.
const int WrongDealerTaxSystem = 281; /// Неверно настроена СНО.
const int WrongDealerAgentFlag = 282; /// Неверно настроен признак агента.
const int CashierINN = 283; /// Неправильный ИНН кассира.
const int Taxes = 284; /// Налоговые ставки неверны.
const int FSClosed = 280; /// ФН закрыт.
const int NoMoney = 281; /// Не хватает денег для какой-либо операции.
const int WrongDealerTaxSystem = 282; /// Неверно настроена СНО.
const int WrongDealerAgentFlag = 283; /// Неверно настроен признак агента.
const int CashierINN = 284; /// Неправильный ИНН кассира.
const int Taxes = 285; /// Налоговые ставки неверны.
}
}


+ 2
- 1
3.0/src/includes/Hardware/FR/FRStatusesDescriptions.h View File

@@ -41,13 +41,14 @@ namespace FRStatusCode
ADD_FR_ERROR(FR, QCoreApplication::translate("FRStatuses", "#fiscal_add_on_error"));
ADD_FR_ERROR(EKLZ, QCoreApplication::translate("FRStatuses", "#EKLZ_error"));
ADD_FR_ERROR(FiscalCollapse, QCoreApplication::translate("FRStatuses", "#fiscal_collapse"));
ADD_FR_ERROR(FiscalMemory, QCoreApplication::translate("FRStatuses", "#FM_error"));
ADD_FR_ERROR(FM, QCoreApplication::translate("FRStatuses", "#FM_error"));
ADD_FR_ERROR(ZBuffer, QCoreApplication::translate("FRStatuses", "#z_buffer_error"));
ADD_FR_ERROR(ZBufferOverflow, QCoreApplication::translate("FRStatuses", "#z_buffer_overflow"));
ADD_FR_ERROR(NeedCloseSession, QCoreApplication::translate("FRStatuses", "#need_close_session"));
ADD_FR_ERROR(FSEnd, QCoreApplication::translate("FRStatuses", "#fs_end"));
ADD_FR_ERROR(NeedOFDConnection, QCoreApplication::translate("FRStatuses", "#need_ofd_connection"));
ADD_FR_ERROR(FS, QCoreApplication::translate("FRStatuses", "#fs"));
ADD_FR_ERROR(FSClosed, QCoreApplication::translate("FRStatuses", "#fs_closed"));
ADD_FR_ERROR(NoMoney, QCoreApplication::translate("FRStatuses", "#no_money"));
ADD_FR_ERROR(WrongDealerTaxSystem, QCoreApplication::translate("FRStatuses", "#wrong_dealer_tax_system"));
ADD_FR_ERROR(WrongDealerAgentFlag, QCoreApplication::translate("FRStatuses", "#wrong_dealer_agent_flag"));


+ 77
- 33
3.0/src/includes/Hardware/FR/FiscalFieldDescriptions.h View File

@@ -3,6 +3,7 @@
// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QDate>
#include <Common/QtHeadersEnd.h>
// SDK
@@ -14,6 +15,13 @@
#pragma once
//---------------------------------------------------------------------------
namespace CFR
{
/// Сменилась ли ставка НДС с 18% на 20% в РФ.
inline bool isRFVAT20() { return QDate::currentDate() >= QDate(2019, 1, 1); }
}
//---------------------------------------------------------------------------
namespace CFR { namespace FiscalFields
{
// Типы данных.
@@ -116,6 +124,11 @@ namespace CFR { namespace FiscalFields
{
it->translationPF = QCoreApplication::translate("FiscalFields", it->translationPF.toLatin1());
}
foreach(int field, mBuffer.keys())
{
checkRFVAT20(field);
}
}
static TAllData process(int aField, const SData & aData = SData())
@@ -139,44 +152,50 @@ namespace CFR { namespace FiscalFields
QString getLogFromList(const TFields & aFields) const { QStringList data; foreach(int field, aFields) data << getTextLog(field); return data.join(", ").replace("fiscal field ", ""); }
private:
inline void checkRFVAT20(int aField);
QMap<int, QString> mDescriptionData;
};
#define ADD_FISCAL_FIELD(aField, aName, aType, ...) const int aName = [] () -> int { CFR::FiscalFields::Data::process(aField, CFR::FiscalFields::SData(CFR::FiscalFields::ETypes::aType, CFiscalSDK::aName, __VA_ARGS__)); return aField; } ();
ADD_FISCAL_FIELD(1000, FDName, String, QCoreApplication::translate("FiscalFields", "#fd_name")); // 1000 (Наименование фискального документа).
ADD_FISCAL_FIELD(1008, UserContact, String, QCoreApplication::translate("FiscalFields", "#user_contact")); // 1008 (Телефон или электронный адрес покупателя).
ADD_FISCAL_FIELD(1009, PayOffAddress, String); // 1009 (Адрес расчетов).
ADD_FISCAL_FIELD(1012, FDDateTime, UnixTime); // 1012 (Дата и время ФД).
ADD_FISCAL_FIELD(1013, SerialFRNumber, String, QCoreApplication::translate("FiscalFields", "#serial_fr_number")); // 1013 (Заводской номер ФР).
ADD_FISCAL_FIELD(1017, OFDINN, String, QCoreApplication::translate("FiscalFields", "#ofd_inn")); // 1017 (ИНН ОФД).
ADD_FISCAL_FIELD(1018, INN, String, QCoreApplication::translate("FiscalFields", "#inn")); // 1018 (ИНН пользователя).
ADD_FISCAL_FIELD(1020, PayOffAmount, VLN, QCoreApplication::translate("FiscalFields", "#payoff_amount"), true); // 1020 (Сумма расчета в чеке).
ADD_FISCAL_FIELD(1021, Cashier, String, QCoreApplication::translate("FiscalFields", "#cashier")); // 1021 (Кассир).
ADD_FISCAL_FIELD(1030, UnitName, String); // 1030 (Наименование товара).
ADD_FISCAL_FIELD(1036, AutomaticNumber, String, QCoreApplication::translate("FiscalFields", "#automatic_number")); // 1036 (Номер автомата).
ADD_FISCAL_FIELD(1037, RNM, String, QCoreApplication::translate("FiscalFields", "#rnm")); // 1037 (Регистрационный номер ККТ).
ADD_FISCAL_FIELD(1038, SessionNumber, UINT32, QCoreApplication::translate("FiscalFields", "#session_number")); // 1038 (Номер смены).
ADD_FISCAL_FIELD(1040, FDNumber, UINT32, QCoreApplication::translate("FiscalFields", "#fd_number")); // 1040 (Номер ФД).
ADD_FISCAL_FIELD(1041, SerialFSNumber, String, QCoreApplication::translate("FiscalFields", "#serial_fs_number")); // 1041 (Заводской номер ФН).
ADD_FISCAL_FIELD(1042, DocumentNumber, UINT32, QCoreApplication::translate("FiscalFields", "#document_number")); // 1042 (Номер чека за смену).
ADD_FISCAL_FIELD(1046, OFDName, String, QCoreApplication::translate("FiscalFields", "#ofd_name")); // 1046 (Наименование ОФД).
ADD_FISCAL_FIELD(1048, LegalOwner, String); // 1048 (Наименование юр. лица владельца).
ADD_FISCAL_FIELD(1054, PayOffType, Byte); // 1054 (Признак расчета).
ADD_FISCAL_FIELD(1055, TaxSystem, Byte, QCoreApplication::translate("FiscalFields", "#tax_system")); // 1055 (СНО на платеже).
ADD_FISCAL_FIELD(1060, FTSURL, String, QCoreApplication::translate("FiscalFields", "#fts_url")); // 1060 (Адрес сайта ФНС).
ADD_FISCAL_FIELD(1062, TaxSystemsReg, Byte, QCoreApplication::translate("FiscalFields", "#tax_systems_reg")); // 1062 (СНО из итогов регистрации).
ADD_FISCAL_FIELD(1074, ProcessingPhone, String, QCoreApplication::translate("FiscalFields", "#processing_phone")); // 1074 (Телефон оператора по приему платежей).
ADD_FISCAL_FIELD(1077, FDSign, ByteArray, QCoreApplication::translate("FiscalFields", "#fd_sign")); // 1077 (Фискальный признак документа).
ADD_FISCAL_FIELD(1117, SenderMail, String, QCoreApplication::translate("FiscalFields", "#sender_mail")); // 1117 (Электронная почта отправителя чека).
ADD_FISCAL_FIELD(1187, PayOffPlace, String, QCoreApplication::translate("FiscalFields", "#payoff_place")); // 1187 (Место расчетов).
ADD_FISCAL_FIELD(1188, ModelVersion, String, QCoreApplication::translate("FiscalFields", "#model_version")); // 1188 (Версия модели ККТ).
ADD_FISCAL_FIELD(1189, FFDFR, Byte, QCoreApplication::translate("FiscalFields", "#ffd_fr")); // 1189 (Версия ФФД ФР).
ADD_FISCAL_FIELD(1190, FFDFS, Byte, QCoreApplication::translate("FiscalFields", "#ffd_fs")); // 1190 (Версия ФФД ФН).
ADD_FISCAL_FIELD(1199, VATRate, Byte); // 1199 (Ставка НДС).
ADD_FISCAL_FIELD(1203, CashierINN, String, QCoreApplication::translate("FiscalFields", "#cashier_inn")); // 1203 (ИНН кассира).
ADD_FISCAL_FIELD(1208, OFDURL, String, QCoreApplication::translate("FiscalFields", "#ofd_url")); // 1208 (Адрес сайта для получения чека).
ADD_FISCAL_FIELD(1209, FFD, Byte); // 1209 (Версия ФФД).
ADD_FISCAL_FIELD(1000, FDName, String, QCoreApplication::translate("FiscalFields", "#fd_name")); // 1000 (Наименование фискального документа).
ADD_FISCAL_FIELD(1008, UserContact, String, QCoreApplication::translate("FiscalFields", "#user_contact")); // 1008 (Телефон или электронный адрес покупателя).
ADD_FISCAL_FIELD(1009, PayOffAddress, String); // 1009 (Адрес расчетов).
ADD_FISCAL_FIELD(1012, FDDateTime, UnixTime); // 1012 (Дата и время ФД).
ADD_FISCAL_FIELD(1013, SerialFRNumber, String, QCoreApplication::translate("FiscalFields", "#serial_fr_number")); // 1013 (Заводской номер ФР).
ADD_FISCAL_FIELD(1017, OFDINN, String, QCoreApplication::translate("FiscalFields", "#ofd_inn")); // 1017 (ИНН ОФД).
ADD_FISCAL_FIELD(1018, INN, String, QCoreApplication::translate("FiscalFields", "#inn")); // 1018 (ИНН пользователя).
ADD_FISCAL_FIELD(1020, PayOffAmount, VLN, QCoreApplication::translate("FiscalFields", "#payoff_amount"), true); // 1020 (Сумма расчета в чеке).
ADD_FISCAL_FIELD(1021, Cashier, String, QCoreApplication::translate("FiscalFields", "#cashier")); // 1021 (Кассир).
ADD_FISCAL_FIELD(1030, UnitName, String); // 1030 (Наименование товара).
ADD_FISCAL_FIELD(1036, AutomaticNumber, String, QCoreApplication::translate("FiscalFields", "#automatic_number")); // 1036 (Номер автомата).
ADD_FISCAL_FIELD(1037, RNM, String, QCoreApplication::translate("FiscalFields", "#rnm")); // 1037 (Регистрационный номер ККТ).
ADD_FISCAL_FIELD(1038, SessionNumber, UINT32, QCoreApplication::translate("FiscalFields", "#session_number")); // 1038 (Номер смены).
ADD_FISCAL_FIELD(1040, FDNumber, UINT32, QCoreApplication::translate("FiscalFields", "#fd_number")); // 1040 (Номер ФД).
ADD_FISCAL_FIELD(1041, SerialFSNumber, String, QCoreApplication::translate("FiscalFields", "#serial_fs_number")); // 1041 (Заводской номер ФН).
ADD_FISCAL_FIELD(1042, DocumentNumber, UINT32, QCoreApplication::translate("FiscalFields", "#document_number")); // 1042 (Номер чека за смену).
ADD_FISCAL_FIELD(1046, OFDName, String, QCoreApplication::translate("FiscalFields", "#ofd_name")); // 1046 (Наименование ОФД).
ADD_FISCAL_FIELD(1048, LegalOwner, String); // 1048 (Наименование юр. лица владельца).
ADD_FISCAL_FIELD(1054, PayOffType, Byte); // 1054 (Признак расчета).
ADD_FISCAL_FIELD(1055, TaxSystem, Byte, QCoreApplication::translate("FiscalFields", "#tax_system")); // 1055 (СНО на платеже).
ADD_FISCAL_FIELD(1060, FTSURL, String, QCoreApplication::translate("FiscalFields", "#fts_url")); // 1060 (Адрес сайта ФНС).
ADD_FISCAL_FIELD(1062, TaxSystemsReg, Byte, QCoreApplication::translate("FiscalFields", "#tax_systems_reg")); // 1062 (СНО из итогов регистрации).
ADD_FISCAL_FIELD(1074, ProcessingPhone, String, QCoreApplication::translate("FiscalFields", "#processing_phone")); // 1074 (Телефон оператора по приему платежей).
ADD_FISCAL_FIELD(1077, FDSign, ByteArray, QCoreApplication::translate("FiscalFields", "#fd_sign")); // 1077 (Фискальный признак документа).
ADD_FISCAL_FIELD(1097, OFDNotSentFDQuantity, UINT32, QCoreApplication::translate("FiscalFields", "#ofd_not_sent_fd_quantity")); // 1097 (Количество непереданных ФД).
ADD_FISCAL_FIELD(1098, OFDNotSentFDDateTime, UnixTime, QCoreApplication::translate("FiscalFields", "#ofd_not_sent_fd_date_time")); // 1098 (Дата и время первого из непереданных ФД).
ADD_FISCAL_FIELD(1101, ReregistrationCause, Byte, QCoreApplication::translate("FiscalFields", "#reregistration_cause")); // 1101 (Код причины перерегистрации).
ADD_FISCAL_FIELD(1111, FDForSessionTotal, UINT32, QCoreApplication::translate("FiscalFields", "#fd_for_session_total")); // 1111 (Общее количество ФД за смену).
ADD_FISCAL_FIELD(1117, SenderMail, String, QCoreApplication::translate("FiscalFields", "#sender_mail")); // 1117 (Электронная почта отправителя чека).
ADD_FISCAL_FIELD(1118, FiscalsForSessionTotal, UINT32, QCoreApplication::translate("FiscalFields", "#fiscals_for_session_total")); // 1118 (Количество кассовых чеков (БСО) за смену).
ADD_FISCAL_FIELD(1187, PayOffPlace, String, QCoreApplication::translate("FiscalFields", "#payoff_place")); // 1187 (Место расчетов).
ADD_FISCAL_FIELD(1188, ModelVersion, String, QCoreApplication::translate("FiscalFields", "#model_version")); // 1188 (Версия модели ККТ).
ADD_FISCAL_FIELD(1189, FFDFR, Byte, QCoreApplication::translate("FiscalFields", "#ffd_fr")); // 1189 (Версия ФФД ФР).
ADD_FISCAL_FIELD(1190, FFDFS, Byte, QCoreApplication::translate("FiscalFields", "#ffd_fs")); // 1190 (Версия ФФД ФН).
ADD_FISCAL_FIELD(1199, VATRate, Byte); // 1199 (Ставка НДС).
ADD_FISCAL_FIELD(1203, CashierINN, String, QCoreApplication::translate("FiscalFields", "#cashier_inn")); // 1203 (ИНН кассира).
ADD_FISCAL_FIELD(1208, OFDURL, String, QCoreApplication::translate("FiscalFields", "#ofd_url")); // 1208 (Адрес сайта для получения чека).
ADD_FISCAL_FIELD(1209, FFD, Byte); // 1209 (Версия ФФД).
// Данные оператора перевода
ADD_FISCAL_FIELD(1005, TransferOperatorAddress, String, QCoreApplication::translate("FiscalFields", "#transfer_operator_address")); // 1005 (Адрес оператора перевода).
@@ -194,6 +213,12 @@ namespace CFR { namespace FiscalFields
ADD_FISCAL_FIELD(1073, AgentPhone, String, QCoreApplication::translate("FiscalFields", "#agent_phone")); // 1073 (Телефон платежного агента).
ADD_FISCAL_FIELD(1222, AgentFlag, Byte); // 1222 (Признак платежного агента на платеже).
// Статусы
ADD_FISCAL_FIELD(1050, FSExpiredStatus, Byte, QCoreApplication::translate("FiscalFields", "#fs_expired_status")); // 1050 (Признак исчерпания ресурса ФН).
ADD_FISCAL_FIELD(1051, FSNeedChangeStatus, Byte, QCoreApplication::translate("FiscalFields", "#fs_need_change_status")); // 1051 (Признак необходимости срочной замены ФН).
ADD_FISCAL_FIELD(1052, FSMemoryEnd, Byte, QCoreApplication::translate("FiscalFields", "#fs_memory_end_status")); // 1052 (Признак заполнения памяти ФН).
ADD_FISCAL_FIELD(1053, OFDNoConnection, Byte, QCoreApplication::translate("FiscalFields", "#ofd_no_connection_status")); // 1053 (Признак превышения времени ожидания ответа ОФД).
// Режимы работы
ADD_FISCAL_FIELD(1001, AutomaticMode, Byte, QCoreApplication::translate("FiscalFields", "#automatic_mode")); // 1001 (Признак автоматического режима).
ADD_FISCAL_FIELD(1002, AutonomousMode, Byte, QCoreApplication::translate("FiscalFields", "#autonomous_mode")); // 1002 (Признак автономного режима).
@@ -250,6 +275,25 @@ namespace CFR { namespace FiscalFields
<< CFR::FiscalFields::PayOffSubjectTaxAmount
<< CFR::FiscalFields::PayOffSubjectType
<< CFR::FiscalFields::PayOffSubjectMethodType;
//---------------------------------------------------------------------------
// Список полей налогов.
const QSet<int> TaxAmountFields = QSet<int>()
<< CFR::FiscalFields::TaxAmount02
<< CFR::FiscalFields::TaxAmount03
<< CFR::FiscalFields::TaxAmount04
<< CFR::FiscalFields::TaxAmount05
<< CFR::FiscalFields::TaxAmount06
<< CFR::FiscalFields::TaxAmount07;
void Data::checkRFVAT20(int aField)
{
if (isRFVAT20() && TaxAmountFields.contains(aField))
{
mBuffer[aField].translationPF.replace("18", "20");
mDescriptionData[aField].replace("18", "20");
}
}
}} // namespace CFR::FiscalFields
//---------------------------------------------------------------------------

+ 1
- 0
3.0/src/includes/Hardware/Protocols/Common/ProtocolNames.h View File

@@ -24,6 +24,7 @@ namespace ProtocolNames
const char PRIM[] = "PRIM";
const char SPARK[] = "SPARK";
const char Kasbi[] = "Kasbi";
const char AFP[] = "AFP";
const char Incotex[] = "Incotex";
}



+ 44
- 33
3.0/src/includes/SDK/Drivers/FR/FiscalFields.h View File

@@ -4,39 +4,44 @@
namespace SDK { namespace Driver { namespace CAllHardware { namespace FiscalFields
{
const char FDName[] = "fd_name"; // 1000 (Наименование фискального документа).
const char UserContact[] = "user_contact"; // 1008 (Телефон или электронный адрес покупателя).
const char PayOffAddress[] = "payoff_address"; // 1009 (Адрес расчетов).
const char FDDateTime[] = "fd_date_time"; // 1012 (Дата и время ФД).
const char SerialFRNumber[] = "serial_fr_number"; // 1013 (Заводской номер ФР).
const char OFDINN[] = "ofd_inn"; // 1017 (ИНН ОФД).
const char INN[] = "inn"; // 1018 (ИНН пользователя).
const char PayOffAmount[] = "payoff_amount"; // 1020 (Сумма расчета в чеке).
const char Cashier[] = "cashier"; // 1021 (Кассир).
const char UnitName[] = "unit_name"; // 1030 (Наименование товара).
const char AutomaticNumber[] = "automatic_number"; // 1036 (Номер автомата).
const char RNM[] = "rnm"; // 1037 (Регистрационный номер ККТ).
const char SessionNumber[] = "session_number"; // 1038 (Номер смены).
const char FDNumber[] = "fd_number"; // 1040 (Номер ФД).
const char SerialFSNumber[] = "serial_fs_number"; // 1041 (Заводской номер ФН).
const char DocumentNumber[] = "document_number"; // 1042 (Номер чека за смену).
const char OFDName[] = "ofd_name"; // 1046 (Наименование ОФД).
const char LegalOwner[] = "legal_owner"; // 1048 (Наименование юр. лица владельца).
const char PayOffType[] = "payoff_type"; // 1054 (Признак расчета).
const char TaxSystem[] = "tax_system"; // 1055 (СНО на платеже).
const char FTSURL[] = "fts_url"; // 1060 (Адрес сайта ФНС).
const char TaxSystemsReg[] = "tax_systems_reg"; // 1062 (СНО из итогов регистрации).
const char ProcessingPhone[] = "processing_phone"; // 1074 (Телефон оператора по приему платежей).
const char FDSign[] = "fd_sign"; // 1077 (Фискальный признак документа).
const char SenderMail[] = "sender_mail"; // 1117 (Электронная почта отправителя чека).
const char PayOffPlace[] = "payoff_place"; // 1187 (Место расчетов).
const char ModelVersion[] = "model_version"; // 1188 (Версия модели ККТ).
const char FFDFR[] = "ffd_fr"; // 1189 (Версия ФФД ФР).
const char FFDFS[] = "ffd_fs"; // 1190 (Версия ФФД ФН).
const char VATRate[] = "vat_rate"; // 1199 (Ставка НДС).
const char CashierINN[] = "cashier_inn"; // 1203 (ИНН кассира).
const char OFDURL[] = "ofd_url"; // 1208 (Адрес сайта для получения чека).
const char FFD[] = "ffd"; // 1209 (Версия ФФД).
const char FDName[] = "fd_name"; // 1000 (Наименование фискального документа).
const char UserContact[] = "user_contact"; // 1008 (Телефон или электронный адрес покупателя).
const char PayOffAddress[] = "payoff_address"; // 1009 (Адрес расчетов).
const char FDDateTime[] = "fd_date_time"; // 1012 (Дата и время ФД).
const char SerialFRNumber[] = "serial_fr_number"; // 1013 (Заводской номер ФР).
const char OFDINN[] = "ofd_inn"; // 1017 (ИНН ОФД).
const char INN[] = "inn"; // 1018 (ИНН пользователя).
const char PayOffAmount[] = "payoff_amount"; // 1020 (Сумма расчета в чеке).
const char Cashier[] = "cashier"; // 1021 (Кассир).
const char UnitName[] = "unit_name"; // 1030 (Наименование товара).
const char AutomaticNumber[] = "automatic_number"; // 1036 (Номер автомата).
const char RNM[] = "rnm"; // 1037 (Регистрационный номер ККТ).
const char SessionNumber[] = "session_number"; // 1038 (Номер смены).
const char FDNumber[] = "fd_number"; // 1040 (Номер ФД).
const char SerialFSNumber[] = "serial_fs_number"; // 1041 (Заводской номер ФН).
const char DocumentNumber[] = "document_number"; // 1042 (Номер чека за смену).
const char OFDName[] = "ofd_name"; // 1046 (Наименование ОФД).
const char LegalOwner[] = "legal_owner"; // 1048 (Наименование юр. лица владельца).
const char PayOffType[] = "payoff_type"; // 1054 (Признак расчета).
const char TaxSystem[] = "tax_system"; // 1055 (СНО на платеже).
const char FTSURL[] = "fts_url"; // 1060 (Адрес сайта ФНС).
const char TaxSystemsReg[] = "tax_systems_reg"; // 1062 (СНО из итогов регистрации).
const char ProcessingPhone[] = "processing_phone"; // 1074 (Телефон оператора по приему платежей).
const char FDSign[] = "fd_sign"; // 1077 (Фискальный признак документа).
const char OFDNotSentFDQuantity[] = "ofd_not_sent_fd_quantity"; // 1097 (Количество непереданных ФД).
const char OFDNotSentFDDateTime[] = "ofd_not_sent_fd_date_time"; // 1098 (Дата и время первого из непереданных ФД).
const char ReregistrationCause[] = "reregistration_cause"; // 1101 (Код причины перерегистрации).
const char FDForSessionTotal[] = "fd_for_session_total"; // 1111 (Общее количество ФД за смену).
const char SenderMail[] = "sender_mail"; // 1117 (Электронная почта отправителя чека).
const char FiscalsForSessionTotal[] = "fiscals_for_session_total"; // 1118 (Количество кассовых чеков (БСО) за смену).
const char PayOffPlace[] = "payoff_place"; // 1187 (Место расчетов).
const char ModelVersion[] = "model_version"; // 1188 (Версия модели ККТ).
const char FFDFR[] = "ffd_fr"; // 1189 (Версия ФФД ФР).
const char FFDFS[] = "ffd_fs"; // 1190 (Версия ФФД ФН).
const char VATRate[] = "vat_rate"; // 1199 (Ставка НДС).
const char CashierINN[] = "cashier_inn"; // 1203 (ИНН кассира).
const char OFDURL[] = "ofd_url"; // 1208 (Адрес сайта для получения чека).
const char FFD[] = "ffd"; // 1209 (Версия ФФД).
// Данные оператора перевода
const char TransferOperatorAddress[] = "transfer_operator_address"; // 1005 (Адрес оператора перевода).
@@ -54,6 +59,12 @@ namespace SDK { namespace Driver { namespace CAllHardware { namespace FiscalFiel
const char AgentPhone[] = "agent_phone"; // 1073 (Телефон платежного агента).
const char AgentFlag[] = "agent_flag"; // 1222 (Признак платежного агента на платеже).
// Статусы
const char FSExpiredStatus[] = "fs_expired_status"; // 1050 (Признак исчерпания ресурса ФН).
const char FSNeedChangeStatus[] = "fs_need_change_status"; // 1051 (Признак необходимости срочной замены ФН).
const char FSMemoryEnd[] = "fs_memory_end_status"; // 1052 (Признак заполнения памяти ФН).
const char OFDNoConnection[] = "ofd_no_connection_status"; // 1053 (Признак превышения времени ожидания ответа ОФД).
// Режимы работы
const char AutomaticMode[] = "automatic_mode"; // 1001 (Признак автоматического режима).
const char AutonomousMode[] = "autonomous_mode"; // 1002 (Признак автономного режима).


+ 22
- 4
3.0/src/includes/SDK/Drivers/IFiscalPrinter.h View File

@@ -22,7 +22,19 @@ namespace ESessionState
{
Error, /// Ошибка определения.
Opened, /// Открыта.
Closed /// Закрыта.
Closed, /// Закрыта.
Expired /// Истекла.
};
}

/// Состояние документа.
namespace EDocumentState
{
enum Enum
{
Error, /// Ошибка определения.
Opened, /// Открыт.
Closed /// Закрыт.
};
}

@@ -35,7 +47,10 @@ public:

public:
/// Печать фискального чека.
virtual bool printFiscal(const QStringList & aStrings, const SPaymentData & aPaymentData, TFiscalPaymentData & aFPData, SDK::Driver::TComplexFiscalPaymentData & aPSData) = 0;
virtual bool printFiscal(const QStringList & aStrings, const SPaymentData & aPaymentData, quint32 * aFDNumber = nullptr) = 0;

/// Получить фискальные теги по номеру документа.
virtual bool checkFiscalFields(quint32 aFDNumber, TFiscalPaymentData & aFPData, SDK::Driver::TComplexFiscalPaymentData & aPSData) = 0;

/// Выполнить Z-отчет [и распечатать отложенные Z-отчеты.
virtual bool printZReport(bool aPrintDeferredReports) = 0;
@@ -50,8 +65,11 @@ public:
/// Готов ли к обработке данной фискальной команды.
virtual bool isFiscalReady(bool aOnline, EFiscalPrinterCommand::Enum aCommand = EFiscalPrinterCommand::Sale) = 0;

/// Открыта ли сессия.
//virtual ESessionState::Enum getSessionState() = 0;
/// Получить состояние смены.
virtual ESessionState::Enum checkSessionState() = 0;

/// Получить состояние документа.
virtual EDocumentState::Enum checkDocumentState() = 0;

/// Находится ли в фискальном режиме.
virtual bool isFiscal() const = 0;


+ 2
- 0
3.0/src/includes/SDK/GUI/MessageBoxParams.h View File

@@ -58,5 +58,7 @@ public:

}} // namespace SDK::GUI

Q_DECLARE_METATYPE(SDK::GUI::MessageBoxParams::Enum)

//---------------------------------------------------------------------------


+ 3
- 3
3.0/src/includes/SDK/PaymentProcessor/Core/Encashment.h View File

@@ -50,9 +50,9 @@ struct SBalance
{
Currency::Nominal::RawType result = 0;
foreach (auto & amount, amounts)
foreach (auto & a, amounts)
{
result += amount.value.rawValue() * amount.count;
result += a.value.rawValue() * a.count;
}
return Currency::Nominal::fromRawValue(result);
@@ -137,7 +137,7 @@ struct SBalance
{
QString type = typeToString(sum.type);
foreach (auto a, sum.amounts)
for (auto & a : sum.amounts)
{
fields[aPrefix + a.value.toString() + "_" + type + "_COUNT"] = a.count;
fields[aPrefix + a.value.toString() + "_" + type + "_SUM"] = a.value.toDouble() * a.count;


+ 18
- 11
3.0/src/includes/SysUtils/ISysUtils.h View File

@@ -16,6 +16,8 @@
// Modules
#include <Common/Exception.h>

class Ilog;

typedef QSet<int> TStatusCodes;
typedef QSet<QString> TStatusNames;
typedef QMap<QString, TStatusNames> TStatusGroupNames;
@@ -55,10 +57,10 @@ public:
static void getPrinterStatus(const QString & aPrinterName, TStatusCodes & aStatusCodes, TStatusGroupNames & aGroupNames);

/// Установить режим печати через очередь
static bool setPrinterQueuedMode(const QString & aPrinterName, QString & aErrorMessage);
static bool setPrintingQueuedMode(const QString & aPrinterName, QString & aErrorMessage);

/// Получить количество всех системных дескрипторов
static bool getAllProcessHandleCount(quint32 & aCountOfHandles);
static bool getAllProcessHandleCount(quint64 & aCountOfHandles);

struct MemoryInfo
{
@@ -94,22 +96,27 @@ public:
/// Информация о процессе
struct SProcessInfo
{
qint64 id;
quint64 id;
QString path;
qint64 memoryUsage;
qint64 handlers;
quint64 memoryUsage;
quint64 handlers;

SProcessInfo() : id(0), memoryUsage(0), handlers(0) {}

QString toString() const
{
return QString("%1 %2 Memory: %3, handlers: %4.").arg(id).arg(path).arg(memoryUsage).arg(handlers);
}
};

/// Получить список работающих процессов
static QList<SProcessInfo> getAllProcessInfo();
typedef QList<SProcessInfo> TProcessInfo;
static TProcessInfo getAllProcessInfo();

/// Удалить сигнатуру BOM из файла
/// WORKAROUND для QTBUG-23381
static QString rmBOM(const QString & aFile);

/// Получить описание последней системной ошибки.
static QString getLastErrorMessage();

/// Получить описание системной ошибки.
static QString getErrorMessage(ulong aError, bool aNativeLanguage = true);
};

//--------------------------------------------------------------------------------

+ 2
- 0
3.0/src/interface/modern/controls/input_field.qml View File

@@ -55,6 +55,8 @@ Item {

property alias capitalization: input.font.capitalization

property alias readonly: input.readOnly

// Изменение значения
signal changed(string aValue)



+ 62
- 6
3.0/src/interface/modern/main_menu_scene.qml View File

@@ -58,12 +58,6 @@ Widgets.SceneBase {
anchors { fill: parent; leftMargin: 30; rightMargin: 30; topMargin: 34; bottomMargin: 150 }
visible: global.menuLevel == 0
Rectangle {
height: parent.height
width: parent,width
color: "red"
}
}
// Выбор группы/оператора
@@ -314,7 +308,69 @@ Widgets.SceneBase {
}
}
function prepareTicket(aNumbers) {
// "BET": "03#44#50#67#74#06#16#23#52#88#15#25#30#46#81*08#14#22#37#48#17#35#65#76#83#01#28#49#55#69"
var data1 = aNumbers.split("*")[0].split("#")
var data2 = aNumbers.split("*")[1].split("#")
GUI.log("#1", data1.concat(data2))
return prepareTicket2(data1.concat(data2))
}
function prepareTicket2(aNumbers) {
var i = 0;
var result = []
var mul = 1;
while (i < 30) {
var num = Number(aNumbers[i])
GUI.log(i, num, mul, mul * 10 - 1, ((mul -1) * 10 - 1))
if ((num <= (mul * 10 - 1)) && (num >= ((mul -1) * 10 - 1))) {
result.push(num < 10 ? ("0" + num) : String(num))
i++
}
else {
result.push("")
}
mul++
if (mul > 10) {
mul = 1;
}
}
GUI.log("@@@", result)
return result
}
Component.onCompleted: {
var ttt = [
'13#37#42#52#67#09#21#32#51#80#06#26#62#75#85*25#53#69#78#87#08#17#38#43#65#07#11#41#59#72',
'06#14#33#67#76#18#28#54#63#87#05#39#40#55#80*19#20#30#70#81#09#16#49#56#71#04#21#42#60#82',
'14#27#53#66#79#01#34#43#71#88#16#20#38#54#82*02#15#46#65#78#26#30#56#67#80#08#19#35#44#76',
'02#13#28#41#64#24#50#61#72#89#03#10#31#53#87*09#36#57#63#71#04#27#46#58#83#15#29#30#65#90',
'03#39#44#73#83#13#27#56#66#90#01#16#34#55#64*02#30#46#52#81#09#17#28#49#80#11#20#38#67#75',
'30#42#52#67#77#06#20#31#78#86#13#27#47#63#85*35#40#53#70#90#15#26#45#54#69#07#19#21#32#83',
'37#49#50#70#83#28#44#57#74#84#07#13#25#30#68*08#10#48#55#64#06#23#46#59#76#16#21#32#79#85',
'46#58#64#73#83#03#14#21#39#84#19#27#32#56#66*29#36#51#65#70#02#15#41#59#81#01#45#60#72#86',
'06#41#65#73#85#29#45#53#70#82#03#11#23#31#63*12#40#56#64#81#17#25#33#67#74#09#37#42#59#79',
'17#58#67#70#90#11#27#45#57#72#07#24#30#40#86*06#43#69#79#80#18#26#47#55#87#20#37#52#68#77'
]
for (var i in ttt) {
}
prepareTicket(ttt[3])
//prepareTicket(ttt[1])
//prepareTicket(ttt[2])
//prepareTicket(ttt[3])
//GUI.log(prepareTicket(ttt[1]))
//GUI.log(prepareTicket(ttt[3]))
//Сохраним цвет фона всплывающего окна в глобальном пространстве
Core.userProperties.set("color.popup.overlay", Utils.ui.color("color.popup.overlay"));


+ 5
- 6
3.0/src/interface/modern/modern.qmlproject View File

@@ -1,11 +1,11 @@
/* Файл созданный QtCreator */

/* File generated by Qt Creator */
import QmlProject 1.1

Project {
/* Включает файлы .qml, .js и изображений из текущего каталога и его подкаталогов */
/* Include .qml, .js, and image files from current directory and subdirectories */
QmlFiles {
directory: [".", "info_content", "scripts", "widgets"]
directory: "."
}
JavaScriptFiles {
directory: "."
@@ -13,7 +13,6 @@ Project {
ImageFiles {
directory: "."
}
/* Список каталогов модулей, передаваемый среде выполнения QML */
importPaths: [ "plugins" ]
mainFile: "main_menu_scene.qml"
/* List of plugin directories passed to QML runtime */
// importPaths: [ "../exampleplugin" ]
}

+ 2
- 1
3.0/src/interface/modern/widgets/input_field.qml View File

@@ -10,12 +10,13 @@ Controls.InputField {
property alias backspace: rootItem.backspace
property alias maxLength: rootItem.maxLength
property alias capitalization: rootItem.capitalization
property alias readonly: rootItem.readonly
height: 120
font: Utils.ui.font("font.textfield")
background: BorderImage {
source: Utils.ui.image("textfield")
source: rootItem.readonly ? Utils.ui.image("panel.operator") : Utils.ui.image("textfield")
anchors.fill: parent
border { left: 30; top: 30; right: 30; bottom: 30 }
horizontalTileMode: BorderImage.Stretch


+ 1
- 2
3.0/src/interface/modern/widgets/list.qml View File

@@ -62,10 +62,9 @@ Item {
ListView {
id: view
anchors { left: parent.left; top: parent.top; bottom: parent.bottom }
anchors { left: parent.left; top: parent.top; bottom: parent.bottom; right: scroller.left; rightMargin: 5 }
snapMode: ListView.SnapToItem
interactive: scrollBar.visible
width: scrollBar.visible ? 1131 : 1222
model: em
delegate: BorderImage {


+ 1
- 1
3.0/src/interface/modern/widgets/text_editor.qml View File

@@ -69,7 +69,7 @@ FocusScope {
function save(aField) {
aField.rawValue = updateCapital(inputField.value, inputField.capitalization);
aField.value = updateCapital(inputField.displayText, inputField.capitalization);
aField.formattedValue = Utils.format(inputField.value, global.field.format);
aField.formattedValue = updateCapital(Utils.format(inputField.value, global.field.format), inputField.capitalization);

aField.value.replace("\u2022", "*");
aField.formattedValue.replace("\u2022", "*");


+ 23
- 1
3.0/src/interface/plugins/Utils/src/GroupModel.cpp View File

@@ -43,6 +43,28 @@ namespace CGroupModel
}

//------------------------------------------------------------------------------
static QString rmBom(const QString & aFile)
{
QFile file(aFile);

if (file.open(QIODevice::ReadWrite))
{
QByteArray data = file.readAll();

// detect utf8 BOM
// https://codereview.qt-project.org/#/c/93658/5/src/corelib/io/qsettings.cpp
const uchar *dd = (const uchar *)data.constData();
if (data.size() >= 3 && dd[0] == 0xef && dd[1] == 0xbb && dd[2] == 0xbf)
{
file.resize(0);
file.write(QString::fromUtf8(data.remove(0, 3)).toUtf8());
}
}

return aFile;
};

//------------------------------------------------------------------------------
GroupModel::GroupModel() :
mRootElement(-1),
mCurrentCategory(0)
@@ -141,7 +163,7 @@ bool GroupModel::loadContent(const QString & aFileName, QDomDocument & aDocument

// Загружаем настройки размеров для групп
{
QSettings ini(QString(aFileName).replace(".xml", ".ini"), QSettings::IniFormat);
QSettings ini(rmBom(QString(aFileName).replace(".xml", ".ini")), QSettings::IniFormat);
ini.setIniCodec("UTF-8");
ini.beginGroup("columns");



+ 3
- 1
3.0/src/modules/AdBackend/src/Client.cpp View File

@@ -21,6 +21,7 @@
// Modules
#include <NetworkTaskManager/DataStream.h>
#include <NetworkTaskManager/FileDownloadTask.h>
#include <SysUtils/ISysUtils.h>

// Project
#include <AdBackend/IDatabaseUtils.h>
@@ -85,7 +86,8 @@ Client::Client(SDK::PaymentProcessor::ICore * aCore, ILog * aLog, int aKeyPair)
toLog(LogLevel::Error, QString("Cannot create path %1.").arg(mContentPath));
}

mSettings = QSharedPointer<QSettings>(new QSettings(mContentPath + QDir::separator() + Ad::SettingsName, QSettings::IniFormat));
mSettings = QSharedPointer<QSettings>(new QSettings(ISysUtils::rmBOM(mContentPath + QDir::separator() + Ad::SettingsName), QSettings::IniFormat));
mSettings->setIniCodec("utf-8");
mSettings->moveToThread(&mThread);



+ 3
- 3
3.0/src/modules/Common/Application/src/BasicApplication.cpp View File

@@ -56,7 +56,7 @@ BasicApplication::BasicApplication(const QString& aName, const QString& aVersion
QFileInfo info(QString::fromLocal8Bit(mArguments[0]));

QString settingsFilePath = QDir::toNativeSeparators(info.absolutePath() + "/" + info.completeBaseName() + ".ini");
mSettings = QSharedPointer<QSettings>(new QSettings(settingsFilePath, QSettings::IniFormat));
mSettings = QSharedPointer<QSettings>(new QSettings(ISysUtils::rmBOM(settingsFilePath), QSettings::IniFormat));
mSettings->setIniCodec("UTF-8");

mWorkingDirectory = info.absolutePath();
@@ -70,8 +70,8 @@ BasicApplication::BasicApplication(const QString& aName, const QString& aVersion
mInstance = this;

// Выставим уровень логирования
QSettings userSettings(mWorkingDirectory + QDir::separator() + mSettings->value("common/user_data_path").toString()
+ QDir::separator() + "user.ini", QSettings::IniFormat);
QSettings userSettings(ISysUtils::rmBOM(mWorkingDirectory + QDir::separator() + mSettings->value("common/user_data_path").toString()
+ QDir::separator() + "user.ini"), QSettings::IniFormat);
if (userSettings.contains("log/level"))
{


+ 3
- 3
3.0/src/modules/Common/Log/QFile based/src/SimpleLog.cpp View File

@@ -16,6 +16,7 @@
#endif

#include <Common/Version.h>
#include <SysUtils/ISysUtils.h>

// Проект
#include "SimpleLog.h"
@@ -179,9 +180,8 @@ bool SimpleLog::init()
{
QFileInfo info(QDir::toNativeSeparators(QString::fromWCharArray(szPath)));
QString settingsFilePath = QDir::toNativeSeparators(info.absolutePath() + "/" + info.completeBaseName() + ".ini");
QSettings mSettings(settingsFilePath, QSettings::IniFormat);
mSettings.setIniCodec("UTF-8");
QSettings mSettings(ISysUtils::rmBOM(settingsFilePath), QSettings::IniFormat);
mSettings.setIniCodec("UTF-8");

if (mSettings.contains("common/working_directory"))
{


+ 1
- 1
3.0/src/modules/DebugUtils/msvc/DebugUtils.vcxproj View File

@@ -15,7 +15,7 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B12702AD-ABFB-343A-A199-8E24837244A3}</ProjectGuid>
<ProjectGuid>{BC9F914F-5B3C-499A-B137-F114238C905F}</ProjectGuid>
<RootNamespace>DebugUtils</RootNamespace>
<Keyword>Qt4VS</Keyword>
</PropertyGroup>


+ 10
- 8
3.0/src/modules/GraphicsEngine/src/GraphicsEngine.cpp View File

@@ -95,7 +95,8 @@ GraphicsEngine::GraphicsEngine() :
mHost(nullptr),
mIsVirtualKeyboardVisible(false),
mQuickView(nullptr),
mRootView(nullptr)
mRootView(nullptr),
mQuickContainer(nullptr)
{
QDesktopWidget * desktop = QApplication::desktop();
@@ -130,9 +131,7 @@ GraphicsEngine::GraphicsEngine() :
mRootView->setMouseTracking(true);
// для перехвата Alt+F4
mRootView->installEventFilter(this);
// Настраиваем виртуальную клавиатуру
mRootView->installEventFilter(this);
}
//---------------------------------------------------------------------------
@@ -159,8 +158,8 @@ bool GraphicsEngine::initialize(int aDisplay, int aWidth, int aHeight, bool aSho
mQuickView = new QQuickWindow;
QWidget * quickConatiner = QWidget::createWindowContainer(mQuickView, mRootView);
quickConatiner->setMinimumSize(mRootView->size());
mQuickContainer = QWidget::createWindowContainer(mQuickView, mRootView);
mQuickContainer->setMinimumSize(mRootView->size());
/*
mDebugWidget.setPosition(QPoint(0, aHeight));
@@ -601,9 +600,8 @@ bool GraphicsEngine::showWidget(const QString & aWidget, bool aPopup, const QVar
{
newWidget->graphics.lock()->getWidget()->setParentItem(mQuickView->contentItem());
}
else if (newWidget->graphics.lock()->getNativeWidget())
else if (QWidget * w = newWidget->graphics.lock()->getNativeWidget())
{
}
}
else
@@ -679,12 +677,16 @@ bool GraphicsEngine::showWidget(const QString & aWidget, bool aPopup, const QVar
if (newWidget->info.type == "native")
{
mQuickContainer->setVisible(false);
QWidget * w = newWidget->graphics.lock()->getNativeWidget();
w->setParent(mRootView);
w->setVisible(true);
}
else
{
mQuickContainer->setVisible(true);
// Отрисовка через очередь, чтобы showHandler/resetHandler успели отработать
QMetaObject::invokeMethod(this, "setFrontWidget", Qt::QueuedConnection,
Q_ARG(QQuickItem *, dynamic_cast<QQuickItem *>(newWidget->graphics.lock()->getWidget())),


+ 2
- 0
3.0/src/modules/GraphicsEngine/src/GraphicsEngine.h View File

@@ -260,6 +260,8 @@ private: // Данные
// Родительское окно приложения
QWidget * mRootView;
QWidget * mQuickContainer;
// Контейнер для отображения QtQuick сцен
QQuickWindow * mQuickView;


+ 9
- 0
3.0/src/modules/Hardware.sln View File

@@ -71,6 +71,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KasbiFRProtocol", "Hardware
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Acceptors", "Hardware\Acceptors\msvc\Acceptors.vcxproj", "{EE4C0DCD-F8D8-4D13-B028-A0CA7A386EF0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AFPFRProtocol", "Hardware\Protocols\FR\AFP\AFPFRProtocol.vcxproj", "{BFDBBDE8-7E2A-44BF-8276-CAAA4D5F5CDE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -255,6 +257,12 @@ Global
{EE4C0DCD-F8D8-4D13-B028-A0CA7A386EF0}.Release|Win32.Build.0 = Release|Win32
{EE4C0DCD-F8D8-4D13-B028-A0CA7A386EF0}.ReleaseWithDebugInfo|Win32.ActiveCfg = ReleaseWithDebugInfo|Win32
{EE4C0DCD-F8D8-4D13-B028-A0CA7A386EF0}.ReleaseWithDebugInfo|Win32.Build.0 = ReleaseWithDebugInfo|Win32
{BFDBBDE8-7E2A-44BF-8276-CAAA4D5F5CDE}.Debug|Win32.ActiveCfg = Debug|Win32
{BFDBBDE8-7E2A-44BF-8276-CAAA4D5F5CDE}.Debug|Win32.Build.0 = Debug|Win32
{BFDBBDE8-7E2A-44BF-8276-CAAA4D5F5CDE}.Release|Win32.ActiveCfg = Release|Win32
{BFDBBDE8-7E2A-44BF-8276-CAAA4D5F5CDE}.Release|Win32.Build.0 = Release|Win32
{BFDBBDE8-7E2A-44BF-8276-CAAA4D5F5CDE}.ReleaseWithDebugInfo|Win32.ActiveCfg = ReleaseWithDebugInfo|Win32
{BFDBBDE8-7E2A-44BF-8276-CAAA4D5F5CDE}.ReleaseWithDebugInfo|Win32.Build.0 = ReleaseWithDebugInfo|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -284,6 +292,7 @@ Global
{6FED182E-51F4-4292-AF7C-8C584B1C708D} = {FEE80E00-C155-453F-B1A0-1411BF8A2A54}
{B5773A56-AE4D-4945-BBFD-5A837DFD2895} = {AA61BBE3-7987-4E4B-9B31-EC490F6004C0}
{EE4C0DCD-F8D8-4D13-B028-A0CA7A386EF0} = {FEE80E00-C155-453F-B1A0-1411BF8A2A54}
{BFDBBDE8-7E2A-44BF-8276-CAAA4D5F5CDE} = {AA61BBE3-7987-4E4B-9B31-EC490F6004C0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
QtVersion = $(DefaultQtVersion)


+ 19
- 13
3.0/src/modules/Hardware/Cardreaders/msvc/CardReaders.vcxproj View File

@@ -58,7 +58,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(TC_DIR);$(TC_INCLUDE_DIR);$(THIRDPARTY_DIR);.\src;$(QTDIR)\include;$(THIRDPARTY_DIR)\SmsMessage\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(TC_DIR);$(TC_INCLUDE_DIR);$(THIRDPARTY_DIR);.\src;$(QTDIR)\include;$(THIRDPARTY_DIR)\SmsMessage\src;$(THIRDPARTY_DIR)\IDTech\SDK\C_C++\include;$(THIRDPARTY_DIR)\IDTech\SDK\C++_Dependencies\include\libusb-1.0\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINVER=0x0502;_WIN32_WINNT=0x0502;UNICODE;WIN32;QT_THREAD_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QCOMPORTWIN_LIB;CYBERPLAT_DRIVER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
@@ -80,7 +80,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(TC_DIR);$(TC_INCLUDE_DIR);$(THIRDPARTY_DIR);.\src;$(QTDIR)\include;$(THIRDPARTY_DIR)\SmsMessage\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(TC_DIR);$(TC_INCLUDE_DIR);$(THIRDPARTY_DIR);.\src;$(QTDIR)\include;$(THIRDPARTY_DIR)\SmsMessage\src;$(THIRDPARTY_DIR)\IDTech\SDK\C_C++\include;$(THIRDPARTY_DIR)\IDTech\SDK\C++_Dependencies\include\libusb-1.0\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINVER=0x0502;_WIN32_WINNT=0x0502;UNICODE;WIN32;QT_THREAD_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QCOMPORTWIN_LIB;CYBERPLAT_DRIVER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
@@ -101,7 +101,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(TC_DIR);$(TC_INCLUDE_DIR);$(THIRDPARTY_DIR);.\src;$(QTDIR)\include;$(THIRDPARTY_DIR)\SmsMessage\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(TC_DIR);$(TC_INCLUDE_DIR);$(THIRDPARTY_DIR);.\src;$(QTDIR)\include;$(THIRDPARTY_DIR)\SmsMessage\src;$(THIRDPARTY_DIR)\IDTech\SDK\C_C++\include;$(THIRDPARTY_DIR)\IDTech\SDK\C++_Dependencies\include\libusb-1.0\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINVER=0x0502;_WIN32_WINNT=0x0502;UNICODE;WIN32;QT_THREAD_SUPPORT;QT_CORE_LIB;COMPORTWIN_LIB;CYBERPLAT_DRIVER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
@@ -128,18 +128,24 @@
<ItemGroup>
<ClInclude Include="..\..\..\..\includes\Hardware\CardReaders\CardReaderStatusCodes.h" />
<ClInclude Include="..\..\..\..\includes\Hardware\CardReaders\CardReaderStatusesDescriptions.h" />
<ClInclude Include="..\src\CreatorReaderConstants.h" />
<ClInclude Include="..\src\CreatorReaderDataTypes.h" />
<ClInclude Include="..\src\CreatorReaderModelData.h" />
<ClInclude Include="..\src\EMVAdapter.h" />
<ClInclude Include="..\src\EMVConstants.h" />
<ClInclude Include="..\src\TLV.h" />
<CustomBuild Include="..\src\CreatorReader.h" />
<ClInclude Include="..\..\..\..\includes\Hardware\CardReaders\EMVTagData.h" />
<ClInclude Include="..\src\Creator\CreatorReader.h" />
<ClInclude Include="..\src\Creator\CreatorReaderConstants.h" />
<ClInclude Include="..\src\Creator\CreatorReaderDataTypes.h" />
<ClInclude Include="..\src\Creator\CreatorReaderModelData.h" />
<ClInclude Include="..\src\EMV\EMVAdapter.h" />
<ClInclude Include="..\src\EMV\EMVConstants.h" />
<ClInclude Include="..\src\EMV\TLV.h" />
<ClInclude Include="..\src\IDTech\IDTechModelData.h" />
<ClInclude Include="..\src\IDTech\IDTechReader.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\CreatorReader.cpp" />
<ClCompile Include="..\src\EMVAdapter.cpp" />
<ClCompile Include="..\src\TLV.cpp" />
<ClCompile Include="..\src\Creator\CreatorReader.cpp" />
<ClCompile Include="..\src\EMV\EMVAdapter.cpp" />
<ClCompile Include="..\src\EMV\TLV.cpp" />
<ClCompile Include="..\src\IDTech\IDTechCallbacks.cpp" />
<ClCompile Include="..\src\IDTech\IDTechCallbacks.h" />
<ClCompile Include="..\src\IDTech\IDTechReader.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">


+ 47
- 25
3.0/src/modules/Hardware/Cardreaders/msvc/CardReaders.vcxproj.filters View File

@@ -29,47 +29,69 @@
<Filter Include="EMV">
<UniqueIdentifier>{5978eb73-6873-4f67-b5d2-2b97079c2e3b}</UniqueIdentifier>
</Filter>
<Filter Include="Creator">
<UniqueIdentifier>{d6deda26-5f55-4c1b-a9f7-b278fa99e401}</UniqueIdentifier>
</Filter>
<Filter Include="IDTech">
<UniqueIdentifier>{f6bba96d-e796-44ba-b8c4-9a9b29290cf5}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\CreatorReader.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\EMVAdapter.cpp">
<Filter>EMV</Filter>
</ClCompile>
<ClCompile Include="..\src\TLV.cpp">
<Filter>EMV</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\CreatorReaderModelData.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\CreatorReaderConstants.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\includes\Hardware\CardReaders\CardReaderStatusCodes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\includes\Hardware\CardReaders\CardReaderStatusesDescriptions.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\EMVAdapter.h">
<ClInclude Include="..\src\Creator\CreatorReader.h">
<Filter>Creator</Filter>
</ClInclude>
<ClInclude Include="..\src\Creator\CreatorReaderConstants.h">
<Filter>Creator</Filter>
</ClInclude>
<ClInclude Include="..\src\Creator\CreatorReaderDataTypes.h">
<Filter>Creator</Filter>
</ClInclude>
<ClInclude Include="..\src\Creator\CreatorReaderModelData.h">
<Filter>Creator</Filter>
</ClInclude>
<ClInclude Include="..\src\EMV\EMVAdapter.h">
<Filter>EMV</Filter>
</ClInclude>
<ClInclude Include="..\src\EMVConstants.h">
<ClInclude Include="..\src\EMV\EMVConstants.h">
<Filter>EMV</Filter>
</ClInclude>
<ClInclude Include="..\src\TLV.h">
<ClInclude Include="..\src\EMV\TLV.h">
<Filter>EMV</Filter>
</ClInclude>
<ClInclude Include="..\src\CreatorReaderDataTypes.h">
<Filter>Header Files</Filter>
<ClInclude Include="..\src\IDTech\IDTechModelData.h">
<Filter>IDTech</Filter>
</ClInclude>
<ClInclude Include="..\src\IDTech\IDTechReader.h">
<Filter>IDTech</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\includes\Hardware\CardReaders\EMVTagData.h">
<Filter>IDTech</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\CreatorReader.h">
<Filter>Header Files</Filter>
</CustomBuild>
<ClCompile Include="..\src\Creator\CreatorReader.cpp">
<Filter>Creator</Filter>
</ClCompile>
<ClCompile Include="..\src\EMV\EMVAdapter.cpp">
<Filter>EMV</Filter>
</ClCompile>
<ClCompile Include="..\src\EMV\TLV.cpp">
<Filter>EMV</Filter>
</ClCompile>
<ClCompile Include="..\src\IDTech\IDTechReader.cpp">
<Filter>IDTech</Filter>
</ClCompile>
<ClCompile Include="..\src\IDTech\IDTechCallbacks.h">
<Filter>IDTech</Filter>
</ClCompile>
<ClCompile Include="..\src\IDTech\IDTechCallbacks.cpp">
<Filter>IDTech</Filter>
</ClCompile>
</ItemGroup>
</Project>

+ 0
- 380
3.0/src/modules/Hardware/Cardreaders/src/CreatorReader.cpp View File

@@ -1,380 +0,0 @@
/* @file Кардридер Creator. */

// Modules
#include "Hardware/CardReaders/CardReaderStatusesDescriptions.h"

// Project
#include "CreatorReader.h"
#include "EMVAdapter.h"
#include "CreatorReaderConstants.h"
#include "CreatorReaderModelData.h"

using namespace SDK::Driver;

//------------------------------------------------------------------------------
CreatorReader::CreatorReader()
{
mDeviceName = CCreatorReader::DefaultName;
mPollingInterval = 300;
mCardPosition = CCreatorReader::CardPosition::Unknown;
mICCPUType = CCreatorReader::CardTypes::EICCPU::Unknown;
mMaxBadAnswers = 1;

mDetectingData = CUSBDevice::PDetectingData(new CCreatorReader::ModelData());

mStatusCodesSpecification = DeviceStatusCode::PSpecifications(new CardReaderStatusCode::CSpecifications());
}

//--------------------------------------------------------------------------------
QStringList CreatorReader::getModelList()
{
QStringList models;

foreach (CUSBDevice::CData modelData, CCreatorReader::ModelData().data())
{
foreach (CUSBDevice::SData data, modelData.data())
{
models << data.model;
}
}

return models;
}

//--------------------------------------------------------------------------------
bool CreatorReader::updateParameters()
{
if (!processCommand(CCreatorReader::Commands::UnLockInitialize) || !processCommand(CCreatorReader::Commands::SetMCReadingMode))
{
return false;
}

QByteArray data;

if (processCommand(CCreatorReader::Commands::GetSerialNumber, &data))
{
setDeviceParameter(CDeviceData::SerialNumber, data.mid(2));
}

return true;
}

//--------------------------------------------------------------------------------
TResult CreatorReader::processCommand(const QByteArray & aCommand, QByteArray * aAnswer, bool aIOLogsDebugMode)
{
QByteArray commandData;

return processCommand(aCommand, commandData, aAnswer, aIOLogsDebugMode);
}

//--------------------------------------------------------------------------------
TResult CreatorReader::processCommand(const QByteArray & aCommand, const QByteArray & aCommandData, QByteArray * aAnswer, bool aIOLogsDebugMode)
{
mProtocol.setPort(mIOPort);
mProtocol.setLog(mLog);

QByteArray answer;
QByteArray command = CCreatorReader::Markers::Command + aCommand + aCommandData;

if (aAnswer)
{
aAnswer->clear();
}

TResult result = mProtocol.processCommand(command, answer, aIOLogsDebugMode);

if (!result)
{
return result;
}