Browse Source

refs #1 Synchronizing with release commit: 1848de4441

qt5
parent
commit
1a602df30e
5 changed files with 22 additions and 37 deletions
  1. +2
    -2
      3.0/src/includes/Hardware/FR/FRBaseConstants.h
  2. +0
    -6
      3.0/src/modules/Hardware/Common/src/Meta/MetaDevice.cpp
  3. +3
    -6
      3.0/src/modules/Hardware/FR/src/Base/FRBase.cpp
  4. +17
    -17
      3.0/src/modules/Hardware/FR/src/Shtrih/Online/ShtrihOnlineFRBase.cpp
  5. +0
    -6
      3.0/src/modules/Hardware/FR/src/Shtrih/Online/ShtrihOnlineFRBase.h

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

@@ -62,8 +62,8 @@ namespace CFR
/// Формальная дата окончания ФН.
inline QString FSValidityDateOff(const QDate & aDate) { return aDate.addDays(-3).toString(CFR::DateLogFormat); }
/// Срок годности обычной (на 13 месяцев) ФН в днях.
const int SimpleFSValidityDays = 365 + 30;
/// Срок годности обычной (на 13 месяцев) ФН в днях - так фактически, у всех производителей.
const int SimpleFSValidityDays = 410;
/// Результаты запроса статуса.
namespace Result


+ 0
- 6
3.0/src/modules/Hardware/Common/src/Meta/MetaDevice.cpp View File

@@ -134,12 +134,6 @@ void MetaDevice<T>::setDeviceConfiguration(const QVariantMap & aConfiguration)
mOperatorPresence = aConfiguration.value(CHardwareSDK::OperatorPresence, mOperatorPresence).toBool();
mFiscalServerPresence = aConfiguration.value(CHardwareSDK::FiscalServerPresence, mFiscalServerPresence).toBool();
if (aConfiguration.contains(CHardwareSDK::FiscalServerPresence))
{
toLog(LogLevel::Normal, QString("--- setDeviceConfiguration: aConfiguration[CHardwareSDK::FiscalServerPresence] = %1, mFiscalServerPresence = %2")
.arg(aConfiguration[CHardwareSDK::FiscalServerPresence].toString()).arg(mFiscalServerPresence ? "true" : "false"));
}
}
//--------------------------------------------------------------------------------


+ 3
- 6
3.0/src/modules/Hardware/FR/src/Base/FRBase.cpp View File

@@ -1642,13 +1642,10 @@ bool FRBase<T>::isFS36() const
return false;
}
int days = QDate::currentDate().daysTo(FSValidityDate);
bool result = days > CFR::SimpleFSValidityDays;
int days = QDate::currentDate().daysTo(FSValidityDate) + 3;
toLog(LogLevel::Normal, mDeviceName + QString(": %1 days to validity date").arg(days));
toLog(LogLevel::Normal, mDeviceName + QString(": --- isFS36: current date = %1, FS validity date = %2, days = %3, result = %4")
.arg(QDate::currentDate().toString(CFR::DateLogFormat)).arg(FSValidityDateText).arg(days).arg(result ? "true" : "false"));
return result;
return days > CFR::SimpleFSValidityDays;
}
//--------------------------------------------------------------------------------


+ 17
- 17
3.0/src/modules/Hardware/FR/src/Shtrih/Online/ShtrihOnlineFRBase.cpp View File

@@ -23,8 +23,6 @@ ShtrihOnlineFRBase<T>::ShtrihOnlineFRBase()
mOFDFiscalParameters.remove(CFR::FiscalFields::Cashier);
mOFDFiscalParameters.remove(CFR::FiscalFields::TaxSystem);
mNeedReceiptProcessingOnCancel = true;
mSetCustomFields = ASCII::NUL;
mSetCustomFieldsCorrect = false;
setConfigParameter(CHardwareSDK::FR::CanWithoutPrinting, true);
@@ -107,16 +105,6 @@ bool ShtrihOnlineFRBase<T>::updateParameters()
}
QByteArray data;
mSetCustomFieldsCorrect = getFRParameter(CShtrihOnlineFR::FRParameters::SetCustomFields, data) && !data.isEmpty();
if (!mSetCustomFieldsCorrect)
{
toLog(LogLevel::Error, mDeviceName + ": Cannot get custom fields data");
}
else
{
mSetCustomFields = data[0];
}
if (getFRParameter(CShtrihOnlineFR::FRParameters::AutomaticNumber, data) && !clean(data).isEmpty())
{
@@ -573,7 +561,11 @@ bool ShtrihOnlineFRBase<T>::performFiscal(const QStringList & aReceipt, const SP
}
}
if (mSetCustomFieldsCorrect && isFS36() && (aPaymentData.taxSystem == ETaxSystems::Main))
bool setCustomFieldsOK = false;
char setCustomFields = ASCII::NUL;
QByteArray data;
if (isFS36() && (aPaymentData.taxSystem == ETaxSystems::Main) && getFRParameter(CShtrihOnlineFR::FRParameters::SetCustomFields, data) && !data.isEmpty())
{
QStringList noPayLog;
@@ -585,9 +577,10 @@ bool ShtrihOnlineFRBase<T>::performFiscal(const QStringList & aReceipt, const SP
}
}
char newSetCustomFields = mSetCustomFields | CShtrihOnlineFR::FRParameters::DontSendPayOffSubjectType;
setCustomFields = data[0];
char newSetCustomFields = setCustomFields | CShtrihOnlineFR::FRParameters::DontSendPayOffSubjectType;
if (!noPayLog.isEmpty() && (mSetCustomFields != newSetCustomFields))
if (!noPayLog.isEmpty() && (setCustomFields != newSetCustomFields))
{
QString log = mDeviceName + QString(": Failed to make fiscal document due to cannot sale unit(s): %1, because ").arg(noPayLog.join("; "));
@@ -606,6 +599,10 @@ bool ShtrihOnlineFRBase<T>::performFiscal(const QStringList & aReceipt, const SP
toLog(LogLevel::Error, log + "impossible to set custom fields data");
return false;
}
else
{
setCustomFieldsOK = true;
}
}
}
@@ -614,13 +611,16 @@ bool ShtrihOnlineFRBase<T>::performFiscal(const QStringList & aReceipt, const SP
return false;
}
QByteArray data;
if (aFDNumber && processCommand(CShtrihOnlineFR::Commands::FS::GetStatus, &data) && (data.size() >= 33))
{
*aFDNumber = revert(data.mid(29, 4)).toHex().toUInt(0, 16);
}
if (setCustomFieldsOK && !setFRParameter(CShtrihOnlineFR::FRParameters::SetCustomFields, setCustomFields))
{
mPPTaskList.append([&] () { setFRParameter(CShtrihOnlineFR::FRParameters::SetCustomFields, setCustomFields); });
}
return true;
}


+ 0
- 6
3.0/src/modules/Hardware/FR/src/Shtrih/Online/ShtrihOnlineFRBase.h View File

@@ -91,12 +91,6 @@ protected:
/// Невозможно включить автообновление прошивки.
bool mNotEnableFirmwareUpdating;
/// Параметр установки определенных фискальных тегов.
char mSetCustomFields;
/// Корректность значения параметра установки определенных фискальных тегов.
bool mSetCustomFieldsCorrect;
};
typedef ShtrihOnlineFRBase<ShtrihTCPFRBase> ShtrihOnlineTCPFR;


Loading…
Cancel
Save