@@ -47,6 +47,7 @@ TForm1 = class(TForm)
4747 Button6: TButton;
4848 rbVersion: TRadioGroup;
4949 Button7: TButton;
50+ Button8: TButton;
5051 procedure btCreateInvoiceClick (Sender: TObject);
5152 procedure FormCreate (Sender: TObject);
5253 procedure Button4Click (Sender: TObject);
@@ -59,6 +60,7 @@ TForm1 = class(TForm)
5960 procedure rbVersionClick (Sender: TObject);
6061 procedure FormDestroy (Sender: TObject);
6162 procedure Button7Click (Sender: TObject);
63+ procedure Button8Click (Sender: TObject);
6264 private
6365 WebBrowserContent : TStringList;
6466 WebBrowserContentFilename : String;
@@ -955,6 +957,108 @@ procedure TForm1.Button7Click(Sender: TObject);
955957 end ;
956958end ;
957959
960+ procedure TForm1.Button8Click (Sender: TObject);
961+ var
962+ inv : TInvoice;
963+ suc : Boolean;
964+ begin
965+ WebBrowser2.Navigate2(' about:blank' );
966+ Memo2.Clear;
967+ Memo3.Clear;
968+ btX2ConvertHTML.Visible := false;
969+
970+ MessageDlg(' Das Beispiel für eine Differenzbesteuerung ist ein Vorschlag und wurde offiziell nicht validiert.' , mtWarning, [mbOK], 0 );
971+
972+ inv := TInvoice.Create;
973+ inv.InvoiceNumber := ' R2020-0815' ;
974+ inv.InvoiceIssueDate := Date;
975+ inv.InvoiceDueDate := Date+30 ;
976+ inv.InvoicePeriodStartDate := Date-30 ;
977+ inv.InvoicePeriodEndDate := Date-1 ;
978+ inv.InvoiceTypeCode := TInvoiceTypeCode.itc_CommercialInvoice; // Schlussrechnung
979+ inv.InvoiceCurrencyCode := ' EUR' ;
980+ inv.TaxCurrencyCode := ' EUR' ;
981+ inv.BuyerReference := ' 04011000-12345-34' ; // Leitweg-ID - wird vom Rechnungsempfaenger dem Rechnungsersteller zur Verfuegung gestellt
982+ inv.Note := ' Das Fahrzeug/der Artikel ist differenzbesteuert nach §25a UStG Sonderregelung für Gebrauchtgegenstände' ;
983+
984+ inv.AccountingSupplierParty.Name := ' Verkaeufername' ;
985+ inv.AccountingSupplierParty.RegistrationName := ' Verkaeufername' ; // Sollte ausgefüllt werden
986+ inv.AccountingSupplierParty.CompanyID := ' ' ;
987+ inv.AccountingSupplierParty.Address.StreetName := ' Verkaeuferstraße 1' ;
988+ inv.AccountingSupplierParty.Address.City := ' Verkaeuferstadt' ;
989+ inv.AccountingSupplierParty.Address.PostalZone := ' 01234' ;
990+ inv.AccountingSupplierParty.Address.CountryCode := ' DE' ;
991+ inv.AccountingSupplierParty.VATCompanyID := ' DE12345678' ; // TODO mehrere Steuer-IDs
992+ inv.AccountingSupplierParty.ContactName := ' Meier' ;
993+ inv.AccountingSupplierParty.ContactTelephone := ' 030 0815' ;
994+ inv.AccountingSupplierParty.ContactElectronicMail :=
' [email protected] ' ;
995+ // BT-34 Gibt die elektronische Adresse des Verkäufers an, an die die Antwort auf eine Rechnung gesendet werden kann.
996+ // Aktuell nur Unterstuetzung fuer schemeID=EM ElectronicMail
997+ // Weitere Codes auf Anfrage
998+ // https://www.xrepository.de/details/urn:xoev-de:kosit:codeliste:eas_4#version
999+ inv.AccountingSupplierParty.ElectronicAddressSellerBuyer :=
' [email protected] ' ;
1000+
1001+ inv.AccountingCustomerParty.Name := ' Kaeufername' ;
1002+ inv.AccountingCustomerParty.RegistrationName := ' Kaeufername' ; // Sollte ausgefüllt werden
1003+ inv.AccountingCustomerParty.CompanyID := ' HRB 456' ;
1004+ inv.AccountingCustomerParty.Address.StreetName := ' Kaeuferstraße 1' ;
1005+ inv.AccountingCustomerParty.Address.City := ' Kaeuferstadt' ;
1006+ inv.AccountingCustomerParty.Address.PostalZone := ' 05678' ;
1007+ inv.AccountingCustomerParty.Address.CountryCode := ' DE' ;
1008+ inv.AccountingCustomerParty.VATCompanyID := ' DE12345678' ; // TODO mehrere Steuer-IDs
1009+ inv.AccountingCustomerParty.ContactName := ' Müller' ;
1010+ inv.AccountingCustomerParty.ContactTelephone := ' 030 1508' ;
1011+ inv.AccountingCustomerParty.ContactElectronicMail :=
' [email protected] ' ;
1012+ inv.AccountingCustomerParty.ElectronicAddressSellerBuyer :=
' [email protected] ' ;
// BT-491013+
1014+ inv.PaymentMeansCode := ipmc_SEPACreditTransfer; // Ueberweisung
1015+ inv.PaymentID := ' Verwendungszweck der Ueberweisung...R2020-0815' ;
1016+ inv.PayeeFinancialAccount := ' DE75512108001245126199' ; // dies ist eine nicht existerende aber valide IBAN als test dummy
1017+ inv.PayeeFinancialAccountName := ' Fa. XY' ;
1018+ // inv.PayeeFinancialInstitutionBranch := 'DEU...'; //BIC
1019+
1020+ inv.PaymentTermsType := iptt_Net;
1021+ inv.PaymentTermNetNote := ' Zahlbar sofort ohne Abzug.' ;
1022+
1023+ with inv.InvoiceLines.AddInvoiceLine do
1024+ begin
1025+ ID := ' 01' ; // Positionsnummer
1026+ Name := ' Fahrzeug mit Differenzbesteuerung' ; // Kurztext
1027+ Description := ' Fahrzeug mit Differenzbesteuerung' +#13 #10 +' Einkauf 4000,00 EUR' +#13 #10 +' Marge 840,34 EUR' +#13 #10 +' Verkauf Brutto 5000,00 EUR' +#13 #10 +' Enthaltene MwSt. 159,66' ; // Laengere Beschreibung
1028+ Quantity := 1 ; // Menge
1029+ UnitCode := TInvoiceUnitCodeHelper.MapUnitOfMeasure(' Stk' ,suc); // Mengeneinheit
1030+ TaxPercent := 0.0 ; // MwSt
1031+ TaxCategory := TInvoiceDutyTaxFeeCategoryCode.idtfcc_E_ExemptFromTax;
1032+ PriceAmount := 5000 ; // Einzelpreis
1033+ // TODO Preiseinheiten
1034+ BaseQuantity := 0 ; // Preiseinheit
1035+ BaseQuantityUnitCode := TInvoiceUnitCode.iuc_None; // Preiseinheit Mengeneinheit
1036+ LineAmount := 5000 ;
1037+ end ;
1038+
1039+ inv.TaxAmountTotal := 0.00 ; // Summe der gesamten MwSt
1040+ SetLength(inv.TaxAmountSubtotals,1 ); // 1 MwSt-Saetze
1041+ inv.TaxAmountSubtotals[0 ].TaxPercent := 0.0 ;
1042+ inv.TaxAmountSubtotals[0 ].TaxCategory := TInvoiceDutyTaxFeeCategoryCode.idtfcc_E_ExemptFromTax;
1043+ inv.TaxAmountSubtotals[0 ].TaxExemptionReason := ' ' ;
1044+ inv.TaxAmountSubtotals[0 ].TaxableAmount := 5000.00 ;
1045+ inv.TaxAmountSubtotals[0 ].TaxAmount := 00.00 ;
1046+
1047+ inv.LineAmount := 5000.00 ; // Summe
1048+ inv.TaxExclusiveAmount := 5000.00 ; // Summe ohne MwSt
1049+ inv.TaxInclusiveAmount := 5000.00 ; // Summe inkl MwSt
1050+ inv.AllowanceTotalAmount := 0 ; // Abzuege
1051+ inv.ChargeTotalAmount := 0 ; // Zuschlaege
1052+ inv.PrepaidAmount := 0 ; // Anzahlungen
1053+ inv.PayableAmount := 5000.00 ; // Summe Zahlbar MwSt
1054+
1055+ try
1056+ Generate(inv);
1057+ finally
1058+ inv.Free;
1059+ end ;
1060+ end ;
1061+
9581062procedure TForm1.Generate (inv: TInvoice);
9591063var
9601064 xml,cmdoutput,xmlresult,htmlresult,error : String;
0 commit comments