Browse Source

refs #1 Synchronize with release commit: b3308631a7

tags/3.14.0.202102201117
parent
commit
cb93ba6624
100 changed files with 1341 additions and 385 deletions
  1. +13
    -0
      3.0/scripts/build/runtimes/terminal_ru.xml
  2. +2
    -0
      3.0/src/apps/PaymentProcessor/src/Services/DeviceService.cpp
  3. +33
    -5
      3.0/src/apps/PaymentProcessor/src/Services/IntegratedDrivers.cpp
  4. +5
    -1
      3.0/src/apps/PaymentProcessor/src/Services/IntegratedDrivers.h
  5. +0
    -9
      3.0/src/apps/PaymentProcessor/src/Services/PluginService.cpp
  6. +1
    -0
      3.0/src/apps/PaymentProcessor/src/Services/PrintConstants.h
  7. +23
    -8
      3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.cpp
  8. +10
    -10
      3.0/src/apps/PaymentProcessor/src/Services/PrintingService.cpp
  9. +2
    -2
      3.0/src/apps/PaymentProcessor/src/Services/PrintingService.h
  10. +4
    -4
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_de.ts
  11. +4
    -4
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_en.ts
  12. +4
    -4
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_kk.ts
  13. +4
    -4
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_ru.ts
  14. +3
    -0
      3.0/src/includes/Common/ILog.h
  15. +3
    -0
      3.0/src/includes/Common/PluginConstants.h
  16. +20
    -19
      3.0/src/includes/Hardware/CashAcceptors/CashAcceptorStatusCodes.h
  17. +1
    -0
      3.0/src/includes/Hardware/CashAcceptors/CashAcceptorStatusesDescriptions.h
  18. +36
    -35
      3.0/src/includes/Hardware/CashDevices/CCTalkDeviceConstants.h
  19. +1
    -0
      3.0/src/includes/Hardware/Common/BaseStatusDescriptions.h
  20. +1
    -0
      3.0/src/includes/Hardware/Common/CodecDescriptions.h
  21. +8
    -0
      3.0/src/includes/Hardware/Common/DeviceDataConstants.h
  22. +3
    -6
      3.0/src/includes/Hardware/Common/HardwareConstants.h
  23. +62
    -0
      3.0/src/includes/Hardware/Common/LimitedQueue.h
  24. +11
    -0
      3.0/src/includes/Hardware/Common/ModelData.h
  25. +2
    -1
      3.0/src/includes/Hardware/Common/ProtocolBase.h
  26. +1
    -0
      3.0/src/includes/Hardware/Common/SerialDeviceUtils.h
  27. +40
    -1
      3.0/src/includes/Hardware/FR/FRBaseConstants.h
  28. +6
    -4
      3.0/src/includes/Hardware/FR/FRErrorDescription.h
  29. +27
    -24
      3.0/src/includes/Hardware/FR/FRStatusCodes.h
  30. +5
    -2
      3.0/src/includes/Hardware/FR/FRStatusesDescriptions.h
  31. +1
    -0
      3.0/src/includes/Hardware/FR/ProtoAtolFR.h
  32. +1
    -0
      3.0/src/includes/Hardware/FR/ProtoShtrihFR.h
  33. +45
    -2
      3.0/src/includes/Hardware/Plugins/CommonParameters.h
  34. +4
    -2
      3.0/src/includes/Hardware/Printers/POSPrinterData.h
  35. +2
    -1
      3.0/src/includes/Hardware/Printers/PortPOSPrinters.h
  36. +8
    -7
      3.0/src/includes/Hardware/Printers/PortPrintersBase.h
  37. +4
    -0
      3.0/src/includes/Hardware/Printers/PrinterDevices.h
  38. +31
    -0
      3.0/src/includes/Hardware/Printers/Sam4sModels.h
  39. +1
    -0
      3.0/src/includes/Hardware/Protocols/Common/ProtocolNames.h
  40. +1
    -1
      3.0/src/includes/SDK/Drivers/FR/FiscalDataTypes.h
  41. +18
    -1
      3.0/src/includes/SDK/Drivers/HardwareConstants.h
  42. +30
    -1
      3.0/src/includes/SDK/Drivers/InteractionTypes.h
  43. +22
    -0
      3.0/src/includes/SDK/Drivers/PrintingModes.h
  44. +2
    -1
      3.0/src/includes/SDK/PaymentProcessor/Core/IPrinterService.h
  45. +58
    -57
      3.0/src/includes/SDK/PaymentProcessor/Payment/Parameters.h
  46. +6
    -5
      3.0/src/includes/SDK/PaymentProcessor/Payment/Step.h
  47. +4
    -3
      3.0/src/includes/SDK/PaymentProcessor/Scripting/Core.h
  48. +4
    -0
      3.0/src/includes/SDK/PaymentProcessor/Scripting/NetworkService.h
  49. +19
    -3
      3.0/src/includes/SDK/PaymentProcessor/Scripting/PaymentService.h
  50. +8
    -0
      3.0/src/includes/SDK/PaymentProcessor/Scripting/PrinterService.h
  51. +25
    -1
      3.0/src/includes/SDK/PaymentProcessor/Scripting/Settings.h
  52. +29
    -0
      3.0/src/includes/SDK/Plugins/ImportanceLevel.h
  53. +18
    -7
      3.0/src/includes/SDK/Plugins/PluginParameters.h
  54. +22
    -5
      3.0/src/includes/SysUtils/ISysUtils.h
  55. +1
    -1
      3.0/src/includes/SysUtils/SystemPrinterStatusCodes.h
  56. +1
    -0
      3.0/src/interface/modern/UpdateLocale.cmd
  57. +6
    -1
      3.0/src/interface/modern/addinfo_scene.qml
  58. +6
    -0
      3.0/src/interface/modern/addinfo_with_amount_scene.ini
  59. +187
    -0
      3.0/src/interface/modern/addinfo_with_amount_scene.qml
  60. BIN
      3.0/src/interface/modern/info_content/currency/KZT/200.00.png
  61. +21
    -8
      3.0/src/interface/modern/info_popup2.qml
  62. +8
    -0
      3.0/src/interface/modern/interface.ini
  63. +1
    -1
      3.0/src/interface/modern/locale/addinfo_scene_de.ts
  64. +1
    -1
      3.0/src/interface/modern/locale/addinfo_scene_en.ts
  65. +1
    -1
      3.0/src/interface/modern/locale/addinfo_scene_kk.ts
  66. +1
    -1
      3.0/src/interface/modern/locale/addinfo_scene_ru.ts
  67. +22
    -0
      3.0/src/interface/modern/locale/addinfo_with_amount_scene_de.ts
  68. +22
    -0
      3.0/src/interface/modern/locale/addinfo_with_amount_scene_en.ts
  69. +22
    -0
      3.0/src/interface/modern/locale/addinfo_with_amount_scene_kk.ts
  70. +22
    -0
      3.0/src/interface/modern/locale/addinfo_with_amount_scene_ru.ts
  71. +8
    -3
      3.0/src/interface/modern/locale/main_menu_scene_de.ts
  72. +8
    -3
      3.0/src/interface/modern/locale/main_menu_scene_en.ts
  73. +4
    -0
      3.0/src/interface/modern/locale/main_menu_scene_kk.ts
  74. +8
    -3
      3.0/src/interface/modern/locale/main_menu_scene_ru.ts
  75. +2
    -2
      3.0/src/interface/modern/locale/menu_scenario_de.ts
  76. +2
    -2
      3.0/src/interface/modern/locale/menu_scenario_en.ts
  77. +2
    -2
      3.0/src/interface/modern/locale/menu_scenario_kk.ts
  78. +2
    -2
      3.0/src/interface/modern/locale/menu_scenario_ru.ts
  79. +4
    -4
      3.0/src/interface/modern/locale/operator_selector_de.ts
  80. +4
    -4
      3.0/src/interface/modern/locale/operator_selector_en.ts
  81. +4
    -4
      3.0/src/interface/modern/locale/operator_selector_kk.ts
  82. +4
    -4
      3.0/src/interface/modern/locale/operator_selector_ru.ts
  83. +14
    -11
      3.0/src/interface/modern/locale/payment_scenario_de.ts
  84. +14
    -11
      3.0/src/interface/modern/locale/payment_scenario_en.ts
  85. +14
    -11
      3.0/src/interface/modern/locale/payment_scenario_kk.ts
  86. +14
    -11
      3.0/src/interface/modern/locale/payment_scenario_ru.ts
  87. +4
    -4
      3.0/src/interface/modern/locale/platru_menu_scene_de.ts
  88. +4
    -4
      3.0/src/interface/modern/locale/platru_menu_scene_en.ts
  89. +4
    -4
      3.0/src/interface/modern/locale/platru_menu_scene_kk.ts
  90. +4
    -4
      3.0/src/interface/modern/locale/platru_menu_scene_ru.ts
  91. +2
    -2
      3.0/src/interface/modern/locale/platru_select_provider_scene_de.ts
  92. +2
    -2
      3.0/src/interface/modern/locale/platru_select_provider_scene_en.ts
  93. +2
    -2
      3.0/src/interface/modern/locale/platru_select_provider_scene_kk.ts
  94. +2
    -2
      3.0/src/interface/modern/locale/platru_select_provider_scene_ru.ts
  95. +13
    -1
      3.0/src/interface/modern/main_menu_scene.qml
  96. +5
    -3
      3.0/src/interface/modern/platru_select_provider_scene.qml
  97. +4
    -3
      3.0/src/interface/modern/scenario/card_ucs_charge_scenario.js
  98. +12
    -3
      3.0/src/interface/modern/scenario/constants.js
  99. +146
    -20
      3.0/src/interface/modern/scenario/payment_scenario.js
  100. +9
    -0
      3.0/src/interface/modern/scene_with_context/operators/Stoloto/6x36/edit_payment_scene_6x36.ini

+ 13
- 0
3.0/scripts/build/runtimes/terminal_ru.xml View File

@@ -63,8 +63,18 @@
<!-- PCS plugin -->
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/payment_customizer_scenario.dll" target="plugins/plugins/payment_customizer_scenario.dll"/>

<!-- Плагин процессинга ЕСИА, компонент plugins -->
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/esia_auth.dll" target="plugins/plugins/esia_auth.dll"/>
<file source="{QBS_RESULT_PATH}/locale/esia_auth_ru.qm" target="locale/plugins/esia_auth_ru.qm"/>

<!-- Плагин для работы со шлюзом СТОЛОТО, компонент plugins -->
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/stoloto.dll" target="plugins/plugins/stoloto.dll"/>

<!-- Драйверы, компонент drivers -->
<file source="{QBS_RESULT_PATH}/plugins/drivers/fr.dll" target="drivers/plugins/drivers/fr.dll"/>
<file source="{THIRDPARTY_DIR}/atol5/nt-x86-msvc2015/fptr10.dll" target="drivers/plugins/drivers/fptr10.dll"/>
<file source="{THIRDPARTY_DIR}/atol5/nt-x86-msvc2015/msvcp140.dll" target="drivers/plugins/drivers/msvcp140.dll"/>
<file source="{THIRDPARTY_DIR}/atol5/settings/log_properties_template.txt" target="user/user/plugins/log_properties_template.txt"/>

<!-- Локализации исполняемых файлов -->
<file source="{QBS_RESULT_PATH}/locale/WatchService_ru.qm" target="locale/guard_ru.qm"/>
@@ -105,6 +115,9 @@
<!-- Интерфейс МТС -->
<directory source="src/runtimes/ru/dealers/_interface_mts" target="_interface_mts" recursive="true"/>

<!-- Интерфейс Планета24 Музей -->
<directory source="src/runtimes/ru/dealers/_interface_patriot_planeta24" target="_interface_patriot_planeta24" recursive="true"/>

<!-- ###################################################################################### -->

<!-- Token plugin -->


+ 2
- 0
3.0/src/apps/PaymentProcessor/src/Services/DeviceService.cpp View File

@@ -87,6 +87,8 @@ DeviceService::DeviceService(IApplication * aApplication)
mDeviceCreationOrder[DSDK::CComponents::Watchdog] = EDeviceCreationOrder::AtStart;
mDeviceCreationOrder[DSDK::CComponents::Health] = EDeviceCreationOrder::AtStart;

mIntegratedDrivers.setLog(mLog);

#ifdef TC_USE_TOKEN
mDeviceCreationOrder[DSDK::CComponents::Token] = EDeviceCreationOrder::AtStart;
#endif


+ 33
- 5
3.0/src/apps/PaymentProcessor/src/Services/IntegratedDrivers.cpp View File

@@ -1,6 +1,7 @@
/* @file Функционал работы с интегрированными драйверами. */

// Driver SDK
// SDK
#include <SDK/Plugins/ImportanceLevel.h>
#include <SDK/Drivers/HardwareConstants.h>

// Project
@@ -90,12 +91,15 @@ void IntegratedDrivers::checkDriverPath(QString & aDriverPath, const QVariantMap
}

QStringList paths = mData[aDriverPath].paths.toList();
QStringList errorLogs;

for (int i = 0; i < paths.size(); ++i)
{
TParameterList parameters = mDeviceManager->getDriverParameters(paths[i]);
QVariantMap config(aConfig);
QStringList logs;

for (auto jt = aConfig.begin(); jt != aConfig.end(); ++jt)
for (QVariantMap::iterator jt = config.begin(); jt != config.end(); ++jt)
{
auto parameterIt = std::find_if(parameters.begin(), parameters.end(), [&] (const SPluginParameter & aParameter) -> bool
{ return aParameter.name == jt.key(); });
@@ -105,22 +109,46 @@ void IntegratedDrivers::checkDriverPath(QString & aDriverPath, const QVariantMap
SPluginParameter & parameter = *parameterIt;
QList<QVariant> & possibleValueValues = parameter.possibleValues.values();
QList<QString> & possibleValueKeys = parameter.possibleValues.keys();
const QVariant & value = jt.value();
QVariant & value = jt.value();

if (!parameter.readOnly && !possibleValueValues.contains(value) && (value != CHardwareSDK::Values::Auto) && !possibleValueKeys.contains(CHardwareSDK::Mask))
{
paths.removeAt(i--);
QStringList logData;

break;
foreach (const QVariant & data, possibleValueValues)
{
logData << data.toString();
}

if (value.toInt() && (parameter.importanceLevel < SDK::Plugin::EImportanceLevel::High))
{
toLog(LogLevel::Normal, QString("%1, %2: %3 -> %4 {%5}").arg(paths[i]).arg(parameter.name).arg(value.toString()).arg(parameter.defaultValue.toString()).arg(logData.join(", ")));
value = parameter.defaultValue;
}
else
{
logs << QString("%1: no %2 in {%3}").arg(parameter.name).arg(value.toString()).arg(logData.join(", "));
}
}
}
}

if (!logs.isEmpty())
{
errorLogs << QString("%1:\n\t%2").arg(paths[i]).arg(logs.join("\n\t"));

paths.removeAt(i--);
}
}

if (!paths.isEmpty())
{
aDriverPath = paths[0];
}
else
{
toLog(LogLevel::Error, "Failed to filter plugin:\n" + errorLogs.join("\n"));
}
}

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


+ 5
- 1
3.0/src/apps/PaymentProcessor/src/Services/IntegratedDrivers.h View File

@@ -2,10 +2,14 @@

#pragma once

// Common
#include <SDK/Drivers/IDevice.h>

// Modules
#include "DeviceManager/DeviceManager.h"

//------------------------------------------------------------------------------
class IntegratedDrivers
class IntegratedDrivers: public ILogable
{
public:
typedef QSet<QString> TPaths;


+ 0
- 9
3.0/src/apps/PaymentProcessor/src/Services/PluginService.cpp View File

@@ -315,15 +315,6 @@ void PluginService::verifyPlugins()
eventService->sendEvent(SDK::PaymentProcessor::Event(SDK::PaymentProcessor::EEventType::Warning, getName(),
QString("Unsigned : {%1}").arg(mUnsignedPlugins.join(";"))));
}

QStringList signedKeys = mSignedPlugins.keys();
signedKeys.removeDuplicates();

foreach(QString signerName, signedKeys)
{
eventService->sendEvent(SDK::PaymentProcessor::Event(SDK::PaymentProcessor::EEventType::Warning, getName(),
QString("Signed by %1 : {%2}").arg(signerName).arg(QStringList(mSignedPlugins.values(signerName)).join(";"))));
}
}
catch (SDK::PaymentProcessor::ServiceIsNotImplemented & e)
{


+ 1
- 0
3.0/src/apps/PaymentProcessor/src/Services/PrintConstants.h View File

@@ -22,6 +22,7 @@ namespace CPrintConstants
const char * const DealerVAT = "DEALER_NDS";
const char * const DealerAgentFlag = "DEALER_AGENT_FLAG";
const char * const DealerTaxSystem = "DEALER_SNO";
const char * const FiscalData = "FISCAL_DATA";
const char * const MtRegistrationAddress = "MT_REGISTRATION_ADDRESS";
const char * const PointAddress = "POINT_ADDRESS";
const char * const PointName = "POINT_NAME";


+ 23
- 8
3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.cpp View File

@@ -114,6 +114,7 @@ DSDK::SPaymentData PrintFiscalCommand::getPaymentData(const QVariantMap & aParam
if (dealerVAT == 0 && combineFeeWithZeroVAT)
{
fee = aParameters.value("FEE").toDouble();

if (!qFuzzyIsNull(fee))
{
QString dealerINN = aParameters.value(CPrintConstants::DealerInn).toString();
@@ -200,7 +201,7 @@ bool PrintFiscalCommand::getFiscalInfo(QVariantMap & aParameters, QStringList &
{
PPSDK::IFiscalRegister * fr = mService->getFiscalRegister();

if (!fr || !fr->hasCapability(PPSDK::ERequestType::Receipt) || !fr->isReady(PPSDK::ERequestType::Receipt))
if (!fr || !fr->hasCapability(PPSDK::ERequestType::Receipt))
{
return false;
}
@@ -215,7 +216,8 @@ bool PrintFiscalCommand::getFiscalInfo(QVariantMap & aParameters, QStringList &
if (!OK)
{
fiscalPaymentData = getPaymentData(aParameters);
auto fiscalParameters = fr->createFiscalTicket(paymentId, aParameters, fiscalPaymentData, aWaitResult);
bool waitResult = aWaitResult && fr->isReady(PPSDK::ERequestType::Receipt);
auto fiscalParameters = fr->createFiscalTicket(paymentId, aParameters, fiscalPaymentData, waitResult);

if (!aWaitResult)
{
@@ -275,19 +277,32 @@ bool PrintPayment::print(DSDK::IPrinter * aPrinter, const QVariantMap & aParamet
KKMSerialNumber = configuration[CHardwareSDK::SerialNumber].toString();
}

QVariantMap actualParameters = aParameters;
actualParameters.insert(CPrintConstants::KKM::SerialNumber, KKMSerialNumber);
actualParameters.insert("ONLINE_KKM", onlineKKM ? 1 : 0);

QStringList receipt = mService->getReceipt(mReceiptTemplate, actualParameters);

QVariantMap parameters = QVariantMap(aParameters).unite(getPrintingParameters(aPrinter));
QStringList fiscalPart;

bool hasFiscalInfo = getFiscalInfo(parameters, fiscalPart, true);

QVariantMap actualParameters = aParameters;
actualParameters.insert(CPrintConstants::KKM::SerialNumber, KKMSerialNumber);
actualParameters.insert("ONLINE_KKM", onlineKKM ? 1 : 0);
actualParameters.insert(CPrintConstants::FiscalData, int(hasFiscalInfo));
QStringList receipt = mService->getReceipt(mReceiptTemplate, actualParameters);

if (hasFiscalInfo)
{
QString pointAddress = parameters[CPrintConstants::PointAddress].toString();

if (std::find_if(receipt.begin(), receipt.end(), [&pointAddress] (const QString & line) -> bool { return line.contains(pointAddress); }) != receipt.end())
{
foreach (const QString & line, fiscalPart)
{
if (line.contains(pointAddress))
{
fiscalPart.removeAll(line);
}
}
}

receipt.append(fiscalPart);
}



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

@@ -74,7 +74,7 @@ PrintingService::PrintingService(IApplication * aApplication) :
mApplication(aApplication),
mDatabaseUtils(nullptr),
mDeviceService(nullptr),
mContinuousMode(false),
mPrintingMode(DSDK::EPrintingModes::None),
mServiceOperation(false),
mRandomReceiptsID(false),
mNextReceiptIndex(1),
@@ -225,9 +225,9 @@ bool PrintingService::canPrintReceipt(const QString & aReceiptType, bool aRealCh
}

//---------------------------------------------------------------------------
int PrintingService::printReceipt(const QString & aReceiptType, const QVariantMap & aParameters, const QString & aReceiptTemplate, bool aContinuousMode, bool aServiceOperation)
int PrintingService::printReceipt(const QString & aReceiptType, const QVariantMap & aParameters, const QString & aReceiptTemplate, DSDK::EPrintingModes::Enum aPrintingMode, bool aServiceOperation)
{
mContinuousMode = aContinuousMode;
mPrintingMode = aPrintingMode;
mServiceOperation = aServiceOperation;

QStringList receiptTemplates;
@@ -271,7 +271,7 @@ void PrintingService::printEmptyReceipt(int aJobIndex, bool aError)
//---------------------------------------------------------------------------
bool PrintingService::printReceiptDirected(DSDK::IPrinter * aPrinter, const QString & aReceiptTemplate, const QVariantMap & aParameters)
{
mContinuousMode = false;
mPrintingMode = DSDK::EPrintingModes::None;

// Извлекаем шаблон для чека нужного типа.
if (!mCachedReceipts.contains(aReceiptTemplate.toLower()))
@@ -284,7 +284,7 @@ bool PrintingService::printReceiptDirected(DSDK::IPrinter * aPrinter, const QStr
printCommand->setReceiptTemplate(aReceiptTemplate);

QVariantMap configuration;
configuration.insert(CHardwareSDK::Printer::ContinuousMode, mContinuousMode);
configuration.insert(CHardwareSDK::Printer::PrintingMode, mPrintingMode);
configuration.insert(CHardwareSDK::Printer::ServiceOperation, mServiceOperation);
aPrinter->setDeviceConfiguration(configuration);

@@ -338,7 +338,7 @@ int PrintingService::performPrint(PrintCommand * aCommand, const QVariantMap & a
}

QVariantMap configuration;
configuration.insert(CHardwareSDK::Printer::ContinuousMode, mContinuousMode);
configuration.insert(CHardwareSDK::Printer::PrintingMode, mPrintingMode);
configuration.insert(CHardwareSDK::Printer::ServiceOperation, mServiceOperation);
configuration.insert(CHardwareSDK::Printer::ReceiptTemplate, aReceiptTemplate);
printer->setDeviceConfiguration(configuration);
@@ -1549,7 +1549,7 @@ void PrintingService::createFiscalRegister()

if (!frPlugin)
{
toLog(LogLevel::Error, QString("FR %1 not have IFiscalRegister interface.").arg(fr));
toLog(LogLevel::Error, QString("FR %1 does not have IFiscalRegister interface.").arg(fr));
pluginLoader->destroyPlugin(plugin);
continue;
}
@@ -1558,7 +1558,7 @@ void PrintingService::createFiscalRegister()

if (parameters.isEmpty())
{
toLog(LogLevel::Warning, QString("FR %1 not have extensions settings. Skip it. (check config.xml).").arg(plugin->getPluginName()));
toLog(LogLevel::Warning, QString("FR %1 does not have extensions settings. Skip it. (check config.xml).").arg(plugin->getPluginName()));
pluginLoader->destroyPlugin(plugin);
continue;
}
@@ -1569,14 +1569,14 @@ void PrintingService::createFiscalRegister()
{
frPlugin->unsubscribe(PPSDK::IFiscalRegister::OFDNotSentSignal, this);

toLog(LogLevel::Warning, QString("FR %1 error initialize. Skip it.").arg(plugin->getPluginName()));
toLog(LogLevel::Warning, QString("FR %1 initialization is failed. Skip it.").arg(plugin->getPluginName()));
pluginLoader->destroyPlugin(plugin);
continue;
}

mFiscalRegister = frPlugin;

toLog(LogLevel::Normal, QString("FR %1 loaded successful.").arg(plugin->getPluginName()));
toLog(LogLevel::Normal, QString("FR %1 is loaded successful.").arg(plugin->getPluginName()));

break;
}


+ 2
- 2
3.0/src/apps/PaymentProcessor/src/Services/PrintingService.h View File

@@ -94,7 +94,7 @@ public:

/// Печать типизированного чека с параметрами aParameters. Возвращает индекс задания, поставленного в очередь.
/// Результат придёт в сигнале receiptPrinted.
virtual int printReceipt(const QString & aReceiptType, const QVariantMap & aParameters, const QString & aReceiptTemplate, bool aContinuousMode, bool aServiceOperation = false);
virtual int printReceipt(const QString & aReceiptType, const QVariantMap & aParameters, const QString & aReceiptTemplate, DSDK::EPrintingModes::Enum aPrintingMode, bool aServiceOperation = false);

/// Сохранение электронной версии типизированного чека с параметрами aParameters.
virtual void saveReceipt(const QVariantMap & aParameters, const QString & aReceiptTemplate);
@@ -237,7 +237,7 @@ private:
std::function<bool(int, PrintCommand *, QVariantMap)> mPrintingFunction;

/// Режим непрерывной печати чеков.
bool mContinuousMode;
DSDK::EPrintingModes::Enum mPrintingMode;
bool mServiceOperation;
bool mRandomReceiptsID;
mutable std::mt19937 mRandomGenerator;


+ 4
- 4
3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_de.ts View File

@@ -20,22 +20,22 @@
<context>
<name>PrintFiscalCommand</name>
<message>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<location filename="../Services/PrintingCommands.cpp" line="112"/>
<source>#dealer_bpa_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="116"/>
<location filename="../Services/PrintingCommands.cpp" line="129"/>
<source>#bank_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<location filename="../Services/PrintingCommands.cpp" line="112"/>
<source>#dealer_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="123"/>
<location filename="../Services/PrintingCommands.cpp" line="136"/>
<source>#processing_fee</source>
<translation type="unfinished"></translation>
</message>


+ 4
- 4
3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_en.ts View File

@@ -20,22 +20,22 @@
<context>
<name>PrintFiscalCommand</name>
<message>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<location filename="../Services/PrintingCommands.cpp" line="112"/>
<source>#dealer_bpa_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="116"/>
<location filename="../Services/PrintingCommands.cpp" line="129"/>
<source>#bank_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<location filename="../Services/PrintingCommands.cpp" line="112"/>
<source>#dealer_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="123"/>
<location filename="../Services/PrintingCommands.cpp" line="136"/>
<source>#processing_fee</source>
<translation type="unfinished"></translation>
</message>


+ 4
- 4
3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_kk.ts View File

@@ -20,22 +20,22 @@
<context>
<name>PrintFiscalCommand</name>
<message>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<location filename="../Services/PrintingCommands.cpp" line="112"/>
<source>#dealer_bpa_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="116"/>
<location filename="../Services/PrintingCommands.cpp" line="129"/>
<source>#bank_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<location filename="../Services/PrintingCommands.cpp" line="112"/>
<source>#dealer_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="123"/>
<location filename="../Services/PrintingCommands.cpp" line="136"/>
<source>#processing_fee</source>
<translation type="unfinished"></translation>
</message>


+ 4
- 4
3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_ru.ts View File

@@ -20,22 +20,22 @@
<context>
<name>PrintFiscalCommand</name>
<message>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<location filename="../Services/PrintingCommands.cpp" line="112"/>
<source>#dealer_bpa_fee</source>
<translation>Комиссия БПА</translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="116"/>
<location filename="../Services/PrintingCommands.cpp" line="129"/>
<source>#bank_fee</source>
<translation>Комиссия БПА</translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<location filename="../Services/PrintingCommands.cpp" line="112"/>
<source>#dealer_fee</source>
<translation>Комиссия субагента</translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="123"/>
<location filename="../Services/PrintingCommands.cpp" line="136"/>
<source>#processing_fee</source>
<translation>Комиссия КБ Платина</translation>
</message>


+ 3
- 0
3.0/src/includes/Common/ILog.h View File

@@ -69,6 +69,9 @@ public:
/// Устанавливает минимальный уровень, ниже которого логгирование игнорируется.
virtual void setLevel(LogLevel::Enum aLevel) = 0;

/// Возвращает минимальный уровень, ниже которого логгирование игнорируется.
virtual LogLevel::Enum getLevel() = 0;

/// Устанавливает уровень отступа для древовидных логов.
virtual void adjustPadding(int aStep) = 0;



+ 3
- 0
3.0/src/includes/Common/PluginConstants.h View File

@@ -7,6 +7,9 @@ namespace CPluginParameters
{
/// Общие константы.
const char PPVersion[] = "payment_processor_version";

/// Общие константы.
const char ConfigurationDirectory[] = "configuration_directory";
}

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

+ 20
- 19
3.0/src/includes/Hardware/CashAcceptors/CashAcceptorStatusCodes.h View File

@@ -70,25 +70,26 @@ namespace BillAcceptorStatusCode
{
const int JammedInValidator = 681; /// Зажевало купюру в валидаторе.
const int JammedInStacker = 682; /// Зажевало купюру в стекере.
const int StickInExitChannel = 683; /// Купюра застряла в выходном канале.
const int JammedCoin = 684; /// Застряла монета.
const int StackerFull = 685; /// Стекер полон.
const int StackerOpen = 686; /// Стекер открыт или вытащен.
const int HeadRemoved = 687; /// Убрана голова валидатора.
const int StackerMotor = 688; /// Неисправен мотор стекера.
const int TransportMotor = 689; /// Неисправен мотор конвейера.
const int AligningMotor = 690; /// Неисправен мотор механизма выравнивания.
const int SeparatingMotor = 691; /// Неисправен мотор сепаратора (для купюроприемников с несколькими стекерами).
const int Stacker = 692; /// Кассета неисправна.
const int Stacker1 = 693; /// Кассета1 неисправна.
const int Stacker2 = 694; /// Кассета2 неисправна.
const int Stacker3 = 695; /// Кассета3 неисправна.
const int Stacker4 = 696; /// Кассета4 неисправна.
const int ReturnMechanism = 697; /// Возвратный механизм поврежден.
const int COSMechanism = 698; /// Поврежден механизм защиты от ленточного мошенничества.
const int DCEChute = 699; /// Поврежден желоб одновременной подачи 2-х монет.
const int NoStackers = 700; /// Все кассеты либо сняты, либо запрещены к приему денег.
const int CoinGateStuck = 701; /// Заклинило задвижку приема монет.
const int JammedViaRejecting = 683; /// Замятие при выбросе купюры.
const int StickInExitChannel = 684; /// Купюра застряла в выходном канале.
const int JammedCoin = 685; /// Застряла монета.
const int StackerFull = 686; /// Стекер полон.
const int StackerOpen = 687; /// Стекер открыт или вытащен.
const int HeadRemoved = 688; /// Убрана голова валидатора.
const int StackerMotor = 689; /// Неисправен мотор стекера.
const int TransportMotor = 690; /// Неисправен мотор конвейера.
const int AligningMotor = 691; /// Неисправен мотор механизма выравнивания.
const int SeparatingMotor = 692; /// Неисправен мотор сепаратора (для купюроприемников с несколькими стекерами).
const int Stacker = 693; /// Кассета неисправна.
const int Stacker1 = 694; /// Кассета1 неисправна.
const int Stacker2 = 695; /// Кассета2 неисправна.
const int Stacker3 = 696; /// Кассета3 неисправна.
const int Stacker4 = 697; /// Кассета4 неисправна.
const int ReturnMechanism = 698; /// Возвратный механизм поврежден.
const int COSMechanism = 699; /// Поврежден механизм защиты от ленточного мошенничества.
const int DCEChute = 700; /// Поврежден желоб одновременной подачи 2-х монет.
const int NoStackers = 701; /// Все кассеты либо сняты, либо запрещены к приему денег.
const int CoinGateStuck = 702; /// Заклинило задвижку приема монет.
}

/// Неисправность датчиков. Ошибка, не ведет к потере денег.


+ 1
- 0
3.0/src/includes/Hardware/CashAcceptors/CashAcceptorStatusesDescriptions.h View File

@@ -126,6 +126,7 @@ namespace BillAcceptorStatusCode
/// Ошибка, при платеже может быть потеря денег в купюрнике.
ADD_CA_MECHANIC_FAILURE(JammedInValidator, QCoreApplication::translate("ValidatorStatuses", "#jammed_in_validator"));
ADD_CA_MECHANIC_FAILURE(JammedInStacker, QCoreApplication::translate("ValidatorStatuses", "#jammed_in_stacker"));
ADD_CA_MECHANIC_FAILURE(JammedViaRejecting, QCoreApplication::translate("ValidatorStatuses", "#jammed_via_rejecting"));
ADD_CA_MECHANIC_FAILURE(StickInExitChannel, QCoreApplication::translate("ValidatorStatuses", "#stick_in_exit_channel"));
ADD_CA_MECHANIC_FAILURE(JammedCoin, QCoreApplication::translate("ValidatorStatuses", "#jammed_coin"));
ADD_CA_MECHANIC_FAILURE(HeadRemoved, QCoreApplication::translate("ValidatorStatuses", "#validator_head_removed"));


+ 36
- 35
3.0/src/includes/Hardware/CashDevices/CCTalkDeviceConstants.h View File

@@ -42,43 +42,44 @@ namespace CCCTalk
namespace Command
{
/// Общие.
const uchar SimplePoll = 254;
const uchar VendorID = 246;
const uchar DeviceTypeID = 245;
const uchar ProductCode = 244;
const uchar BuildCode = 192;
const uchar SimplePoll = 254; // FE
const uchar VendorID = 246; // F6
const uchar DeviceTypeID = 245; // F5
const uchar ProductCode = 244; // F4
const uchar BuildCode = 192; // C0

/// Общие +.
const uchar Serial = 242;
const uchar SoftVersion = 241;
const uchar ProtocolID = 4;
const uchar Reset = 1;

const uchar Status = 248;
const uchar GetVariables = 247;
const uchar DBVersion = 243;
const uchar TestCoils = 240;
const uchar SelfCheck = 232;
const uchar PartialEnable = 231;
const uchar GetBufferedCoinStatuses = 229;
const uchar AllSetEnable = 228;
const uchar CreationDate = 196;
const uchar SoftLastDate = 195;
const uchar GetCoinID = 184;
const uchar SetSecurity = 181;
const uchar BaseYear = 170;
const uchar Dispense = 167;
const uchar GetHopperStatus = 166;
const uchar SetVariables = 165;
const uchar EnableHopper = 164;
const uchar TestHopper = 163;
const uchar ModifyInhibitsAndRegesters = 162;
const uchar GetBufferedBillStatuses = 159;
const uchar GetBillID = 157;
const uchar GetCountryScalingFactor = 156;
const uchar RouteBill = 154;
const uchar ModifyBillOperatingMode = 153;
const uchar GetCurrencyRevision = 145;
const uchar Serial = 242; // F2
const uchar SoftVersion = 241; // F1
const uchar ProtocolID = 4; // 04
const uchar Reset = 1; // 01

const uchar Status = 248; // F8
const uchar GetVariables = 247; // F7
const uchar DBVersion = 243; // F3
const uchar TestCoils = 240; // F0
const uchar SelfCheck = 232; // E8
const uchar PartialEnable = 231; // E7
const uchar GetBufferedCoinStatuses = 229; // E5
const uchar AllSetEnable = 228; // E4
const uchar CreationDate = 196; // C4
const uchar SoftLastDate = 195; // C3
const uchar SetPayoutCapacity = 187; // BB
const uchar GetCoinID = 184; // B8
const uchar SetSecurity = 181; // B7
const uchar BaseYear = 170; // AA
const uchar Dispense = 167; // A7
const uchar GetHopperStatus = 166; // A6
const uchar SetVariables = 165; // A5
const uchar EnableHopper = 164; // A4
const uchar TestHopper = 163; // A3
const uchar ModifyInhibitsAndRegesters = 162; // A2
const uchar GetBufferedBillStatuses = 159; // 9F
const uchar GetBillID = 157; // 9D
const uchar GetCountryScalingFactor = 156; // 9C
const uchar RouteBill = 154; // 9A
const uchar ModifyBillOperatingMode = 153; // 99
const uchar GetCurrencyRevision = 145; // 91

namespace EAnswerType
{


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

@@ -2,6 +2,7 @@

#pragma once

// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QSharedPointer>
#include <QtCore/QCoreApplication>


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

@@ -19,6 +19,7 @@ public:
static CustomKZTCodec customKZTCodec;
static CodecBase baseCodec;

APPEND_CODEC(UTF8, UTF-8);
APPEND_CODEC(CP850, IBM 850);
APPEND_CODEC(CP866, IBM 866);
APPEND_CODEC(Win1250, Windows-1250);


+ 8
- 0
3.0/src/includes/Hardware/Common/DeviceDataConstants.h View File

@@ -38,8 +38,13 @@ namespace CDeviceData
const char InternalFirmware[] = "device_id_key";
const char InternalHardware[] = "device_id_value";
const char ControllerBuild[] = "controller_build";
const char DriverConfig[] = "driver_config";
const char DriverTemplate[] = "driver_template";
const char DriverControlUnit[] = "driver_control_unit";
const char DriverLoader[] = "driver_loader";
const char Count[] = "count";
const char Number[] = "number";
const char LastNumber[] = "last_number";

/// Общие значения.
namespace Values
@@ -187,6 +192,9 @@ namespace CDeviceData
const char PaperSupply[] = "paper_supply";
const char Codes[] = "codes";
const char PNESensor[] = "pne_sensor";
const char CutterResource[] = "cutter_resource";
const char EngineResource[] = "engine_resource";
const char HeadResource[] = "head_resource";
}

/// Фискальные регистраторы


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

@@ -41,6 +41,7 @@ namespace CHardware
/// Кодировки.
namespace Codepages
{
const char UTF8[] = "UTF-8";
const char CP850[] = "CP858 (Western Europe)";
const char CP866[] = "CP866 (Cyrillic Russian)";
const char Win1250[] = "Win-1250 (Eastern & Central Europe)";
@@ -66,12 +67,6 @@ namespace CHardware
/// Константы COM-порта.
namespace COM
{
const char BaudRate[] = "baud_rate";
const char Parity[] = "parity";
const char ByteSize[] = "byte_size";
const char StopBits[] = "stop_bits";
const char RTS[] = "rts";
const char DTR[] = "dtr";
const char WaitResult[] = "wait_result";
const char ControlRemoving[] = "control_removing";
}
@@ -116,6 +111,7 @@ namespace CHardware
const char ProcessEnabling[] = "process_enabling";
const char ProcessDisabling[] = "process_disabling";
const char StackedFilter[] = "stacked_filter";
const char RejectingTimeout[] = "rejecting_timeout";
}

/// Константы виртуального устройства приема денег.
@@ -144,6 +140,7 @@ namespace CHardware
const char FeedingAmount[] = "feeding_amount";
const char NeedCutting[] = "need_cutting";
const char NeedSeparating[] = "need_separating";
const char NeedProcessing[] = "need_processing";
const char ByteString[] = "byte_string";
const char Receipt[] = "receipt";
const char PresenterEnable[] = "presenter_enable";


+ 62
- 0
3.0/src/includes/Hardware/Common/LimitedQueue.h View File

@@ -0,0 +1,62 @@
/* @file Лимитированная очередь элементов. */

#pragma once

// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QQueue>
#include <Common/QtHeadersEnd.h>

//--------------------------------------------------------------------------------
template <class T>
class LimitedQueue: public QQueue<T>
{
public:
LimitedQueue(): mSize(1) {}
LimitedQueue(int aSize): mSize(aSize) {}

/// Добавляет элемент в хвост очереди.
void enqueue(const T & aData)
{
QQueue<T>::enqueue(aData);

if (size() > mSize)
{
QQueue<T>::dequeue();
}
}

/// Получает 1-й элемент очереди с изъятием.
T dequeue()
{
return isEmpty() ? T() : QQueue::dequeue();
}

/// Получает 1-й элемент очереди.
const T & head()
{
if (isEmpty())
{
enqueue(T());
}

return QQueue<T>::first();
}

/// Получает последний элемент очереди.
T & last()
{
if (isEmpty())
{
enqueue(T());
}

return QQueue<T>::last();
}

protected:
/// Максимальный размер очереди.
int mSize;
};

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

3.0/src/includes/Hardware/CashAcceptors/ModelData.h → 3.0/src/includes/Hardware/Common/ModelData.h View File

@@ -22,6 +22,17 @@ struct SBaseModelData
};

//--------------------------------------------------------------------------------
template <class T>
class CBaseModelData : public CSpecification<T, SBaseModelData>
{
protected:
void add(const T & aDeviceId, const QString & aModel, bool aVerified = false, bool aUpdatable = false)
{
append(aDeviceId, SBaseModelData(aModel, aVerified, aUpdatable));
}
};

//--------------------------------------------------------------------------------
template<class T>
inline QStringList getModels()
{

+ 2
- 1
3.0/src/includes/Hardware/Common/ProtocolBase.h View File

@@ -15,9 +15,10 @@
#include <Common/ILogable.h>
#include <Common/SleepHelper.h>

// Modules
// Project
#include "Hardware/Common/CommandResults.h"
#include "Hardware/Protocols/Common/ProtocolUtils.h"
#include "Hardware/Protocols/Common/ProtocolNames.h"

//--------------------------------------------------------------------------------
class ProtocolBase : public ILogable


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

@@ -0,0 +1 @@
#include "../../../modules/Hardware/Common/src/Utils/Port/SerialDeviceUtils.h"

+ 40
- 1
3.0/src/includes/Hardware/FR/FRBaseConstants.h View File

@@ -72,6 +72,28 @@ namespace CFR
const char Fail[] = "__FAIL__"; /// Транспортная/протокольная ошибка.
}

/// Состояние сессии.
class CSessionState : public CDescription<SDK::Driver::ESessionState::Enum>
{
public:
CSessionState()
{
using namespace SDK::Driver;

append(ESessionState::Error, "error");
append(ESessionState::Opened, "opened");
append(ESessionState::Closed, "closed");
append(ESessionState::Expired, "expired");

setDefault("unknown");
}
};

static CSessionState SessionState;

/// Регэксп для проверки имени кассира: должны быть буквы.
const char CashierRegExpData[] = "[^a-zA-Zа-яА-Я]+";

/// ИНН.
namespace INN
{
@@ -116,6 +138,21 @@ namespace CFR
add(EFFD::F11, 128, "1.1");
}

EFFD::Enum getVersion(const QString & aDescription)
{
for (auto it = data().begin(); it != data().end(); ++it)
{
QString description = it->description.remove(ASCII::Dot).leftJustified(3, QChar(ASCII::Zero));

if (description.contains(aDescription))
{
return it.key();
}
}

return EFFD::Unknown;
}

private:
void add(EFFD::Enum aFFD, int aMaxUnitNameSize, const QString & aDescription)
{
@@ -183,6 +220,8 @@ namespace CFR
inline QString RNMToString(const QByteArray & aData, int aBase = 10) { return dataToString(aData, aBase, 16); } /// РНМ (1037)
inline QString INNToString(const QByteArray & aData, int aBase = 10) { return dataToString(aData, aBase, 10); } /// ИНН оператора перевода (1016)

typedef QString (* TFFFormatDataMethod)(const QByteArray & aData, int aBase);

/// Размеры номеров
const int FDSerialNumberSize = 4; /// Чек в смене (1042)
const int SessionNumberSize = 4; /// Смена (1038)
@@ -318,7 +357,7 @@ namespace CFR
append(Other, "ИНОЙ ПРЕДМЕТ РАСЧЕТА");
append(PropertyRight, "ИМУЩЕСТВЕННОЕ ПРАВО");
append(NonSalesIncome, "ВНЕРЕАЛИЗАЦИОННЫЙ ДОХОД");
append(InsuranceСontribution, "СТРАХОВЫЕ ВЗНОСЫ");
append(InsuranceContribution, "СТРАХОВЫЕ ВЗНОСЫ");
append(TradeTax, "ТОРГОВЫЙ СБОР");
append(ResortTax, "КУРОРТНЫЙ СБОР");
append(Deposit, "ЗАЛОГ");


+ 6
- 4
3.0/src/includes/Hardware/FR/FRErrorDescription.h View File

@@ -19,7 +19,8 @@ namespace FRError
FM, /// Фискальная память.
EKLZ, /// ЭКЛЗ.
FS, /// ФН.
SD /// Ошибка карты памяти.
SD, /// Ошибка карты памяти.
CashAcceptor /// Ошибка подключаемого купюроприемника.
};
}

@@ -33,7 +34,8 @@ namespace FRError
SData(const QString & aDescription, EType::Enum aType = EType::FR, bool aExtraData = false) : description(aDescription), type(aType), extraData(aExtraData) {}
};

class Data : public CSpecification<char, SData>
template <class T>
class Data : public CSpecification<T, SData>
{
public:
Data()
@@ -41,12 +43,12 @@ namespace FRError
setDefault(SData(QString::fromUtf8("Неизвестная"), EType::Unknown));
}

void add(char aKey, const char * aDescription, EType::Enum aType = EType::Unknown)
void add(T aKey, const char * aDescription, EType::Enum aType = EType::Unknown)
{
mBuffer.insert(aKey, SData(QString::fromUtf8(aDescription), aType));
}

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


+ 27
- 24
3.0/src/includes/Hardware/FR/FRStatusCodes.h View File

@@ -10,24 +10,25 @@ namespace FRStatusCode
/// Предупреждения.
namespace Warning
{
const int EKLZNearEnd = 250; /// ЭКЛЗ близка к заполнению.
const int FiscalMemoryNearEnd = 251; /// Фискальная память близка к заполнению.
const int NotFiscalized = 252; /// ККМ не фискализирована.
const int ZBufferFull = 253; /// Заполнен буффер Z-отчётов.
const int OFDNoConnection = 254; /// Нет связи с сервером ОФД.
const int FSNearEnd = 255; /// Срок действия ФН скоро кончится.
const int OFDData = 256; /// Ошибка данных ОФД в ФР.
const int FFDMismatch = 257; /// Несоответствие версий ФФД ФР и ФН.
const int FFDFR = 258; /// Необходимо обновить версию ФФД ФР.
const int FFDFS = 259; /// Необходимо обновить версию ФФД ФН.
const int FirmwareUpdating = 260; /// Невозможно включить автообновление прошивки.
const int WrongDealerTaxSystem = 261; /// Неверно настроена СНО (1! СНО в ФР).
const int WrongDealerAgentFlag = 262; /// Неверно настроен признак агента (1! признак агента в ФР).
const int WrongFiscalizationSettings = 263; /// Параметры фискализации некорректны.
const int WrongTaxOnPayment = 264; /// Неверная налоговая ставка на платеже.
const int NeedTimeSynchronization = 265; /// Необходима синхронизация с системным временем.
const int FSVirtualEnd = 266; /// Срок действия ФН должен был закончиться.
const int DealerSupportPhone = 267; /// Телефон техподдержки дилера некорректен.
const int EKLZNearEnd = 250; /// ЭКЛЗ близка к заполнению.
const int FiscalMemoryNearEnd = 251; /// Фискальная память близка к заполнению.
const int FRNotRegistered = 252; /// ККТ не зарегистрирована.
const int FSNotFiscalized = 253; /// ФН не фискализирована.
const int ZBufferFull = 254; /// Заполнен буффер Z-отчётов.
const int OFDNoConnection = 255; /// Нет связи с сервером ОФД.
const int FSNearEnd = 256; /// Срок действия ФН скоро кончится.
const int OFDData = 257; /// Ошибка данных ОФД в ФР.
const int FFDMismatch = 258; /// Несоответствие версий ФФД ФР и ФН.
const int FFDFR = 259; /// Необходимо обновить версию ФФД ФР.
const int FFDFS = 260; /// Необходимо обновить версию ФФД ФН.
const int FirmwareUpdating = 261; /// Невозможно включить автообновление прошивки.
const int WrongDealerTaxSystem = 262; /// Неверно настроена СНО (1! СНО в ФР).
const int WrongDealerAgentFlag = 263; /// Неверно настроен признак агента (1! признак агента в ФР).
const int WrongFiscalizationSettings = 264; /// Параметры фискализации некорректны.
const int WrongTaxOnPayment = 265; /// Неверная налоговая ставка на платеже.
const int NeedTimeSynchronization = 266; /// Необходима синхронизация с системным временем.
const int FSVirtualEnd = 267; /// Срок действия ФН должен был закончиться.
const int DealerSupportPhone = 268; /// Телефон техподдержки дилера некорректен.
}

/// Ошибки.
@@ -43,12 +44,14 @@ namespace FRStatusCode
const int FSEnd = 277; /// Срок действия ФН кончился.
const int NeedOFDConnection = 278; /// Необходимо подключение к серверу ОФД.
const int FS = 279; /// Ошибка ФН.
const int FSClosed = 280; /// ФН закрыт.
const int NoMoney = 281; /// Не хватает денег для какой-либо операции.
const int WrongDealerTaxSystem = 282; /// Неверно настроена СНО.
const int WrongDealerAgentFlag = 283; /// Неверно настроен признак агента.
const int CashierINN = 284; /// Неправильный ИНН кассира.
const int Taxes = 285; /// Налоговые ставки неверны.
const int NoFS = 280; /// ФН отсутствует.
const int FSClosed = 281; /// ФН закрыт.
const int FSOverflow = 282; /// Память ФН переполнена.
const int NoMoney = 283; /// Не хватает денег для какой-либо операции.
const int WrongDealerTaxSystem = 284; /// Неверно настроена СНО.
const int WrongDealerAgentFlag = 285; /// Неверно настроен признак агента.
const int Cashier = 286; /// Данные кассира неверны.
const int Taxes = 287; /// Налоговые ставки неверны.
}
}



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

@@ -24,7 +24,8 @@ namespace FRStatusCode
/// Предупреждения.
ADD_FR_WARNING(EKLZNearEnd, QCoreApplication::translate("FRStatuses", "#EKLZ_near_end"));
ADD_FR_WARNING(FiscalMemoryNearEnd, QCoreApplication::translate("FRStatuses", "#FM_near_end"));
ADD_FR_WARNING(NotFiscalized, QCoreApplication::translate("FRStatuses", "#FR_is_not_fiscalized"));
ADD_FR_WARNING(FRNotRegistered, QCoreApplication::translate("FRStatuses", "#FR_is_not_registered"));
ADD_FR_WARNING(FSNotFiscalized, QCoreApplication::translate("FRStatuses", "#FS_is_not_fiscalized"));
ADD_FR_WARNING(ZBufferFull, QCoreApplication::translate("FRStatuses", "#z_buffer_full"));
ADD_FR_WARNING(OFDNoConnection, QCoreApplication::translate("FRStatuses", "#ofd_no_connection"));
ADD_FR_WARNING(FSNearEnd, QCoreApplication::translate("FRStatuses", "#fs_near_end"));
@@ -52,11 +53,13 @@ namespace FRStatusCode
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(NoFS, QCoreApplication::translate("FRStatuses", "#no_fs"));
ADD_FR_ERROR(FSClosed, QCoreApplication::translate("FRStatuses", "#fs_closed"));
ADD_FR_ERROR(FSOverflow, QCoreApplication::translate("FRStatuses", "#fs_overflow"));
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"));
ADD_FR_ERROR(CashierINN, QCoreApplication::translate("FRStatuses", "#cashier_inn"));
ADD_FR_ERROR(Cashier, QCoreApplication::translate("FRStatuses", "#cashier"));
ADD_FR_ERROR(Taxes, QCoreApplication::translate("FRStatuses", "#taxes"));
}



+ 1
- 0
3.0/src/includes/Hardware/FR/ProtoAtolFR.h View File

@@ -0,0 +1 @@
#include "../../../modules/Hardware/FR/src/Atol/Proto/ProtoAtolFR.h"

+ 1
- 0
3.0/src/includes/Hardware/FR/ProtoShtrihFR.h View File

@@ -0,0 +1 @@
#include "../../../modules/Hardware/FR/src/Shtrih/Proto/ProtoShtrihFR.h"

+ 45
- 2
3.0/src/includes/Hardware/Plugins/CommonParameters.h View File

@@ -11,7 +11,6 @@

// Modules
#include "Hardware/Plugins/DevicePluginBase.h"
#include "Hardware/Protocols/Common/ProtocolNames.h"

// Project
#include "Hardware/Common/HardwareConstants.h"
@@ -127,7 +126,7 @@ inline TParameterList createSimpleNamedList(const QStringList & aModels, const Q

return TParameterList()
<< SPluginParameter(CHardwareSDK::ModelName, false, CPPT::ModelName, QString(), aDefault, aModels, true)
<< SPluginParameter(CHardwareSDK::InteractionType, true, CPPT::InteractionType, QString(), interactionType, QStringList() << interactionType)
<< SPluginParameter(CHardwareSDK::InteractionType, true, CPPT::InteractionType, QString(), interactionType, QStringList() << interactionType, false, SDK::Plugin::EImportanceLevel::High)
<< setModifiedValues("", modifiedValues)
<< setNormalPriority();
}
@@ -158,6 +157,28 @@ struct SNamedList<T1, DSDKIT::ItCOM>

//------------------------------------------------------------------------------
template <class T1>
struct SNamedList<T1, DSDKIT::ItExternalCOM>
{
TParameterList create(const QStringList & aModels, const QString & aDefault)
{
return createSimpleNamedList<T1>(aModels, aDefault)
<< SPluginParameter(CHardwareSDK::RequiredResource, SPluginParameter::Text, false, CPPT::RequiredResource, QString(), "Common.Driver.IOPort.System.COM", QVariantMap(), true);
}
};

//------------------------------------------------------------------------------
template <class T1>
struct SNamedList<T1, DSDKIT::ItExternalVCOM>
{
TParameterList create(const QStringList & aModels, const QString & aDefault)
{
return createSimpleNamedList<T1>(aModels, aDefault)
<< SPluginParameter(CHardwareSDK::RequiredResource, SPluginParameter::Text, false, CPPT::RequiredResource, QString(), "Common.Driver.IOPort.System.COM", QVariantMap(), true);
}
};

//------------------------------------------------------------------------------
template <class T1>
struct SNamedList<T1, DSDKIT::ItUSB>
{
TParameterList create(const QStringList & aModels, const QString & aDefault)
@@ -238,6 +259,28 @@ inline SPluginParameter setNormalPriority()
}

//------------------------------------------------------------------------------
/// Исключенные параметры.
inline SPluginParameter setExcludedParameters(const QStringList & aParameters)
{
return SPluginParameter(CHardwareSDK::ExcludedParameters, false, QString(), QString(), aParameters, aParameters, true);
}

//------------------------------------------------------------------------------
/// Исключенные параметры для устройства на COM-порту.
inline SPluginParameter setSerialPortExcludedParameters()
{
QStringList serialPortParameters = QStringList()
<< COMPortSDK::BaudRate
<< COMPortSDK::Parity
<< COMPortSDK::RTS
<< COMPortSDK::DTR
<< COMPortSDK::ByteSize
<< COMPortSDK::StopBits;

return setExcludedParameters(serialPortParameters);
}

//------------------------------------------------------------------------------
/// Модифицированные имена ключей.
inline SPluginParameter setModifiedKeys(const QString & aOldParameterName, const QString & aNewParameterName)
{


+ 4
- 2
3.0/src/includes/Hardware/Printers/POSPrinterData.h View File

@@ -18,6 +18,7 @@ namespace CPOSPrinter
namespace Command
{
const char GetModelId[] = "\x1D\x49\x01"; /// Получение идентификатора модели.
const char GetModelIdIII[] = "\x1D\x49\xFF"; /// Получение идентификатора модели серии III.
const char GetTypeId[] = "\x1D\x49\x02"; /// Получение идентификатора типа модели.
const char GetROMVersion[] = "\x1D\x49\x03"; /// Получение версии прошивки.
const char Initialize[] = "\x1B\x40"; /// Инициализация.
@@ -33,6 +34,7 @@ namespace CPOSPrinter
const char Cut[] = "\x1B\x69"; /// Отрезка.
const char PrintImage[] = "\x1D\x76\x30"; /// Печать картинки.
const char AlignLeft[] = "\x1B\x61\x30"; /// Выравнивание по левому краю.
const char SetNarrowFont[] = "\x1B\xC1\x01"; /// Установить узкий шрифт.

inline QByteArray GetStatus(char aStatusType) { return QByteArray("\x10\x04") + aStatusType; } /// Запрос статуса.
inline QByteArray SetCodePage(char aCodePage) { return QByteArray("\x1B\x74") + aCodePage; } /// Установка кодовой страницы.
@@ -73,8 +75,8 @@ namespace CPOSPrinter
/// Таймауты ожидания ответа на запрос, [мс].
namespace Timeouts
{
const int Status = 200; /// Статус.
const int Info = 1000; /// Информация о модели.
const int Status = 200; /// Статус.
const int Info = 200; /// Информация о модели.
}

/// Ожидание выхода из анабиоза, [мс].


+ 2
- 1
3.0/src/includes/Hardware/Printers/PortPOSPrinters.h View File

@@ -37,6 +37,7 @@ public:

//--------------------------------------------------------------------------------
typedef SerialPOSPrinter<POSPrinter<TSerialPrinterBase>> TSerialPOSPrinter;
typedef POSPrinter<TLibUSBPrinterBase> TLibUSBPOSPrinter;
typedef POSPrinter<TLibUSBPrinterBase> TLibUSBPOSPrinter;
typedef POSPrinter<TTCPPrinterBase> TTCPPOSPrinter;

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

+ 8
- 7
3.0/src/includes/Hardware/Printers/PortPrintersBase.h View File

@@ -1,4 +1,4 @@
/* @file Áŕçîâűĺ ďđčíňĺđű ń ďîđňîâűěč đĺŕëčçŕöč˙ěč ďđîňîęîëîâ. */
/* @file Базовые принтеры � портовыми реализациями протоколов. */

#pragma once

@@ -9,20 +9,21 @@ template <class T>
class SerialPrinterBase : public PortPrinterBase<T>
{
public:
/// Ďîëó÷ĺíčĺ ńďčńęŕ íŕńňđîĺę ďîđňŕ, íĺîá˙çŕňĺëüíűő äë˙ đĺäŕęňčđîâŕíč˙ ďîëüçîâŕňĺëĺě.
/// Пол�чение �пи�ка на�троек порта, необязательных для редактирования пользователем.
static QStringList getOptionalPortSettings()
{
return QStringList()
<< CHardware::Port::COM::Parity
<< CHardware::Port::COM::ByteSize
<< CHardware::Port::COM::StopBits
<< CHardware::Port::COM::RTS
<< CHardware::Port::COM::DTR;
<< COMPortSDK::Parity
<< COMPortSDK::ByteSize
<< COMPortSDK::StopBits
<< COMPortSDK::RTS
<< COMPortSDK::DTR;
}
};

//--------------------------------------------------------------------------------
typedef SerialPrinterBase<PrinterBase<SerialDeviceBase<PortPollingDeviceBase<ProtoPrinter>>>> TSerialPrinterBase;
typedef PortPrinterBase<PrinterBase<LibUSBDeviceBase<PortPollingDeviceBase<ProtoPrinter>>>> TLibUSBPrinterBase;
typedef PortPrinterBase<PrinterBase<TCPDeviceBase<PortPollingDeviceBase<ProtoPrinter>>>> TTCPPrinterBase;

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

+ 4
- 0
3.0/src/includes/Hardware/Printers/PrinterDevices.h View File

@@ -9,7 +9,10 @@
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Custom/CustomVKP/CustomVKP80.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Custom/CustomVKP/CustomVKP80III.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Custom/CustomPrinters.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Custom/CustomPrintersIII.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Custom/CustomTG2480H.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Custom/CustomTG2480HIII.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Epson/Sam4sEpsonPrinters.h"
#include "../../../../modules/Hardware/Printers/src/POSPrinters/Epson/EpsonEUT400.h"

#include "../../../../modules/Hardware/Printers/src/AV268/AV268.h"
@@ -20,3 +23,4 @@
#include "../../../../modules/Hardware/Printers/src/SwecoinTTP20XXBase/SwecoinTTP20XXBase.h"
#include "../../../../modules/Hardware/Printers/src/SystemPrinter/SystemPrinter.h"
#include "../../../../modules/Hardware/Printers/src/SystemPrinter/SystemPrinters.h"
#include "../../../../modules/Hardware/Printers/src/SystemPrinter/Sam4sPrinters.h"

+ 31
- 0
3.0/src/includes/Hardware/Printers/Sam4sModels.h View File

@@ -0,0 +1,31 @@
/* @file Модели принтеров Sam4s. */

#pragma once

//--------------------------------------------------------------------------------
/// Константы принтеров Sam4s.
namespace CSam4s
{
/// Модели.
namespace Models
{
const char Giant100[] = "Sam4s Giant-100";
const char GiantPro[] = "Sam4s Giant Pro";
const char Ellix10[] = "Sam4s Ellix 10";
const char Ellix20[] = "Sam4s Ellix 20";
const char Ellix20II[] = "Sam4s Ellix 20II";
const char Ellix30[] = "Sam4s Ellix 30";
const char Ellix32[] = "Sam4s Ellix 32";
const char Ellix35[] = "Sam4s Ellix 35";
const char Ellix37[] = "Sam4s Ellix 37";
const char Ellix40[] = "Sam4s Ellix 40";
const char Ellix40BM[] = "Sam4s Ellix 40 Blackmark";
const char Ellix42[] = "Sam4s Ellix 42";
const char Ellix45[] = "Sam4s Ellix 45";
const char Ellix50[] = "Sam4s Ellix 50";

const char Unknown[] = "Unknown Sam4s printer";
}
}

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

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

@@ -25,6 +25,7 @@ namespace ProtocolNames
{
const char ATOL2[] = "ATOL2";
const char ATOL3[] = "ATOL3";
const char ATOL5[] = "ATOL5";
const char Shtrih[] = "Shtrih";
const char PRIM[] = "PRIM";
const char SPARK[] = "SPARK";


+ 1
- 1
3.0/src/includes/SDK/Drivers/FR/FiscalDataTypes.h View File

@@ -143,7 +143,7 @@ namespace EPayOffSubjectTypes
Other, /// Иной
PropertyRight, /// Имущественное право
NonSalesIncome, /// Внереализационный доход
InsuranceСontribution, /// Страховой взнос
InsuranceContribution, /// Страховой взнос
TradeTax, /// Торговый сбор
ResortTax, /// Курортный сбор
Deposit /// Залог


+ 18
- 1
3.0/src/includes/SDK/Drivers/HardwareConstants.h View File

@@ -18,8 +18,10 @@ namespace CAllHardware
const char SystemName[] = "system_name";
const char SearchingType[] = "searching_type";
const char RequiredResource[] = "required_resource";
const char RequiredResourceParameters[] = "required_resource_parameters";
const char Existence[] = "existence";
const char InteractionType[] = "interaction_type";
const char ExcludedParameters[] = "excluded_parameters";
const char WaitUpdatingTimeout[] = "wait_updating_timeout";
const char OperatorPresence[] = "operator_presence";
const char FiscalServerPresence[] = "fiscal_server_presence";
@@ -28,6 +30,9 @@ namespace CAllHardware
const char SerialNumber[] = "serial_number";
const char CanOnline[] = "can_online";
const char LibraryVersion[] = "library_version";
const char PluginDirectory[] = "plugin_directory";
const char LogDirectory[] = "log_directory";
const char DataDirectory[] = "data_directory";

/// Значения настроек.
namespace Values
@@ -83,7 +88,7 @@ namespace CAllHardware
{
const char LineSize[] = "line_size";
const char ReceiptTemplate[] = "receipt_template";
const char ContinuousMode[] = "continuous_mode";
const char PrintingMode[] = "printing_mode";
const char ServiceOperation[] = "service_operation";
const char BlockTerminalOnError[] = "block_terminal_on_error";
const char OFDNotSentError[] = "ofd_not_sent_error";
@@ -102,6 +107,17 @@ namespace CAllHardware
/// Константы порта.
namespace Port
{
/// Константы COM-порта.
namespace COM
{
const char BaudRate[] = "baud_rate";
const char Parity[] = "parity";
const char ByteSize[] = "byte_size";
const char StopBits[] = "stop_bits";
const char RTS[] = "rts";
const char DTR[] = "dtr";
}

/// Константы TCP-порта.
namespace TCP
{
@@ -114,5 +130,6 @@ namespace CAllHardware
}} // SDK::Driver

namespace CHardwareSDK = SDK::Driver::CAllHardware;
namespace COMPortSDK = CHardwareSDK::Port::COM;

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

+ 30
- 1
3.0/src/includes/SDK/Drivers/InteractionTypes.h View File

@@ -2,6 +2,11 @@

#pragma once

// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QStringList>
#include <Common/QtHeadersEnd.h>

namespace SDK {
namespace Driver {

@@ -16,9 +21,33 @@ namespace CInteractionTypes
ADD_IT(OPOS)
ADD_IT(System)
ADD_IT(External)
ADD_IT(ExternalCOM)
ADD_IT(ExternalVCOM)
}

//---------------------------------------------------------------------------
/// Все типы взаимодействия.
const QStringList InteractionTypes = QStringList()
<< CInteractionTypes::COM
<< CInteractionTypes::USB
<< CInteractionTypes::LibUSB
<< CInteractionTypes::TCP
<< CInteractionTypes::OPOS
<< CInteractionTypes::System
<< CInteractionTypes::External
<< CInteractionTypes::ExternalCOM
<< CInteractionTypes::ExternalVCOM;

/// Типы взаимодействия, для которых требуется отдельное логгирование средствами ТК.
const QStringList LoggedInteractionTypes = QStringList()
<< CInteractionTypes::COM
<< CInteractionTypes::USB
<< CInteractionTypes::LibUSB;

/// Типы взаимодействия, для которых требуется отдельное логгирование средствами ТК.
const QStringList ExternalWithRRTypes = QStringList()
<< CInteractionTypes::ExternalCOM
<< CInteractionTypes::ExternalVCOM;

}} // SDK::Driver

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

+ 22
- 0
3.0/src/includes/SDK/Drivers/PrintingModes.h View File

@@ -0,0 +1,22 @@
/* @file Режимы печати. */

#pragma once

namespace SDK {
namespace Driver {

namespace EPrintingModes
{
enum Enum
{
None = 0,
Continuous,
Glue
};
};

}} // namespace SDK::Driver

namespace DSDK = SDK::Driver;

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

+ 2
- 1
3.0/src/includes/SDK/PaymentProcessor/Core/IPrinterService.h View File

@@ -13,6 +13,7 @@

// SDK
#include <SDK/Drivers/WarningLevel.h>
#include <SDK/Drivers/PrintingModes.h>

namespace SDK {
namespace Driver { class IPrinter; }
@@ -32,7 +33,7 @@ public:

/// Печать типизированного чека с параметрами aParameters. Возвращает индекс задания, поставленного в очередь.
/// Результат придёт в сигнале receiptPrinted.
virtual int printReceipt(const QString & aReceiptType, const QVariantMap & aParameters, const QString & aReceiptTemplate, bool aContinuousMode, bool aServiceOperation = false) = 0;
virtual int printReceipt(const QString & aReceiptType, const QVariantMap & aParameters, const QString & aReceiptTemplate, DSDK::EPrintingModes::Enum aPrintingMode, bool aServiceOperation = false) = 0;

/// Сохранение электронной версии типизированного чека с параметрами aParameters.
virtual void saveReceipt(const QVariantMap & aParameters, const QString & aReceiptTemplate) = 0;


+ 58
- 57
3.0/src/includes/SDK/PaymentProcessor/Payment/Parameters.h View File

@@ -8,67 +8,68 @@ namespace PaymentProcessor {
//------------------------------------------------------------------------------
namespace CPayment
{
namespace Parameters
{
/// Обязательные параметры.
const char ID[] = "ID";
const char Type[] = "PROCESSING_TYPE";
const char CreationDate[] = "CREATION_DATE";
const char LastUpdateDate[] = "LAST_UPDATE_DATE";
const char CompleteDate[] = "COMPLETE_DATE";
const char Provider[] = "PROVIDER";
const char Status[] = "STATUS";
const char Priority[] = "PRIORITY";
const char InitialSession[] = "INITIAL_SESSION";
const char Amount[] = "AMOUNT";
const char AmountAll[] = "AMOUNT_ALL";
const char CRC[] = "CRC";
const char Cheated[] = "CHEATED";
namespace Parameters
{
/// Обязательные параметры.
const char ID[] = "ID";
const char Type[] = "PROCESSING_TYPE";
const char CreationDate[] = "CREATION_DATE";
const char LastUpdateDate[] = "LAST_UPDATE_DATE";
const char CompleteDate[] = "COMPLETE_DATE";
const char Provider[] = "PROVIDER";
const char Status[] = "STATUS";
const char Priority[] = "PRIORITY";
const char InitialSession[] = "INITIAL_SESSION";
const char Amount[] = "AMOUNT";
const char AmountAll[] = "AMOUNT_ALL";
const char CRC[] = "CRC";
const char Cheated[] = "CHEATED";

/// Опциональные параметры.
const char Change[] = "CHANGE";
const char Fee[] = "FEE";
const char DealerFee[] = "DEALER_FEE";
const char ProcessingFee[] = "PROCESSING_FEE";
const char Session[] = "SESSION";
const char Step[] = "STEP";
const char ServerError[] = "SERVER_ERROR";
const char ServerResult[] = "SERVER_RESULT";
const char ErrorMessage[] = "ERROR_MESSAGE";
const char NumberOfTries[] = "NUMBER_OF_TRIES";
const char NextTryDate[] = "NEXT_TRY_DATE";
const char Signature[] = "SIGNATURE";
const char AddInfo[] = "ADDINFO";
const char TransactionId[] = "TRANSID";
const char AuthCode[] = "AUTHCODE";
const char Vat[] = "VAT";
/// Опциональные параметры.
const char Change[] = "CHANGE";
const char Fee[] = "FEE";
const char DealerFee[] = "DEALER_FEE";
const char ProcessingFee[] = "PROCESSING_FEE";
const char Session[] = "SESSION";
const char Step[] = "STEP";
const char ServerError[] = "SERVER_ERROR";
const char ServerResult[] = "SERVER_RESULT";
const char ErrorMessage[] = "ERROR_MESSAGE";
const char NumberOfTries[] = "NUMBER_OF_TRIES";
const char NextTryDate[] = "NEXT_TRY_DATE";
const char Signature[] = "SIGNATURE";
const char AddInfo[] = "ADDINFO";
const char AddFields[] = "ADD_FIELDS";
const char TransactionId[] = "TRANSID";
const char AuthCode[] = "AUTHCODE";
const char Vat[] = "VAT";

/*
PAY_TOOL = N – тип оплаты :
0 – наличные средства,
1 – по банковской карте, эмитированной Банком - парнером(«свои» карты),
2 – по банковской карте, не эмитированной Банком - парнером(«чужие» карты).
В случае если Контрагент, не являющийся банком, принимает платеж по
банковской карте, значение параметра PAY_TOOL = 2.
При отсутствии параметра значение принимается равным 0. */
const char PayTool[] = "PAY_TOOL";
/*
PAY_TOOL = N – тип оплаты :
0 – наличные средства,
1 – по банковской карте, эмитированной Банком - парнером(«свои» карты),
2 – по банковской карте, не эмитированной Банком - парнером(«чужие» карты).
В случае если Контрагент, не являющийся банком, принимает платеж по
банковской карте, значение параметра PAY_TOOL = 2.
При отсутствии параметра значение принимается равным 0. */
const char PayTool[] = "PAY_TOOL";

/// Вспомогательные параметры.
const char MinAmount[] = "MIN_AMOUNT";
const char MaxAmount[] = "MAX_AMOUNT";
const char MaxAmountAll[] = "MAX_AMOUNT_ALL";
const char AcceptAmount[] = "ACCEPT_AMOUNT";
const char ProviderFields[] = "PROVIDER_FIELDS";
const char ProviderFieldsExt[] = "PROVIDER_FIELDS_EXT";
const char ProviderFieldsDelimiter[] = "#";
const char ReceiptPrinted[] = "RECEIPT_PRINTED";
const char OriginalPayment[] = "ORIGINAL_PAYMENT";
const char BlockUpdateLimits[] = "BLOCK_UPDATE_LIMITS";
/// Вспомогательные параметры.
const char MinAmount[] = "MIN_AMOUNT";
const char MaxAmount[] = "MAX_AMOUNT";
const char MaxAmountAll[] = "MAX_AMOUNT_ALL";
const char AcceptAmount[] = "ACCEPT_AMOUNT";
const char ProviderFields[] = "PROVIDER_FIELDS";
const char ProviderFieldsExt[] = "PROVIDER_FIELDS_EXT";
const char ProviderFieldsDelimiter[] = "#";
const char ReceiptPrinted[] = "RECEIPT_PRINTED";
const char OriginalPayment[] = "ORIGINAL_PAYMENT";
const char BlockUpdateLimits[] = "BLOCK_UPDATE_LIMITS";

/// MNP
const char MNPGetewayIn[] = "GATEWAY_IN";
const char MNPGetewayOut[] = "GATEWAY_OUT";
}
/// MNP
const char MNPGetewayIn[] = "GATEWAY_IN";
const char MNPGetewayOut[] = "GATEWAY_OUT";
}
}

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


+ 6
- 5
3.0/src/includes/SDK/PaymentProcessor/Payment/Step.h View File

@@ -39,11 +39,12 @@ class EPaymentStep : public QObject
public:
enum Enum
{
DataCheck = 0, /// Проверка данных.
Pay, /// Создание транзакции платежа.
Status, /// Запрос статуса платежа.
GetStep, /// Запрос получения полей для следующего шага (multistage)
User = 255 /// Произвольный запрос для нестандартного платежа.
DataCheck = 0, /// Проверка данных.
AmountDataCheck,/// Проверка данных c деньгами
Pay, /// Создание транзакции платежа.
Status, /// Запрос статуса платежа.
GetStep, /// Запрос получения полей для следующего шага (multistage)
User = 255 /// Произвольный запрос для нестандартного платежа.
};
};



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

@@ -129,6 +129,10 @@ public slots:
signals:
void userPropertiesUpdated();

public:
/// Возвращает объект с пользовательскими настройками
QObject * getUserProperties();

protected:
/// Возвращает указатель на интерфейс работы с платежами.
QObject * getPayment();
@@ -160,9 +164,6 @@ protected:
/// Возвращает указатель на интерфейс работы с логом.
QObject * getLog();

/// Возвращает объект с пользовательскими настройками
QObject * getUserProperties();

private slots:
void onPostEvent(int aEvent, QVariant aParameters) const;



+ 4
- 0
3.0/src/includes/SDK/PaymentProcessor/Scripting/NetworkService.h View File

@@ -59,6 +59,7 @@ public slots:

/// Выполнение запроса POST на адрес aUrl с данными aData.
bool post(const QString & aUrl, const QString & aData);
bool post(const QString & aUrl, const QByteArray & aData, bool aBinary = true);

/// Получение статуса соединения.
bool isConnected();
@@ -82,6 +83,9 @@ signals:
/// Срабатывает при завершении запроса aRequest.
void complete(bool aError, QString aResult);

/// Срабатывает при завершении запроса aRequest.
void rawComplete(bool aError, QByteArray aResult);

/// Срабатывает при получении сигнала о состоянии соединения.
void connectionStatus();



+ 19
- 3
3.0/src/includes/SDK/PaymentProcessor/Scripting/PaymentService.h View File

@@ -132,7 +132,7 @@ class Provider : public QObject
Q_OBJECT

Q_PROPERTY(QString id READ getID CONSTANT)
Q_PROPERTY(QString gateway READ getCID CONSTANT)
Q_PROPERTY(QString gateway READ getCID CONSTANT)
Q_PROPERTY(QString type READ getType CONSTANT)
Q_PROPERTY(QString processorType READ getProcessorType CONSTANT)
Q_PROPERTY(QString name READ getName CONSTANT)
@@ -141,12 +141,17 @@ class Provider : public QObject
Q_PROPERTY(QString maxLimit READ getMaxLimit CONSTANT)
Q_PROPERTY(QString systemLimit READ getSystemLimit CONSTANT)
Q_PROPERTY(QObjectList fields READ getFields CONSTANT)
Q_PROPERTY(QVariantMap fieldsContext READ getFieldsContext CONSTANT)
Q_PROPERTY(bool cyberwalletShow READ getCyberwalletShow CONSTANT)
Q_PROPERTY(bool skipCheck READ getSkipCheck CONSTANT)
Q_PROPERTY(bool payOnline READ getPayOnline CONSTANT)
Q_PROPERTY(bool askForRetry READ getAskForRetry CONSTANT)
Q_PROPERTY(bool requirePrinter READ getRequirePrinter CONSTANT)
Q_PROPERTY(bool showAddInfo READ getShowAddInfo CONSTANT)
Q_PROPERTY(bool showCheckAddInfo READ getShowCheckAddInfo CONSTANT)
Q_PROPERTY(bool checkEsia READ getCheckEsia CONSTANT)
Q_PROPERTY(QString clientCard READ getClientCard CONSTANT)
Q_PROPERTY(QString keyPair READ getKeyPair CONSTANT)
Q_PROPERTY(QString externalDataHandler READ getExternalDataHandler CONSTANT)
Q_PROPERTY(QVariantMap receipts READ getReceipts CONSTANT)
Q_PROPERTY(QVariantMap receiptParameters READ getReceiptParameters CONSTANT)
@@ -155,7 +160,10 @@ public:
Provider(const SProvider & aProvider, QObject * aParent);

public slots:
bool isNull() const { return mProvider.id == -1 || mProvider.fields.isEmpty(); }
bool isNull() const
{
return mProvider.id == -1 || mProvider.fields.isEmpty();
}
/// Проверить согласование проверки номера и лимитов, получаемых с сервера
bool isCheckStepSettingsOK();
@@ -166,7 +174,7 @@ public slots:

private:
QString getID() const { return QString::number(mProvider.id); }
QString getCID() const { return QString::number(mProvider.cid); }
QString getCID() const { return QString::number(mProvider.cid); }
QString getType() const { return mProvider.type; }
QString getProcessorType() const { return mProvider.processor.type; }
QString getName() const { return mProvider.name; }
@@ -175,12 +183,17 @@ private:
QString getMaxLimit() const { return mProvider.limits.max; }
QString getSystemLimit() const { return mProvider.limits.system; }
QObjectList getFields();
QVariantMap getFieldsContext() const { return mProvider.fieldsContext; }
bool getCyberwalletShow() const { return QVariant(mProvider.terminalCyberwalletShow).toBool(); }
bool getSkipCheck() const { return mProvider.processor.skipCheck; }
bool getPayOnline() const { return mProvider.processor.payOnline; }
bool getAskForRetry() const { return mProvider.processor.askForRetry; }
bool getRequirePrinter() const { return mProvider.processor.requirePrinter; }
bool getShowAddInfo() const { return mProvider.processor.showAddInfo; }
bool getShowCheckAddInfo() const { return mProvider.processor.showCheckAddInfo; }
bool getCheckEsia() const { return mProvider.processor.checkEsia; }
QString getClientCard() const { return QString::number(mProvider.processor.clientCard); }
QString getKeyPair() const { return QString::number(mProvider.processor.keyPair); }
QString getExternalDataHandler() const { return mProvider.externalDataHandler; }
QVariantMap getReceipts() const { return mProvider.receipts; }
QVariantMap getReceiptParameters() const { return mProvider.receiptParameters; }
@@ -315,6 +328,9 @@ public slots:
/// Проверка введённых данных.
void check();

/// Выполенение проверки платежа в онлайне.
void processCheck();

/// Выполенение шага платежа в онлайне.
void processStep(int aStep);



+ 8
- 0
3.0/src/includes/SDK/PaymentProcessor/Scripting/PrinterService.h View File

@@ -9,6 +9,9 @@
#include <QtCore/QFutureSynchronizer>
#include <Common/QtHeadersEnd.h>

// SDK
#include <SDK/Drivers/PrintingModes.h>

namespace SDK {
namespace PaymentProcessor {

@@ -58,6 +61,11 @@ signals:
/// Срабатывает после проверки принтеров.
void printerChecked(bool aReady);

public:
/// Печать типизированного чека с параметрами aParameters.
/// Перегрузка со слотами не работает. Поэтому, так.
void printReceiptExt(const QString & aReceiptType, const QVariantMap & aParameters, const QString & aTemplate, DSDK::EPrintingModes::Enum aPrintingMode = DSDK::EPrintingModes::None);

protected:
void privateCheckPrinter();



+ 25
- 1
3.0/src/includes/SDK/PaymentProcessor/Scripting/Settings.h View File

@@ -13,6 +13,7 @@
#include <SDK/PaymentProcessor/Core/ISettingsService.h>
#include <SDK/PaymentProcessor/Settings/DealerSettings.h>
#include <SDK/PaymentProcessor/Settings/TerminalSettings.h>
#include <SDK/PaymentProcessor/Settings/ExtensionsSettings.h>
#include <SDK/PaymentProcessor/Settings/Directory.h>
namespace SDK {
@@ -162,6 +163,25 @@ private:
};
//------------------------------------------------------------------------------
class ExtensionsSettings : public QObject
{
Q_OBJECT
Q_PROPERTY(int fiscalServerWaitingTimeout READ getServerWaitingTimeout)
public:
ExtensionsSettings(ICore * mCore);
private:
int getServerWaitingTimeout() const
{
return mSettings->getSettings("FiscalClient").value("server_waiting_timeout").toInt();
}
private:
SDK::PaymentProcessor::ExtensionsSettings * mSettings;
};
//------------------------------------------------------------------------------
class SCommission : public QObject
{
Q_OBJECT
@@ -204,23 +224,27 @@ class Settings : public QObject
Q_PROPERTY(QObject * dealer READ getDealerSettings CONSTANT)
Q_PROPERTY(QObject * terminal READ getTerminalSettings CONSTANT)
Q_PROPERTY(QObject * extensions READ getTerminalExtensionsSettings CONSTANT)
public:
Settings(ICore * aCore)
: mCore(aCore),
mTerminalSettingsProxy(aCore),
mDealerSettingsProxy(aCore)
mDealerSettingsProxy(aCore),
mExtensionsSettingsProxy(aCore)
{
}
private:
QObject * getDealerSettings() { return &mDealerSettingsProxy; }
QObject * getTerminalSettings() { return &mTerminalSettingsProxy; }
QObject * getTerminalExtensionsSettings() { return &mExtensionsSettingsProxy; }
private:
ICore * mCore;
TerminalSettings mTerminalSettingsProxy;
DealerSettings mDealerSettingsProxy;
ExtensionsSettings mExtensionsSettingsProxy;
};
//------------------------------------------------------------------------------


+ 29
- 0
3.0/src/includes/SDK/Plugins/ImportanceLevel.h View File

@@ -0,0 +1,29 @@
/* @file Приоритет значимости параметров плагинов. Имеет значение при разрешении конфликтов при создании плагина,
если для одного имени устройства есть группа плагинов с пересекающимися свойствами. */

#pragma once

// Qt
#include <Common/QtHeadersBegin.h>
#include <QtCore/QMetaType>
#include <Common/QtHeadersEnd.h>

namespace SDK {
namespace Plugin {

//---------------------------------------------------------------------------
namespace EImportanceLevel
{
enum Enum
{
Low,
Normal,
High
};
}

}} // namespace SDK::Driver

Q_DECLARE_METATYPE(SDK::Plugin::EImportanceLevel::Enum);

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

+ 18
- 7
3.0/src/includes/SDK/Plugins/PluginParameters.h View File

@@ -2,6 +2,9 @