From e5ae2add161fcfc636982bc82cea3f28d1cf7b45 Mon Sep 17 00:00:00 2001 From: Sven Harazim Date: Tue, 10 Nov 2020 12:31:13 +0100 Subject: [PATCH] bugfix --- Samples/XRechnungUnit1.pas | 12 ++---------- intf.Invoice.pas | 6 ++++++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Samples/XRechnungUnit1.pas b/Samples/XRechnungUnit1.pas index aee2c69..b251f70 100644 --- a/Samples/XRechnungUnit1.pas +++ b/Samples/XRechnungUnit1.pas @@ -109,8 +109,6 @@ procedure TForm1.Button1Click(Sender: TObject); Memo1.Clear; Memo2.Clear; Memo3.Clear; - pnStartDragX122.Visible := false; - pnStartDragX200.Visible := false; btX122ConvertHTML.Visible := false; btX200ConvertHTML.Visible := false; @@ -210,8 +208,6 @@ procedure TForm1.Button3Click(Sender: TObject); Memo1.Clear; Memo2.Clear; Memo3.Clear; - pnStartDragX122.Visible := false; - pnStartDragX200.Visible := false; btX122ConvertHTML.Visible := false; btX200ConvertHTML.Visible := false; @@ -460,8 +456,6 @@ procedure TForm1.Button4Click(Sender: TObject); Memo1.Clear; Memo2.Clear; Memo3.Clear; - pnStartDragX122.Visible := false; - pnStartDragX200.Visible := false; btX122ConvertHTML.Visible := false; btX200ConvertHTML.Visible := false; @@ -673,8 +667,7 @@ procedure TForm1.Generate122(inv: TInvoice); Doc.Close; end; Memo1.Lines.Text := hstr; - pnStartDragX122.Visible := FileExists(ExtractFilePath(Application.ExeName)+'XRechnung-UBL-122.xml'); - btX122ConvertHTML.Visible := pnStartDragX122.Visible; + btX122ConvertHTML.Visible := FileExists(ExtractFilePath(Application.ExeName)+'XRechnung-UBL-122.xml'); end; procedure TForm1.Generate200(inv: TInvoice); @@ -696,8 +689,7 @@ procedure TForm1.Generate200(inv: TInvoice); Doc.Close; end; Memo2.Lines.Text := hstr; - pnStartDragX200.Visible := FileExists(ExtractFilePath(Application.ExeName)+'XRechnung-UBL-200.xml'); - btX200ConvertHTML.Visible := pnStartDragX200.Visible; + btX200ConvertHTML.Visible := FileExists(ExtractFilePath(Application.ExeName)+'XRechnung-UBL-200.xml'); end; end. diff --git a/intf.Invoice.pas b/intf.Invoice.pas index d85e38f..8a76e56 100644 --- a/intf.Invoice.pas +++ b/intf.Invoice.pas @@ -443,6 +443,12 @@ class function TInvoiceUnitCodeHelper.MapUnitOfMeasure(const _UnitOfMeasure: Str _Success := false; if _UnitOfMeasure.IsEmpty then exit; + if SameText(_UnitOfMeasure,'st') or SameText(_UnitOfMeasure,'stk.') or SameText(_UnitOfMeasure,'stk') then + begin + result := iuc_piece; + _Success := true; + exit; + end; if SameText(_UnitOfMeasure,'std') or SameText(_UnitOfMeasure,'std.') then begin result := iuc_hour;