Commit d7d616e5 authored by kravtsov's avatar kravtsov

[-] Исправлена ошибка при печати чека коррекции.

    В методе beginFiscalReceipt сделана команда "Начать формирование чека коррекции"
parent 86bbe8f6
......@@ -4,6 +4,15 @@
Company : SHTRIH-M, Russia, Moscow, Masterkova 4
(495) 787-60-90, www.shtrih-m.ru
*******************************************************************
OposShtrih_1.13_487.exe
14 мая 2018 13:00
[-] Исправлена ошибка при печати чека коррекции.
В методе beginFiscalReceipt сделана команда
"Начать формирование чека коррекции"
*******************************************************************
OposShtrih_1.13_486.exe
......
......@@ -115,7 +115,7 @@ AutoIncBuild=1
MajorVer=1
MinorVer=13
Release=0
Build=485
Build=487
Debug=0
PreRelease=0
Special=0
......@@ -126,9 +126,9 @@ CodePage=1252
[Version Info Keys]
CompanyName=SHTRIH-M
FileDescription=OPOS setup utility
FileVersion=1.13.0.485
InternalName=OPOS setup
LegalCopyright=SHTRIH-M 2013
FileVersion=1.13.0.487
InternalName=OPOS setup
LegalCopyright=SHTRIH-M 2013
LegalTrademarks=
OriginalFilename=OposConfig.exe
ProductName=OPOS drivers
......@@ -136,24 +136,16 @@ ProductVersion=1.13
Comments=http://www.shtrih-m.ru
[Excluded Packages]
C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\PngComponentsD7.bpl=Png components
[HistoryLists\hlConditionals]
Count=2
Item0=MALINA
Item1=FUEL
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
Count=2
Item0=C:\COMPON~1\JVCL\jcl\lib\d7\debug
Item1=$(DELPHI)\Lib\Debug
Count=1
Item0=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
[HistoryLists\hlOutputDirectorry]
Count=1
Item0=..\..\Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
......
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,13,0,486
PRODUCTVERSION 1,13,0,486
FILEVERSION 1,13,0,487
PRODUCTVERSION 1,13,0,487
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.486\0"
VALUE "FileVersion", "1.13.0.487\0"
VALUE "InternalName", "OPOS setup \0"
VALUE "LegalCopyright", "SHTRIH-M \251 2013 \0"
VALUE "OriginalFilename", "OposConfig.exe\0"
......
[Closed Files]
File_0=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\oleFiscalPrinter.pas',0,1,349,1,372,0,0
File_1=SourceModule,'C:\projects\OPOSShtrih\Source\Shared\DIOHandler.pas',0,1,90,59,100,0,0
File_2=SourceModule,'C:\projects\OPOSShtrih\Test\SmFiscalPrinterTest\Units\MockFiscalPrinterDevice.pas',0,1,1,1,14,0,0
File_3=SourceModule,'C:\projects\OPOSShtrih\Test\SmFiscalPrinterTest\Units\TextFiscalPrinterDevice.pas',0,1,1,51,36,0,0
File_4=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterTypes.pas',0,1,458,63,464,0,0
File_0=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FSSalesReceipt.pas',0,1,1,76,11,0,0
File_1=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterImpl.pas',0,1,644,13,656,0,0
File_2=SourceModule,'C:\projects\OPOSShtrih\Source\Shared\DIOHandlers.pas',0,1,2282,18,2288,0,0
File_3=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\TLVTags.pas',0,1,358,1,371,0,0
File_4=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterDevice.pas',0,1,8614,44,8624,0,0
File_5=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\PrinterProtocol2.pas',0,1,333,25,352,0,0
File_6=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\GS1Barcode.pas',0,1,369,1,332,0,0
File_7=SourceModule,'C:\projects\OPOSShtrih\Source\Shared\StringUtils.pas',0,1,103,1,122,0,0
[Modules]
Module0=C:\projects\OPOSShtrih\Test\SmFiscalPrinterTest\Units\RegressTests.pas
Module1=C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterImpl.pas
Module2=C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterDevice.pas
Module3=C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\DirectIOAPI.pas
Module4=C:\projects\OPOSShtrih\Source\Shared\DIOHandlers.pas
Count=5
Module0=C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\DirectIOAPI.pas
Module1=C:\projects\OPOSShtrih\Source\OposTest\Units\PrinterTest.pas
Module2=C:\projects\OPOSShtrih\Source\Opos\OposFptr.pas
Count=3
EditWindowCount=1
TypeLibWindowCount=3
[C:\projects\OPOSShtrih\Test\SmFiscalPrinterTest\Units\RegressTests.pas]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterImpl.pas]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterDevice.pas]
[C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\DirectIOAPI.pas]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\DirectIOAPI.pas]
[C:\projects\OPOSShtrih\Source\OposTest\Units\PrinterTest.pas]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[C:\projects\OPOSShtrih\Source\Shared\DIOHandlers.pas]
[C:\projects\OPOSShtrih\Source\Opos\OposFptr.pas]
ModuleType=SourceModule
FormState=0
FormOnTop=0
......@@ -117,22 +108,20 @@ FormState=0
FormOnTop=0
[EditWindow0]
ViewCount=5
CurrentView=2
ViewCount=3
CurrentView=1
View0=0
View1=1
View2=2
View3=3
View4=4
CodeExplorer=CodeExplorer@EditWindow0
MessageView=MessageView@EditWindow0
Create=1
Visible=1
State=2
Left=368
Top=188
Width=912
Height=646
Left=309
Top=138
Width=1302
Height=682
MaxLeft=-8
MaxTop=106
MaxWidth=1936
......@@ -148,38 +137,24 @@ BottomPanelClients=MessageView@EditWindow0
BottomPanelData=000004000000000000000000000000000000000000000000000100000000000000000B0000004D65737361676556696577FFFFFFFF
[View0]
Module=C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterImpl.pas
CursorX=21
CursorY=659
TopLine=637
Module=C:\projects\OPOSShtrih\Source\OposTest\Units\PrinterTest.pas
CursorX=78
CursorY=3927
TopLine=3916
LeftCol=1
[View1]
Module=C:\projects\OPOSShtrih\Source\Shared\DIOHandlers.pas
CursorX=2
CursorY=2229
TopLine=2226
LeftCol=1
[View2]
Module=C:\projects\OPOSShtrih\Test\SmFiscalPrinterTest\Units\RegressTests.pas
CursorX=24
CursorY=200
TopLine=192
LeftCol=1
[View3]
Module=C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\DirectIOAPI.pas
CursorX=1
CursorY=357
TopLine=332
CursorX=109
CursorY=365
TopLine=347
LeftCol=1
[View4]
Module=C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterDevice.pas
CursorX=30
CursorY=7639
TopLine=7631
[View2]
Module=C:\projects\OPOSShtrih\Source\Opos\OposFptr.pas
CursorX=63
CursorY=136
TopLine=124
LeftCol=1
[TypeLibEditWindow0]
......@@ -252,11 +227,10 @@ LRDockWidth=320
Dockable=1
[Breakpoints]
Count=4
Count=3
Breakpoint0='C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\CustomReceipt.pas',167,'',0,1,'',1,0,0,'',1,'','',''
Breakpoint1='C:\projects\OPOSShtrih\Source\OposTest\Units\PrinterTest.pas',4661,'',0,1,'',1,0,0,'',1,'','',''
Breakpoint2='C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterImpl.pas',3645,'',0,1,'',1,0,0,'',1,'','',''
Breakpoint3='C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\MalinaPlugin.pas',194,'',0,1,'',1,0,0,'',1,'','',''
Breakpoint1='C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterImpl.pas',3645,'',0,1,'',1,0,0,'',1,'','',''
Breakpoint2='C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\MalinaPlugin.pas',194,'',0,1,'',1,0,0,'',1,'','',''
[AddressBreakpoints]
Count=0
......@@ -265,12 +239,12 @@ Count=0
Create=1
Visible=1
State=2
Left=110
Top=9
Width=1810
Left=345
Top=0
Width=1575
Height=122
MaxLeft=-1
MaxTop=-1
MaxLeft=-8
MaxTop=-8
MaxWidth=1936
MaxHeight=122
ClientWidth=1920
......@@ -282,11 +256,11 @@ Visible=1
State=0
Left=8
Top=124
Width=479
Width=554
Height=589
MaxLeft=-1
MaxTop=-1
ClientWidth=463
ClientWidth=538
ClientHeight=555
TBDockHeight=681
LRDockWidth=445
......@@ -324,15 +298,15 @@ ClientHeight=60
[PropertyInspector]
Create=1
Visible=1
Visible=0
State=0
Left=2
Left=-1
Top=110
Width=430
Width=300
Height=831
MaxLeft=-1
MaxTop=-1
ClientWidth=414
ClientWidth=284
ClientHeight=797
TBDockHeight=681
LRDockWidth=291
......@@ -421,8 +395,8 @@ Dockable=1
Create=1
Visible=0
State=0
Left=1031
Top=481
Left=0
Top=110
Width=779
Height=814
MaxLeft=-1
......@@ -513,8 +487,8 @@ CompUnitPane=104
Create=1
Visible=0
State=0
Left=-172
Top=-56
Left=-113
Top=-6
Width=140
Height=305
MaxLeft=-1
......@@ -564,5 +538,5 @@ DockClients=CallStackWindow
DockSiteData=0000040000000000D20100000000000001DF03000000000000010000000087000000000000000100000002D2010000000000000200000000DF0300000F00000043616C6C537461636B57696E646F770200000000F7010000000000000100000000080100000000000001000000008C010000000000000100000000100200000000000001000000009802000000000000FFFFFFFF
[ActiveProject]
ActiveProject=9
ActiveProject=2
......@@ -115,7 +115,7 @@ AutoIncBuild=1
MajorVer=1
MinorVer=13
Release=0
Build=484
Build=486
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.484
FileVersion=1.13.0.486
InternalName=OPOS test
LegalCopyright=SHTRIH-M 2013
LegalTrademarks=
......
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,13,0,486
PRODUCTVERSION 1,13,0,486
FILEVERSION 1,13,0,487
PRODUCTVERSION 1,13,0,487
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.486\0"
VALUE "FileVersion", "1.13.0.487\0"
VALUE "InternalName", "OPOS test\0"
VALUE "LegalCopyright", "SHTRIH-M \251 2013 \0"
VALUE "OriginalFilename", "OposTest.exe\0"
......
......@@ -3919,9 +3919,14 @@ begin
FiscalPrinter.FiscalReceiptStation := FPTR_RS_RECEIPT;
FiscalPrinter.FiscalReceiptType := FPTR_RT_CORRECTION_SALE;
Check(FiscalPrinter.BeginFiscalReceipt(False));
Check(FiscalPrinter.DirectIO2(40, 1177, '77'));
Check(FiscalPrinter.DirectIO2(40, 1178, '11.05.2018'));
Check(FiscalPrinter.DirectIO2(40, 1179, '99'));
Check(FiscalPrinter.PrintRecCash(100));
Check(FiscalPrinter.PrintRecTotal(100, 100, '0'));
Check(FiscalPrinter.EndFiscalReceipt(True));
(*
// RetSale
FiscalPrinter.FiscalReceiptStation := FPTR_RS_RECEIPT;
FiscalPrinter.FiscalReceiptType := FPTR_RT_CORRECTION_RETSALE;
......@@ -3943,6 +3948,7 @@ begin
Check(FiscalPrinter.PrintRecCash(100));
Check(FiscalPrinter.PrintRecTotal(100, 100, '0'));
Check(FiscalPrinter.EndFiscalReceipt(True));
*)
end;
function TCorrectionReceiptTest.GetDisplayText: string;
......@@ -4633,8 +4639,12 @@ begin
Check(FiscalPrinter.ResetPrinter());
FiscalPrinter.FiscalReceiptType := FPTR_RT_SALES;
FiscalPrinter.BeginFiscalReceipt(True);
FiscalPrinter.PostLine := 'PostLine 1';
FiscalPrinter.PrintRecItem('1:63326 HEINZ 1000', 209, 1000, 1, 209, '');
FiscalPrinter.PostLine := 'PostLine 2';
FiscalPrinter.PrintRecItem('2:3305976 6540', 6.49, 1000, 1, 6.49, '');
FiscalPrinter.PostLine := 'PostLine 3';
FiscalPrinter.PrintRecItem('3:3148276 500', 41.9, 1000, 1, 41.9, '');
FiscalPrinter.PrintRecSubtotal(257.39);
FiscalPrinter.PrintRecSubtotalAdjustment(1, '', 0.39);
......
......@@ -598,13 +598,14 @@ type
private
FPrinter: TFiscalPrinterImpl;
function GetDevice: IFiscalPrinterDevice;
property Device: IFiscalPrinterDevice read GetDevice;
public
constructor CreateCommand(AOwner: TDIOHandlers; ACommand: Integer;
APrinter: TFiscalPrinterImpl);
procedure DirectIO(var pData: Integer; var pString: WideString); override;
property Printer: TFiscalPrinterImpl read FPrinter;
property Device: IFiscalPrinterDevice read GetDevice;
end;
{ TDIOReadFPParameter }
......
......@@ -7,7 +7,7 @@ uses
DeviceService;
const
GenericServiceVersion = deviceVersion113 + 486;
GenericServiceVersion = deviceVersion113 + 487;
implementation
......
This diff is collapsed.
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,13,0,486
PRODUCTVERSION 1,13,0,486
FILEVERSION 1,13,0,487
PRODUCTVERSION 1,13,0,487
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.486\0"
VALUE "FileVersion", "1.13.0.487\0"
VALUE "InternalName", "Fiscal printer driver\0"
VALUE "LegalCopyright", "SHTRIH-M \251 2013 \0"
VALUE "OriginalFilename", "SmFiscalPrinter.dll\0"
......
......@@ -17,6 +17,7 @@ type
FPayment: Int64;
FIsVoided: Boolean;
public
procedure BeginFiscalReceipt(PrintHeader: Boolean); override;
procedure PrintRecCash(Amount: Currency); override;
procedure PrintRecVoid(const Description: string); override;
procedure EndFiscalReceipt; override;
......@@ -79,4 +80,10 @@ begin
PrintPostLine;
end;
procedure TCorrectionReceipt.BeginFiscalReceipt(PrintHeader: Boolean);
begin
inherited;
Device.Check(Device.FSStartCorrectionReceipt);
end;
end.
......@@ -439,6 +439,7 @@ type
function IsCapEnablePrint: Boolean;
function ReadCashReg(ID: Integer; var R: TCashRegisterRec): Integer;
function FSSendTLVOperation(const Data: string): Integer;
function FSStartCorrectionReceipt: Integer;
property IsOnline: Boolean read GetIsOnline;
property Tables: TPrinterTables read FTables;
......@@ -8607,6 +8608,14 @@ begin
end;
end;
(*
, :
2 - ;
6 - ;
24 -
*)
function TFiscalPrinterDevice.SendItemBarcode(const Barcode: string;
MarkType: Integer): Integer;
var
......@@ -8625,23 +8634,23 @@ begin
case MarkType of
2:
begin //
Serial := Copy(GS1Barcode.Serial, 1, 20);
Serial := Serial + StringOfChar(' ', 20 - Length(Serial));
Data := #$00#$02 + GTIN + TTLVTag.ASCII2ValueTLV(Serial);
Serial := Copy(GS1Barcode.Serial, 1, 24);
Serial := Serial + StringOfChar(' ', 24 - Length(Serial));
Data := ReverseString(IntToBin(2, 2)) + GTIN + Serial;
Data := TTLVTag.Int2ValueTLV(1162, 2) + TTLVTag.Int2ValueTLV(Length(Data), 2) + Data;
end;
3:
begin //
Serial := Copy(GS1Barcode.Serial, 1, 13);
Serial := Serial + StringOfChar(' ', 13 - Length(Serial));
Data := #$00#$03 + GTIN + TTLVTag.ASCII2ValueTLV(Serial);
Serial := Copy(GS1Barcode.Serial, 1, 24);
Serial := Serial + StringOfChar(' ', 24 - Length(Serial));
Data := ReverseString(IntToBin(3, 2)) + GTIN + Serial;
Data := TTLVTag.Int2ValueTLV(1162, 2) + TTLVTag.Int2ValueTLV(Length(Data), 2) + Data;
end;
5:
begin //
Serial := Copy(GS1Barcode.Serial, 1, 24);
Serial := Serial + StringOfChar(' ', 24 - Length(Serial));
Data := #$00#$05 + GTIN + TTLVTag.ASCII2ValueTLV(Serial);
Data := ReverseString(IntToBin(5, 2)) + GTIN + Serial;
Data := TTLVTag.Int2ValueTLV(1162, 2) + TTLVTag.Int2ValueTLV(Length(Data), 2) + Data;
end;
else
......@@ -8662,11 +8671,27 @@ begin
Result := ExecuteData(Command, Answer);
end;
function TFiscalPrinterDevice.GetFSCloseReceiptResult2: TFSCloseReceiptResult2;
begin
Result := FFSCloseReceiptResult2;
end;
(*
FF35h . : 6 .
: 4
: FF35h : 1 .
: 1
*)
function TFiscalPrinterDevice.FSStartCorrectionReceipt: Integer;
var
Command: string;
Answer: string;
begin
Command := #$FF#$35 + IntToBin(FSysPassword, 4);
Result := ExecuteData(Command, Answer);
end;
end.
......@@ -462,6 +462,7 @@ type
function FSSendTLVOperation(const Data: string): Integer;
function SendItemBarcode(const Barcode: string; MarkType: Integer): Integer;
function GetFSCloseReceiptResult2: TFSCloseReceiptResult2;
function FSStartCorrectionReceipt: Integer;
property IsOnline: Boolean read GetIsOnline;
property Model: TPrinterModelRec read GetModel;
......
......@@ -326,6 +326,12 @@ begin
end;
end;
(*
04606203084623
+A13gPh
-4Hi7uGl
*)
function GS1DecodeBraces(const Barcode: string): string;
var
id: string;
......@@ -340,7 +346,7 @@ begin
begin
Result := '(01)' + Copy(Barcode, 1, 14) +
'(21)' + Copy(Barcode, 15, 7) +
'(291)' + Copy(Barcode, 22, Length(Barcode));
'(9099)' + Copy(Barcode, 22, Length(Barcode));
Exit;
end;
......
......@@ -12,7 +12,7 @@ unit FptrServerLib_TLB;
// ************************************************************************ //
// PASTLWTR : 1.2
// File generated on 14.03.2018 18:07:55 from Type Library described below.
// File generated on 14.05.2018 12:31:55 from Type Library described below.
// ************************************************************************ //
// Type Lib: C:\projects\OPOSShtrih\Source\SmFptrSrv\SmFptrSrv.tlb (1)
......
......@@ -115,7 +115,7 @@ AutoIncBuild=1
MajorVer=1
MinorVer=12
Release=0
Build=393
Build=395
Debug=0
PreRelease=0
Special=0
......@@ -126,7 +126,7 @@ CodePage=1252
[Version Info Keys]
CompanyName=SHTRIH-M
FileDescription=Fiscal printer print server
FileVersion=1.12.0.393
FileVersion=1.12.0.395
InternalName=Fiscal printer driver
LegalCopyright=SHTRIH-M 2013
LegalTrademarks=
......
......@@ -8,13 +8,12 @@
resources were bound to the produced executable.
*/
#define FiscalPrinterDevice_MsgInvalidParameterValue 64800
#define FiscalPrinterDevice_SSaleNotEnabled 64801
#define oleMain_S_NOERROR 64802
#define DBConsts_SBcdOverflow 64803
#define DBConsts_SInvalidBcdValue 64804
#define DBConsts_SCouldNotParseTimeStamp 64805
#define DBConsts_SInvalidSqlTimeStamp 64806
#define FiscalPrinterDevice_SSaleNotEnabled 64800
#define oleMain_S_NOERROR 64801
#define DBConsts_SBcdOverflow 64802
#define DBConsts_SInvalidBcdValue 64803
#define DBConsts_SCouldNotParseTimeStamp 64804
#define DBConsts_SInvalidSqlTimeStamp 64805
#define IdResourceStringsCore_RSTCPServerSchedulerAlreadyActive 64816
#define FiscalPrinterDevice_MsgInvalidFieldType 64817
#define FiscalPrinterDevice_MsgInvalidFieldValue 64818
......@@ -737,7 +736,6 @@
#define SysConst_SDiskFull 65535
STRINGTABLE
BEGIN
FiscalPr