Browse Source

refs #1 Synchronize with release commit: 5949878c16

qt5
parent
commit
b51f30780c
9 changed files with 216 additions and 50 deletions
  1. +4
    -0
      3.0/src/includes/Hardware/Common/DeviceDataConstants.h
  2. +1
    -48
      3.0/src/includes/Hardware/FR/FRBaseConstants.h
  3. +53
    -0
      3.0/src/includes/Hardware/FR/FRDataTypes.h
  4. +1
    -0
      3.0/src/includes/Hardware/FR/FSSerialData.h
  5. +3
    -0
      3.0/src/modules/Hardware/FR/msvc/FR.vcxproj
  6. +12
    -0
      3.0/src/modules/Hardware/FR/msvc/FR.vcxproj.filters
  7. +26
    -2
      3.0/src/modules/Hardware/FR/src/Base/FRBase.cpp
  8. +66
    -0
      3.0/src/modules/Hardware/FR/src/Base/FSSerialData.cpp
  9. +50
    -0
      3.0/src/modules/Hardware/FR/src/Base/FSSerialData.h

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

@@ -245,6 +245,10 @@ namespace CDeviceData
const char ValidityData[] = "fs_validity_data";
const char DifferenceDT[] = "fs_difference_date_time";
const char Version[] = "fs_version";
const char Expiration[] = "fs_expiration";
const char FFD[] = "fs_ffd";
const char Provider[] = "fs_provider";
const char Revision[] = "fs_revision";
}
/// Сторожевые таймеры.


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

@@ -23,54 +23,7 @@
// Project
#include "Hardware/FR/FRStatusesDescriptions.h"
#include "Hardware/FR/FiscalFieldDescriptions.h"
//--------------------------------------------------------------------------------
/// Режим работы ФР
namespace EFRMode
{
enum Enum
{
Fiscal,
Printer
};
}
//--------------------------------------------------------------------------------
/// Регион (для налоговых ставок).
namespace ERegion
{
enum Enum
{
RF,
KZ
};
}
//--------------------------------------------------------------------------------
/// Типы ФР.
namespace EFRType
{
enum Enum
{
EKLZ, // Старый ФР с ЭКЛЗ
NoEKLZ, // Старый ФР без ЭКЛЗ (для ЕНВД)
FS // Онлайновый ФР с ФН
};
}
//--------------------------------------------------------------------------------
/// Форматы ФФД.
namespace EFFD
{
enum Enum
{
Unknown = -1, // Неизвестная
F10Beta, // 1.0 Beta
F10, // 1.0
F105, // 1.05
F11 // 1.1
};
}
#include "Hardware/FR/FRDataTypes.h"
//--------------------------------------------------------------------------------
/// Общие константы ФР.


+ 53
- 0
3.0/src/includes/Hardware/FR/FRDataTypes.h View File

@@ -0,0 +1,53 @@
/* @file Основные типы данных, используемых в ФР. */

#pragma once

//--------------------------------------------------------------------------------
/// Режим работы ФР
namespace EFRMode
{
enum Enum
{
Fiscal,
Printer
};
}

//--------------------------------------------------------------------------------
/// Регион (для налоговых ставок).
namespace ERegion
{
enum Enum
{
RF,
KZ
};
}

//--------------------------------------------------------------------------------
/// Типы ФР.
namespace EFRType
{
enum Enum
{
EKLZ, // Старый ФР с ЭКЛЗ
NoEKLZ, // Старый ФР без ЭКЛЗ (для ЕНВД)
FS // Онлайновый ФР с ФН
};
}

//--------------------------------------------------------------------------------
/// Форматы ФФД.
namespace EFFD
{
enum Enum
{
Unknown = -1, // Неизвестная
F10Beta, // 1.0 Beta
F10, // 1.0
F105, // 1.05
F11 // 1.1
};
}

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

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

@@ -0,0 +1 @@
#include "../../../modules/Hardware/FR/src/Base/FSSerialData.h"

+ 3
- 0
3.0/src/modules/Hardware/FR/msvc/FR.vcxproj View File

@@ -120,6 +120,7 @@
<ClCompile Include="..\src\Atol\Online\AtolOnlineFRBase.cpp" />
<ClCompile Include="..\src\Atol\Online\Paymaster.cpp" />
<ClCompile Include="..\src\Base\FFEngine.cpp" />
<ClCompile Include="..\src\Base\FSSerialData.cpp" />
<ClCompile Include="..\src\Base\Port\PortFRBase.cpp" />
<ClCompile Include="..\src\Kasbi\KasbiFRBase.cpp" />
<ClCompile Include="..\src\MStar\Online\AFPFR.cpp" />
@@ -147,6 +148,7 @@
<ClInclude Include="..\..\..\..\includes\Hardware\FR\AtolOnlinePrinters.h" />
<ClInclude Include="..\..\..\..\includes\Hardware\FR\FiscalFieldDescriptions.h" />
<ClInclude Include="..\..\..\..\includes\Hardware\FR\FRBaseConstants.h" />
<ClInclude Include="..\..\..\..\includes\Hardware\FR\FRDataTypes.h" />
<ClInclude Include="..\..\..\..\includes\Hardware\FR\KasbiPrinters.h" />
<ClInclude Include="..\..\..\..\includes\Hardware\FR\OFDServerData.h" />
<ClInclude Include="..\..\..\..\includes\Hardware\FR\FRErrorDescription.h" />
@@ -173,6 +175,7 @@
<ClInclude Include="..\src\Atol\Online\AtolOnlineFRBase.h" />
<ClInclude Include="..\src\Atol\Online\Paymaster.h" />
<ClInclude Include="..\src\Base\FFEngine.h" />
<ClInclude Include="..\src\Base\FSSerialData.h" />
<ClInclude Include="..\src\Base\Port\PortFRBase.h" />
<ClInclude Include="..\src\Kasbi\KasbiFRBase.h" />
<ClInclude Include="..\src\Kasbi\KasbiFRConstants.h" />


+ 12
- 0
3.0/src/modules/Hardware/FR/msvc/FR.vcxproj.filters View File

@@ -111,6 +111,9 @@
<Filter Include="ATOL\Base\ATOL3">
<UniqueIdentifier>{d48b4d7d-c69c-4865-8de4-18ab61ba580c}</UniqueIdentifier>
</Filter>
<Filter Include="Base\FS serial data">
<UniqueIdentifier>{c76ebf56-bb2f-4e0e-a0a0-dd771305e71a}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\Base\FRBase.cpp">
@@ -206,6 +209,9 @@
<ClCompile Include="..\src\Atol\Base\Atol3\Atol3FRBase.cpp">
<Filter>ATOL\Base\ATOL3</Filter>
</ClCompile>
<ClCompile Include="..\src\Base\FSSerialData.cpp">
<Filter>Base\FS serial data</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\includes\Hardware\Protocols\FR\FiscalChequeStates.h">
@@ -445,6 +451,12 @@
<ClInclude Include="..\src\Atol\Base\Atol3\Atol3FRBaseConstants.h">
<Filter>ATOL\Base\ATOL3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\includes\Hardware\FR\FRDataTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\Base\FSSerialData.h">
<Filter>Base\FS serial data</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\OPOSMStarTUPK\OPOSMStarTUPK.h">


+ 26
- 2
3.0/src/modules/Hardware/FR/src/Base/FRBase.cpp View File

@@ -24,6 +24,7 @@
// Project
#include "FRBase.h"
#include "Hardware/FR/OFDServerData.h"
#include "Hardware/FR/FSSerialData.h"
using namespace SDK::Driver;
using namespace FRStatusCode;
@@ -241,6 +242,20 @@ void FRBase<T>::finaliseOnlineInitialization()
if (mFFEngine.getConfigParameter(CFiscalSDK::ExcisableUnitMode, 0).toInt()) operationModeDescriptions += mFFData[CFR::FiscalFields::ExcisableUnitMode].translationPF;
if (mFFEngine.getConfigParameter(CFiscalSDK::InAutomateMode, 0).toInt()) operationModeDescriptions += mFFData[CFR::FiscalFields::InAutomateMode].translationPF;
if (FS::Data.contains(mFSSerialNumber))
{
FS::SData FSData = FS::Data[mFSSerialNumber];
setDeviceParameter(CDeviceData::FS::Expiration, QString("%1 months").arg(FSData.expiration));
setDeviceParameter(CDeviceData::FS::FFD, FSData.FFD);
setDeviceParameter(CDeviceData::FS::Provider, FSData.provider);
if (!FSData.revision.isEmpty())
{
setDeviceParameter(CDeviceData::FS::Revision, FSData.revision);
}
}
setDeviceParameter(CDeviceData::FS::SerialNumber, mFSSerialNumber);
setDeviceParameter(CDeviceData::FR::TaxSystems, QStringList(taxSystemData.values()).join(", "));
setDeviceParameter(CDeviceData::FR::OperationModes, operationModeDescriptions.join(", "));
@@ -1402,8 +1417,12 @@ void FRBase<T>::checkTaxes2019()
set(mDeviceName, CDeviceData::SerialNumber);
set(mDeviceName, CDeviceData::FR::Taxes2019Applied);
toLog(LogLevel::Normal, mDeviceName + ": Closing session with VAT 18%, trying to re-initialize");
reInitialize();
if (check(mDeviceName, CDeviceData::SerialNumber))
{
toLog(LogLevel::Normal, mDeviceName + ": Closing session with VAT 18%, trying to re-initialize");
reInitialize();
}
}
}
}
@@ -1609,6 +1628,11 @@ int FRBase<T>::getErrorStatusCode(FRError::EType::Enum aErrorType)
template <class T>
bool FRBase<T>::isFS36() const
{
if (FS::Data.contains(mFSSerialNumber))
{
return FS::Data[mFSSerialNumber].expiration == 36;
}
QString FSValidityDateText = getDeviceParameter(CDeviceData::FS::ValidityData).toString();
QDate FSValidityDate = QDate::fromString(FSValidityDateText, CFR::DateLogFormat);


+ 66
- 0
3.0/src/modules/Hardware/FR/src/Base/FSSerialData.cpp View File

@@ -0,0 +1,66 @@
/* @file Данные ФН. */

#pragma once

#include "FSSerialData.h"

//--------------------------------------------------------------------------------
namespace FS
{
CData::CData()
{
add("87100001", 13, EFFD::F10, "ООО \"РИК\"");
add("87110001", 36, EFFD::F10, "ООО \"РИК\"");
add("8712000100", 13, EFFD::F10, "ООО \"Прагматик\"", "3 верс.2");
add("8712000101", 13, EFFD::F10, "ООО \"НТЦ \"Измеритель\"", "3 верс.1");
add("87150001", 13, EFFD::F10, "ООО \"Прагматик\"", "Пр13-2");
add("87160001", 13, EFFD::F10, "ООО \"НТЦ \"Измеритель\"", "Из13-2");
add("92810001", 36, EFFD::F11, "ООО \"Инвента\"", "4");
add("92820001", 15, EFFD::F11, "ООО \"Инвента\"", "5-15-2");
add("92834403", 36, EFFD::F11, "ООО \"Эвотор\"", "ЭВ36-2");
add("92840001", 15, EFFD::F11, "ООО \"Эвотор\"", "ЭВ15-2");
add("92850001", 15, EFFD::F11, "ООО \"НТЦ \"Измеритель\"", "Из15-2");
add("92860001", 15, EFFD::F11, "АО \"Концерн \"Автоматика\"", "3");
add("92874403", 36, EFFD::F11, "ООО \"Инвента\"", "2");
add("92880001", 15, EFFD::F11, "ООО \"Инвента\"", "5-15-1");
add("92890001", 15, EFFD::F11, "ООО \"Прагматик\"", "Пр15-2");
add("92514403", 15, EFFD::F11, "ООО \"Дримкас\"", "6-15-2");
add("92524403", 36, EFFD::F11, "АО \"Концерн \"Автоматика\"", "Ав36-2");

mSerialNumberTemplates = mBuffer.keys();
auto pred = [] (const QString & aData1, const QString & aData2) -> bool { return aData1.size() > aData2.size(); };
qSort(mSerialNumberTemplates.begin(), mSerialNumberTemplates.end(), pred);
}

//--------------------------------------------------------------------------------
bool CData::contains(const QString & aSerialNumber) const
{
return getSerialNumberTemplate(aSerialNumber) != mSerialNumberTemplates.end();
}

//--------------------------------------------------------------------------------
void CData::add(const QString & aSerialNumber, int aExpiration, EFFD::Enum aFFD, const char * aProvider, const char * aRevision)
{
append(aSerialNumber, SData(aExpiration, aFFD, QString::fromUtf8(aProvider), QString::fromUtf8(aRevision)));
}

//--------------------------------------------------------------------------------
SData CData::value(const QString & aSerialNumber) const
{
QStringList::const_iterator serialNumberTemplate = getSerialNumberTemplate(aSerialNumber);

return (serialNumberTemplate == mSerialNumberTemplates.end()) ? SData() : mBuffer[*serialNumberTemplate];
}

//--------------------------------------------------------------------------------
QStringList::const_iterator CData::getSerialNumberTemplate(const QString & aSerialNumber) const
{
QString serialNumber = aSerialNumber.simplified();

return std::find_if(mSerialNumberTemplates.begin(), mSerialNumberTemplates.end(), [&serialNumber] (const QString & aSerialNumberTemplate) -> bool
{ return serialNumber.startsWith(aSerialNumberTemplate); });
}

} // namespace FS

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

+ 50
- 0
3.0/src/modules/Hardware/FR/src/Base/FSSerialData.h View File

@@ -0,0 +1,50 @@
/* @file Данные ФН. */

#pragma once

// Modules
#include "Hardware/Common/Specifications.h"

// Project
#include "Hardware/FR/FRDataTypes.h"

//--------------------------------------------------------------------------------
namespace FS
{
struct SData
{
int expiration; /// Срок годности.
EFFD::Enum FFD; /// "Родная" версия ФФД.
QString provider; /// Поставщик.
QString revision; /// Ревизия.

SData(): expiration(13), FFD(EFFD::F10) {}
SData(int aExpiration, EFFD::Enum aFFD, const QString & aProvider, const QString & aRevision): expiration(aExpiration), FFD(aFFD), provider(aProvider), revision(aRevision) {}
};

class CData: public CSpecification<QString, SData>
{
public:
CData();

/// Содержит ли шаблон серийного номера.
bool contains(const QString & aSerialNumber) const;

protected:
/// Добавить данные.
void add(const QString & aSerialNumber, int aExpiration, EFFD::Enum aFFD, const char * aProvider, const char * aRevision = "");

/// Получить данные по серийному номеру.
virtual SData value(const QString & aSerialNumber) const;

/// Получить шаблон серийного номера по серийному номеру.
QStringList::const_iterator getSerialNumberTemplate(const QString & aSerialNumber) const;

/// Шаблоны серийных номеров.
QStringList mSerialNumberTemplates;
};

static CData Data;
}

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

Loading…
Cancel
Save