Commit df011afe authored by kravtsov's avatar kravtsov

[+] Добавлена команды directIO для проверки маркировки товара

    DIO_CHECK_MARKING    = 60; // check marking
parent c0cd540b
......@@ -4,6 +4,14 @@
Company : SHTRIH-M, Russia, Moscow, Masterkova 4
(495) 787-60-90, www.shtrih-m.ru
*******************************************************************
OposShtrih_1.13_471.exe
7 февраля 2018 20:20
[+] Добавлена команды directIO для проверки маркировки товара
DIO_CHECK_MARKING = 60; // check marking
*******************************************************************
OposShtrih_1.13_470.exe
......
......@@ -283,6 +283,7 @@ type
function WriteFPParameter(ParamId: Integer; const Value: string): Integer;
function PrintFSDocument(Number: Integer): Integer;
function ReadFSDocument(Number: Integer; var S: string): Integer;
function CheckItemBarcode(const Barcode: string): Integer;
property OpenResult: Integer read Get_OpenResult;
property BinaryConversion: Integer read Get_BinaryConversion write Set_BinaryConversion;
......@@ -2096,4 +2097,14 @@ begin
S := pString;
end;
function TSMFiscalPrinter.CheckItemBarcode(const Barcode: string): Integer;
var
pData: Integer;
pString: WideString;
begin
pData := 0;
pString := Barcode;
Result := Driver.DirectIO(DIO_CHECK_MARKING, pData, pString);
end;
end.
......@@ -5,10 +5,9 @@ interface
uses
// VCL
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,
Dialogs, StdCtrls, ComCtrls, Spin,
// This
untUtil, PrinterParameters, FptrTypes, ComCtrls, Spin,
FiscalPrinterDevice;
untUtil, FptrTypes, PrinterParameters, FiscalPrinterDevice;
type
{ TfmFptrConnection }
......
object fmMarkChecker: TfmMarkChecker
Left = 655
Top = 219
AutoScroll = False
Caption = 'Marking'
ClientHeight = 429
ClientWidth = 612
Color = clBtnFace
Constraints.MinHeight = 265
Constraints.MinWidth = 280
Font.Charset = RUSSIAN_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
PixelsPerInch = 96
TextHeight = 13
object lblEkmServerHost: TTntLabel
Left = 40
Top = 56
Width = 53
Height = 13
Caption = 'IP address:'
end
object lblEkmServerPort: TTntLabel
Left = 40
Top = 88
Width = 73
Height = 13
Caption = 'Port (0..65535):'
end
object lblEkmServerTimeout: TTntLabel
Left = 40
Top = 120
Width = 120
Height = 13
Caption = 'Timeout, seconds (1..30):'
end
object chkEkmServerEnabled: TTntCheckBox
Left = 8
Top = 32
Width = 417
Height = 17
Caption = 'Check marking on EKM server (conection to EKM server is needed)'
TabOrder = 1
end
object edtEkmServerHost: TTntEdit
Left = 168
Top = 56
Width = 137
Height = 21
TabOrder = 2
end
object seEkmServerPort: TSpinEdit
Left = 168
Top = 88
Width = 137
Height = 22
MaxValue = 65535
MinValue = 0
TabOrder = 3
Value = 0
end
object seEkmServerTimeout: TSpinEdit
Left = 168
Top = 120
Width = 137
Height = 22
MaxValue = 30
MinValue = 1
TabOrder = 4
Value = 1
end
object chkFSMarkCheckEnabled: TTntCheckBox
Left = 8
Top = 8
Width = 417
Height = 17
Caption = 'Check marking in fiscal storage (version 1.1 or later)'
TabOrder = 0
end
end
unit fmuMarkChecker;
interface
uses
// VCL
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ComCtrls, TntDialogs, TntStdCtrls, Spin,
// This
untUtil, FptrTypes, PrinterParameters, FiscalPrinterDevice;
type
{ TfmMarkChecker }
TfmMarkChecker = class(TFptrPage)
chkEkmServerEnabled: TTntCheckBox;
lblEkmServerHost: TTntLabel;
edtEkmServerHost: TTntEdit;
seEkmServerPort: TSpinEdit;
lblEkmServerPort: TTntLabel;
seEkmServerTimeout: TSpinEdit;
lblEkmServerTimeout: TTntLabel;
chkFSMarkCheckEnabled: TTntCheckBox;
public
procedure UpdatePage; override;
procedure UpdateObject; override;
end;
var
fmMarkChecker: TfmMarkChecker;
implementation
{$R *.DFM}
{ TfmMarkChecker }
procedure TfmMarkChecker.UpdatePage;
begin
edtEkmServerHost.Text := Parameters.EkmServerHost;
seEkmServerPort.Value := Parameters.EkmServerPort;
seEkmServerTimeout.Value := Parameters.EkmServerTimeout;
chkEkmServerEnabled.Checked := Parameters.EkmServerEnabled;
chkFSMarkCheckEnabled.Checked := Parameters.FSMarkCheckEnabled;
end;
procedure TfmMarkChecker.UpdateObject;
begin
Parameters.EkmServerHost := edtEkmServerHost.Text;
Parameters.EkmServerPort := seEkmServerPort.Value;
Parameters.EkmServerTimeout := seEkmServerTimeout.Value;
Parameters.EkmServerEnabled := chkEkmServerEnabled.Checked;
Parameters.FSMarkCheckEnabled := chkFSMarkCheckEnabled.Checked;
end;
end.
......@@ -115,7 +115,7 @@ AutoIncBuild=1
MajorVer=1
MinorVer=13
Release=0
Build=469
Build=473
Debug=0
PreRelease=0
Special=0
......@@ -126,7 +126,7 @@ CodePage=1252
[Version Info Keys]
CompanyName=SHTRIH-M
FileDescription=OPOS setup utility
FileVersion=1.13.0.469
FileVersion=1.13.0.473
InternalName=OPOS setup
LegalCopyright=SHTRIH-M 2013
LegalTrademarks=
......
......@@ -79,7 +79,8 @@ uses
VatCode in '..\SmFiscalPrinter\Units\VatCode.pas',
DriverContext in '..\SmFiscalPrinter\Units\DriverContext.pas',
OposMessages in '..\SmFiscalPrinter\Units\OposMessages.pas',
fmuFptrConnection in 'Fmu\fmuFptrConnection.pas' {fmFptrConnection};
fmuFptrConnection in 'Fmu\fmuFptrConnection.pas' {fmFptrConnection},
fmuMarkChecker in 'Fmu\fmuMarkChecker.pas' {fmMarkChecker};
{$R *.RES}
{$R WindowsXP.RES}
......
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,13,0,470
PRODUCTVERSION 1,13,0,470
FILEVERSION 1,13,0,471
PRODUCTVERSION 1,13,0,471
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x4L
......@@ -13,7 +13,7 @@ BEGIN
BEGIN
VALUE "CompanyName", "SHTRIH-M\0"
VALUE "FileDescription", "OPOS setup utility\0"
VALUE "FileVersion", "1.13.0.470\0"
VALUE "FileVersion", "1.13.0.471\0"
VALUE "InternalName", "OPOS setup \0"
VALUE "LegalCopyright", "SHTRIH-M \251 2013 \0"
VALUE "OriginalFilename", "OposConfig.exe\0"
......
......@@ -61,7 +61,7 @@ uses
fmuFptrConnection, fmuFptrReceipt, fmuFptrHeader, fmuFptrTrailer, fmuFptrText,
fmuFptrLog, fmuFptrLogo, fmuFptrPayType, fmuFptrVatCode, fmuFptrBarcode,
fmuXReport, fmuZReport, fmuMiscParams, fmuFiscalStorage, fmuFptrTables,
fmuReceiptFormat,
fmuReceiptFormat, fmuMarkChecker,
{$IFDEF MALINA}
fmuFptrMalina,
fmuFptrUnipos,
......@@ -144,6 +144,7 @@ begin
AddPage(fm, TfmFiscalStorage);
AddPage(fm, TfmReceiptFormat);
AddPage(fm, TfmFptrVatCode);
AddPage(fm, TfmMarkChecker);
{$IFDEF MALINA}
AddPage(fm, TfmFptrMalina);
......
[Closed Files]
File_0=SourceModule,'C:\projects\OPOSShtrih\Test\SmFiscalPrinterTest\Units\duPrinterParameters.pas',0,1,1,130,7,0,0
File_1=SourceModule,'C:\projects\OPOSShtrih\Source\OposConfig\Fmu\fmuMiscParams.pas',0,1,1,88,16,1,0
File_2=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterDevice.pas',0,1,7300,32,7337,0,0
File_3=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FSService.pas',0,1,131,45,144,0,0
File_4=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\SharedPrinter.pas',0,1,1390,3,1392,0,0
File_5=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\PrinterParameters.pas',0,1,647,30,671,0,0
File_6=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\PrinterTypes.pas',0,1,1115,27,1138,0,0
File_7=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\PrinterParametersIni.pas',0,1,1,95,19,0,0
File_8=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\PrinterParametersReg.pas',0,1,599,2,630,0,0
File_9=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\PrinterParametersRegIBT.pas',0,1,484,56,503,0,0
File_0=SourceModule,'C:\projects\OPOSShtrih\Source\OposConfig\Fmu\fmuMarkChecker.pas',0,1,1,25,2,1,0
File_1=SourceModule,'C:\projects\OPOSShtrih\Source\OposConfig\Units\FiscalPrinterDevice.pas',0,1,43,30,64,0,0
File_2=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\PrinterParameters.pas',0,1,334,19,353,0,0
File_3=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\PrinterParametersIni.pas',0,1,311,1,335,0,0
File_4=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\PrinterParametersReg.pas',0,1,617,2,650,0,0
File_5=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\PrinterParametersRegIBT.pas',0,1,1,47,10,0,0
File_6=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\TLV.pas',0,1,62,30,77,0,0
File_7=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterDevice.pas',0,1,1,15,9,0,0
File_8=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterImpl.pas',0,1,4489,34,4502,0,0
File_9=SourceModule,'C:\projects\OPOSShtrih\Source\OposTest\Units\PrinterTest.pas',0,1,4436,40,4454,0,0
[Modules]
Count=0
EditWindowCount=0
TypeLibWindowCount=3
[C:\projects\OPOSShtrih\Source\OposShtrih.bpg]
[C:\projects\OPOSShtrih\Source\OposConfig\OposConfig.dpr]
FormState=0
FormOnTop=0
[C:\projects\OPOSShtrih\Source\OposConfig\OposConfig.dpr]
[C:\projects\OPOSShtrih\Test\SmScaleTest\SmScaleTestLib.dpr]
FormState=0
FormOnTop=0
[C:\projects\OPOSShtrih\Source\OposShtrih.bpg]
FormState=0
FormOnTop=0
......@@ -87,10 +91,6 @@ FormOnTop=0
FormState=0
FormOnTop=0
[C:\projects\OPOSShtrih\Test\SmScaleTest\SmScaleTestLib.dpr]
FormState=0
FormOnTop=0
[TypeLibEditWindow0]
Create=1
Visible=0
......@@ -172,7 +172,7 @@ Visible=1
State=2
Left=336
Top=9
Width=1392
Width=1584
Height=122
MaxLeft=-8
MaxTop=-8
......@@ -187,12 +187,12 @@ Visible=1
State=0
Left=-2
Top=116
Width=507
Height=480
Width=650
Height=515
MaxLeft=-1
MaxTop=-1
ClientWidth=491
ClientHeight=446
ClientWidth=634
ClientHeight=481
TBDockHeight=681
LRDockWidth=445
Dockable=0
......@@ -418,5 +418,5 @@ CompUnitPane=104
DockHostCount=0
[ActiveProject]
ActiveProject=9
ActiveProject=3
......@@ -106,6 +106,7 @@ begin
AddTest(TReceiptTest15);
AddTest(TReceiptTest16);
AddTest(TReceiptTest17);
AddTest(TReceiptTest18);
cbTest.ItemIndex := 0;
end;
......
......@@ -115,7 +115,7 @@ AutoIncBuild=1
MajorVer=1
MinorVer=13
Release=0
Build=474
Build=478
Debug=0
PreRelease=0
Special=0
......@@ -126,7 +126,7 @@ CodePage=1252
[Version Info Keys]
CompanyName=SHTRIH-M
FileDescription=OPOS test utility
FileVersion=1.13.0.474
FileVersion=1.13.0.478
InternalName=OPOS test
LegalCopyright=SHTRIH-M 2013
LegalTrademarks=
......
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,13,0,470
PRODUCTVERSION 1,13,0,470
FILEVERSION 1,13,0,471
PRODUCTVERSION 1,13,0,471
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x4L
......@@ -13,7 +13,7 @@ BEGIN
BEGIN
VALUE "CompanyName", "SHTRIH-M\0"
VALUE "FileDescription", "OPOS test utility\0"
VALUE "FileVersion", "1.13.0.470\0"
VALUE "FileVersion", "1.13.0.471\0"
VALUE "InternalName", "OPOS test\0"
VALUE "LegalCopyright", "SHTRIH-M \251 2013 \0"
VALUE "OriginalFilename", "OposTest.exe\0"
......
......@@ -766,6 +766,14 @@ type
function GetDisplayText: string; override;
end;
{ TReceiptTest18 }
TReceiptTest18 = class(TDriverTest)
public
procedure Execute; override;
function GetDisplayText: string; override;
end;
implementation
const
......@@ -4440,12 +4448,25 @@ begin
end;
procedure TReceiptTest16.Execute;
var
Text: string;
begin
Text :=
'01234567890123456789012345678901234567890123456789' +
'01234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567';
Check(FiscalPrinter.ResetPrinter());
FiscalPrinter.FiscalReceiptType := FPTR_RT_SALES;
Check(FiscalPrinter.BeginFiscalReceipt(True));
Check(FiscalPrinter.PrintRecItem('-92', 101, 3088700, 4, 32.7, ''));
Check(FiscalPrinter.PrintRecItem(Text, 101, 3088, 4, 32.7, ''));
Check(FiscalPrinter.PrintRecTotal(101, 101, '2'));
Check(FiscalPrinter.PrintRecMessage('.: 41895 '));
Check(FiscalPrinter.FSWriteTag(1203, '505303696069'));
Check(FiscalPrinter.FSWriteTag(1203, '505303696069'));
Check(FiscalPrinter.EndFiscalReceipt(True));
end;
......@@ -4476,4 +4497,35 @@ begin
Check(FiscalPrinter.DirectIO(DIO_OPEN_DAY, pData, pString));
end;
{ TReceiptTest18 }
function TReceiptTest18.GetDisplayText: string;
begin
Result := 'Check item marking';
end;
procedure TReceiptTest18.Execute;
var
pData: Integer;
pString: WideString;
begin
Check(FiscalPrinter.ResetPrinter());
FiscalPrinter.FiscalReceiptType := FPTR_RT_SALES;
Check(FiscalPrinter.BeginFiscalReceipt(True));
pData := 0;
pString :=
'(01)18901148006025(21)5L1DNSVZD716T(10)DEMO(17)201231' +
'(240)1111(91)1129(92)mUfZBFCQmjupbDczH0kCErEiLNCktMzv' +
'+tWG24jDtHwRbPARdskMHHxuHE3h2fGRFX6wtXeQo11QXzLMGWqNcg==';
Check(FiscalPrinter.DirectIO(DIO_CHECK_MARKING, pData, pString));
Check(FiscalPrinter.PrintRecItem('Item 1', 101, 3088, 4, 32.7, ''));
Check(FiscalPrinter.PrintRecTotal(101, 101, '2'));
Check(FiscalPrinter.PrintRecMessage('.: 41895 '));
Check(FiscalPrinter.FSWriteTag(1203, '505303696069'));
Check(FiscalPrinter.EndFiscalReceipt(True));
end;
end.
......@@ -880,6 +880,18 @@ type
procedure DirectIO(var pData: Integer; var pString: WideString); override;
end;
{ TDIOCheckMarking }
TDIOCheckMarking = class(TDIOHandler)
private
FPrinter: TFiscalPrinterImpl;
public
constructor CreateCommand(AOwner: TDIOHandlers; ACommand: Integer;
APrinter: TFiscalPrinterImpl);
procedure DirectIO(var pData: Integer; var pString: WideString); override;
end;
implementation
function BoolToStr(Value: Boolean): string;
......@@ -1845,6 +1857,7 @@ begin
DriverParameterParam8: pString := Printer.Parameters.Parameter8;
DriverParameterParam9: pString := Printer.Parameters.Parameter9;
DriverParameterParam10: pString := Printer.Parameters.Parameter10;
DriverParameterBarcode: pString := Printer.Parameters.Barcode;
end;
end;
......@@ -1941,6 +1954,7 @@ begin
DriverParameterParam8: Parameters.Parameter8 := pString;
DriverParameterParam9: Parameters.Parameter9 := pString;
DriverParameterParam10: Parameters.Parameter10 := pString;
DriverParameterBarcode: Parameters.Barcode := pString;
end;
end;
......@@ -2616,4 +2630,19 @@ begin
FPrinter.OpenFiscalDay;
end;
{ TDIOCheckMarking }
constructor TDIOCheckMarking.CreateCommand(AOwner: TDIOHandlers;
ACommand: Integer; APrinter: TFiscalPrinterImpl);
begin
inherited Create(AOwner, ACommand);
FPrinter := APrinter;
end;
procedure TDIOCheckMarking.DirectIO(var pData: Integer;
var pString: WideString);
begin
FPrinter.Device.Check(FPrinter.Device.CheckItemBarcode(pString));
end;
end.
......@@ -7,7 +7,7 @@ uses
DeviceService;
const
GenericServiceVersion = deviceVersion113 + 470;
GenericServiceVersion = deviceVersion113 + 471;
implementation
......
......@@ -168,7 +168,9 @@ uses
SmResourceStrings in 'Units\SmResourceStrings.pas',
TLVTags in 'Units\TLVTags.pas',
TLVParser in 'Units\TLVParser.pas',
FSSalesReceipt in 'Units\FSSalesReceipt.pas';
FSSalesReceipt in 'Units\FSSalesReceipt.pas',
EkmClient in 'Units\EkmClient.pas',
GS1Barcode in 'Units\GS1Barcode.pas';
exports
DllGetClassObject,
......
This diff is collapsed.
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,13,0,470
PRODUCTVERSION 1,13,0,470
FILEVERSION 1,13,0,471
PRODUCTVERSION 1,13,0,471
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x4L
......@@ -13,7 +13,7 @@ BEGIN
BEGIN
VALUE "CompanyName", "SHTRIH-M\0"
VALUE "FileDescription", "Fiscal printer service\0"
VALUE "FileVersion", "1.13.0.470\0"
VALUE "FileVersion", "1.13.0.471\0"
VALUE "InternalName", "Fiscal printer driver\0"
VALUE "LegalCopyright", "SHTRIH-M \251 2013 \0"
VALUE "OriginalFilename", "SmFiscalPrinter.dll\0"
......
......@@ -12,7 +12,7 @@ unit SmFiscalPrinterLib_TLB;
// ************************************************************************ //
// PASTLWTR : 1.2
// File generated on 25.12.2017 17:27:32 from Type Library described below.
// File generated on 07.02.2018 16:58:58 from Type Library described below.
// ************************************************************************ //
// Type Lib: C:\projects\OPOSShtrih\Source\SmFiscalPrinter\SmFiscalPrinter.tlb (1)
......
......@@ -57,6 +57,7 @@ type
procedure PrintPostLine;
procedure ClearRecMessages;
procedure EndFiscalReceipt; virtual;
procedure EndFiscalReceipt2; virtual;
procedure AfterEndFiscalReceipt; virtual;
procedure PrintRecMessages; overload;
procedure PrintRecMessages(ID: Integer); overload;
......@@ -519,4 +520,9 @@ begin
Device.PrintText(PRINTER_STATION_REC, AdditionalHeader);
end;
procedure TCustomReceipt.EndFiscalReceipt2;
begin
end;
end.
......@@ -84,6 +84,7 @@ const
DIO_PRINT_CORRECTION2 = 57; // print correction receipt 2
DIO_START_OPEN_DAY = 58; // start open day
DIO_OPEN_DAY = 59; // open day
DIO_CHECK_MARKING = 60; // check marking
DIO_PRINT_TEXT2 = 1000; // print text
......@@ -311,6 +312,7 @@ const
DriverParameterParam8 = 77;
DriverParameterParam9 = 78;
DriverParameterParam10 = 79;
DriverParameterBarcode = 80;