From d5697cfd9190a66452203a4c6661f8c1334d7e6c Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 10 Dec 2024 13:59:43 +0100 Subject: [PATCH 01/46] Erster Entwurf bzgl XRechnung: Objekte, UnitTest. --- .gitignore | 2 + BeWo/ServiceProxy/Generated.cs | 19 ++ BeWoTests.sln | 18 ++ Data/Data.csproj | 10 + Data/Models/XRechnung/XRBuyer.cs | 26 ++ Data/Models/XRechnung/XRBuyerBankAccount.cs | 16 ++ Data/Models/XRechnung/XRInvoice.cs | 25 ++ Data/Models/XRechnung/XRInvoicePayment.cs | 15 ++ Data/Models/XRechnung/XRInvoicePeriod.cs | 15 ++ Data/Models/XRechnung/XRPosition.cs | 20 ++ Data/Models/XRechnung/XRSeller.cs | 29 +++ Data/Models/XRechnung/XRSellerBankAccount.cs | 17 ++ Data/Models/XRechnung/XRSellerContact.cs | 16 ++ Data/Models/XRechnung/XRechnung.cs | 35 +++ Host/Host.csproj.user | 28 +- .../ServiceContracts/IAccountingService.cs | 241 ++++++++---------- .../AccountingServiceImp.cs | 6 + Shared/AppSender/OwnSoftSender.cs | 28 ++ Shared/DataContracts/AppRequestDC.cs | 2 +- Shared/DataContracts/AppResponseDC.cs | 2 +- .../GkvAbrechnung/GkvRequestDC.cs | 2 +- .../GkvAbrechnung/GkvResponseDC.cs | 2 +- .../Invoicing/XRechnung/XRechnungRequest.cs | 13 + .../Invoicing/XRechnung/XRechnungResponse.cs | 13 + Shared/DataContracts/OwnSoftRequest.cs | 12 + Shared/DataContracts/OwnSoftResponse.cs | 12 + Shared/Shared.csproj | 6 + XRechnung/Properties/AssemblyInfo.cs | 36 +++ XRechnung/XRechnung.csproj | 54 ++++ XRechnungUnitTest/Properties/AssemblyInfo.cs | 20 ++ XRechnungUnitTest/UnitTest1.cs | 32 +++ XRechnungUnitTest/XRechnungUnitTest.csproj | 84 ++++++ XRechnungUnitTest/invoicetest.json | 81 ++++++ XRechnungUnitTest/packages.config | 6 + 34 files changed, 806 insertions(+), 137 deletions(-) create mode 100644 Data/Models/XRechnung/XRBuyer.cs create mode 100644 Data/Models/XRechnung/XRBuyerBankAccount.cs create mode 100644 Data/Models/XRechnung/XRInvoice.cs create mode 100644 Data/Models/XRechnung/XRInvoicePayment.cs create mode 100644 Data/Models/XRechnung/XRInvoicePeriod.cs create mode 100644 Data/Models/XRechnung/XRPosition.cs create mode 100644 Data/Models/XRechnung/XRSeller.cs create mode 100644 Data/Models/XRechnung/XRSellerBankAccount.cs create mode 100644 Data/Models/XRechnung/XRSellerContact.cs create mode 100644 Data/Models/XRechnung/XRechnung.cs create mode 100644 Shared/AppSender/OwnSoftSender.cs create mode 100644 Shared/DataContracts/Invoicing/XRechnung/XRechnungRequest.cs create mode 100644 Shared/DataContracts/Invoicing/XRechnung/XRechnungResponse.cs create mode 100644 Shared/DataContracts/OwnSoftRequest.cs create mode 100644 Shared/DataContracts/OwnSoftResponse.cs create mode 100644 XRechnung/Properties/AssemblyInfo.cs create mode 100644 XRechnung/XRechnung.csproj create mode 100644 XRechnungUnitTest/Properties/AssemblyInfo.cs create mode 100644 XRechnungUnitTest/UnitTest1.cs create mode 100644 XRechnungUnitTest/XRechnungUnitTest.csproj create mode 100644 XRechnungUnitTest/invoicetest.json create mode 100644 XRechnungUnitTest/packages.config diff --git a/.gitignore b/.gitignore index 97bc03a0e..bc334f9e9 100644 --- a/.gitignore +++ b/.gitignore @@ -629,6 +629,8 @@ obj /DakotaUnitTest/obj /WohneinheitUnitTest/bin /WohneinheitUnitTest/obj +/XRechnungUnitTest/bin +/XRechnungUnitTest/obj /BeWoDatabaseTerminator/BeWoDatabaseTerminator/bin/Debug /BeWoDatabaseTerminator/BeWoDatabaseTerminator/bin/Release /ReportImp/TestLWV diff --git a/BeWo/ServiceProxy/Generated.cs b/BeWo/ServiceProxy/Generated.cs index bd7f1511c..522360ee9 100644 --- a/BeWo/ServiceProxy/Generated.cs +++ b/BeWo/ServiceProxy/Generated.cs @@ -2066,6 +2066,7 @@ namespace BeWo.ServiceProxy [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary>))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Invoicing.BankAccountDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AccountingReportDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] @@ -2100,9 +2101,13 @@ namespace BeWo.ServiceProxy [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.ServiceInvoicePeriodDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.InvoiceNumberDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AppRequestDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AppResponseDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.InvoiceType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.RequestType))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.GkvTransferResultType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Invoicing.XRechnung.XRechnungRequest))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Invoicing.XRechnung.XRechnungResponse))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvTransferProtokollDC))] @@ -6332,6 +6337,7 @@ namespace BeWo.ServiceProxy [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary>))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Invoicing.BankAccountDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AccountingReportDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] @@ -6366,9 +6372,13 @@ namespace BeWo.ServiceProxy [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.ServiceInvoicePeriodDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.InvoiceNumberDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AppRequestDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AppResponseDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.InvoiceType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.RequestType))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.GkvTransferResultType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Invoicing.XRechnung.XRechnungRequest))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Invoicing.XRechnung.XRechnungResponse))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvTransferProtokollDC))] @@ -9741,6 +9751,10 @@ namespace BeWo.ServiceProxy [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/StorniereInvoiceBasesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] void StorniereInvoiceBases(System.Collections.Generic.List invoices); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/GetXRechnung", ReplyAction="http://tempuri.org/IAccountingService/GetXRechnungResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/GetXRechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + BS.Shared.DataContracts.Invoicing.XRechnung.XRechnungResponse GetXRechnung(BS.Shared.DataContracts.Invoicing.XRechnung.XRechnungRequest req); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/GetGkvAbrechnung", ReplyAction="http://tempuri.org/IAccountingService/GetGkvAbrechnungResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/GetGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC GetGkvAbrechnung(long oid); @@ -9968,6 +9982,11 @@ namespace BeWo.ServiceProxy base.Channel.StorniereInvoiceBases(invoices); } + public BS.Shared.DataContracts.Invoicing.XRechnung.XRechnungResponse GetXRechnung(BS.Shared.DataContracts.Invoicing.XRechnung.XRechnungRequest req) + { + return base.Channel.GetXRechnung(req); + } + public BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC GetGkvAbrechnung(long oid) { return base.Channel.GetGkvAbrechnung(oid); diff --git a/BeWoTests.sln b/BeWoTests.sln index f9a4282df..6424c7787 100644 --- a/BeWoTests.sln +++ b/BeWoTests.sln @@ -43,6 +43,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Translation", "Translation" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TranslationUnitTest", "TranslationUnitTest\TranslationUnitTest.csproj", "{83C43FEC-233D-49EF-BD23-BF842A3EBDF5}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Invoicing", "Invoicing", "{67C70649-9837-49F3-982A-993DBD5A7AD3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XRechnungUnitTest", "XRechnungUnitTest\XRechnungUnitTest.csproj", "{6CED1002-FFB1-46AD-97C7-583BA11208F3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|.NET = Debug|.NET @@ -189,6 +193,18 @@ Global {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Release|Any CPU.Build.0 = Release|Any CPU {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6CED1002-FFB1-46AD-97C7-583BA11208F3}.Debug|.NET.ActiveCfg = Debug|Any CPU + {6CED1002-FFB1-46AD-97C7-583BA11208F3}.Debug|.NET.Build.0 = Debug|Any CPU + {6CED1002-FFB1-46AD-97C7-583BA11208F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6CED1002-FFB1-46AD-97C7-583BA11208F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6CED1002-FFB1-46AD-97C7-583BA11208F3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6CED1002-FFB1-46AD-97C7-583BA11208F3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6CED1002-FFB1-46AD-97C7-583BA11208F3}.Release|.NET.ActiveCfg = Release|Any CPU + {6CED1002-FFB1-46AD-97C7-583BA11208F3}.Release|.NET.Build.0 = Release|Any CPU + {6CED1002-FFB1-46AD-97C7-583BA11208F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6CED1002-FFB1-46AD-97C7-583BA11208F3}.Release|Any CPU.Build.0 = Release|Any CPU + {6CED1002-FFB1-46AD-97C7-583BA11208F3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6CED1002-FFB1-46AD-97C7-583BA11208F3}.Release|Mixed Platforms.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -207,6 +223,8 @@ Global {7630915F-DFE4-45A4-A7B1-B6D19B0126C1} = {2F7893AD-34FC-40A2-838A-3D2D8596E9AC} {B331128C-7E9F-4BDC-B509-A8DAE1B94E5C} = {CCD6B644-49E7-4A11-BD8F-607088A4AC83} {83C43FEC-233D-49EF-BD23-BF842A3EBDF5} = {B331128C-7E9F-4BDC-B509-A8DAE1B94E5C} + {67C70649-9837-49F3-982A-993DBD5A7AD3} = {CCD6B644-49E7-4A11-BD8F-607088A4AC83} + {6CED1002-FFB1-46AD-97C7-583BA11208F3} = {67C70649-9837-49F3-982A-993DBD5A7AD3} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5352BE53-F2FD-442F-85A8-4157599AA153} diff --git a/Data/Data.csproj b/Data/Data.csproj index 5465251e0..fac167435 100644 --- a/Data/Data.csproj +++ b/Data/Data.csproj @@ -392,6 +392,16 @@ + + + + + + + + + + diff --git a/Data/Models/XRechnung/XRBuyer.cs b/Data/Models/XRechnung/XRBuyer.cs new file mode 100644 index 000000000..0a5adf43c --- /dev/null +++ b/Data/Models/XRechnung/XRBuyer.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Data.Models.XRechnung +{ + public class XRBuyer + { + public string Name { get; set; } + public string ID { get; set; } + public string Street { get; set; } + public string ZipCode { get; set; } + public string City { get; set; } + public string EMail { get; set; } + public string CountryCode { get; set; } + public string Reference { get; set; } + public XRBuyerBankAccount BankAccount { get; set; } + + public XRBuyer() + { + BankAccount = new XRBuyerBankAccount(); + } + } +} diff --git a/Data/Models/XRechnung/XRBuyerBankAccount.cs b/Data/Models/XRechnung/XRBuyerBankAccount.cs new file mode 100644 index 000000000..a8dfbf08b --- /dev/null +++ b/Data/Models/XRechnung/XRBuyerBankAccount.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Data.Models.XRechnung +{ + public class XRBuyerBankAccount + { + public string IBAN { get; set; } + public string BIC { get; set; } + public string Owner { get; set; } + public string MandateID { get; set; } + } +} diff --git a/Data/Models/XRechnung/XRInvoice.cs b/Data/Models/XRechnung/XRInvoice.cs new file mode 100644 index 000000000..510e9f77f --- /dev/null +++ b/Data/Models/XRechnung/XRInvoice.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Data.Models.XRechnung +{ + public class XRInvoice + { + public string Type { get; set; } + public string Number { get; set; } + public string Date { get; set; } + public string Currency { get; set; } + public string Notice { get; set; } + public XRInvoicePeriod Peroid { get; set; } + public XRInvoicePayment Payment { get; set; } + + public XRInvoice() + { + Peroid = new XRInvoicePeriod(); + Payment = new XRInvoicePayment(); + } + } +} diff --git a/Data/Models/XRechnung/XRInvoicePayment.cs b/Data/Models/XRechnung/XRInvoicePayment.cs new file mode 100644 index 000000000..94055a797 --- /dev/null +++ b/Data/Models/XRechnung/XRInvoicePayment.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Data.Models.XRechnung +{ + public class XRInvoicePayment + { + public string Type { get; set; } + public string Term { get; set; } + public string DueDate { get; set; } + } +} diff --git a/Data/Models/XRechnung/XRInvoicePeriod.cs b/Data/Models/XRechnung/XRInvoicePeriod.cs new file mode 100644 index 000000000..0bbbde108 --- /dev/null +++ b/Data/Models/XRechnung/XRInvoicePeriod.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Data.Models.XRechnung +{ + public class XRInvoicePeriod + { + public string Start { get; set; } + public string End { get; set; } + public string Description { get; set; } + } +} diff --git a/Data/Models/XRechnung/XRPosition.cs b/Data/Models/XRechnung/XRPosition.cs new file mode 100644 index 000000000..c076b298c --- /dev/null +++ b/Data/Models/XRechnung/XRPosition.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Data.Models.XRechnung +{ + public class XRPosition + { + public string Quantity { get; set; } + public string QuantityType { get; set; } + public string Text { get; set; } + public string Net { get; set; } + public string NetTotal { get; set; } + public string Tax { get; set; } + public string TaxSum { get; set; } + public string TaxType { get; set; } + } +} diff --git a/Data/Models/XRechnung/XRSeller.cs b/Data/Models/XRechnung/XRSeller.cs new file mode 100644 index 000000000..c425125fd --- /dev/null +++ b/Data/Models/XRechnung/XRSeller.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Data.Models.XRechnung +{ + public class XRSeller + { + public string Name { get; set; } + public string ID { get; set; } + public string TaxID { get; set; } + public string VatID { get; set; } + public string Street { get; set; } + public string ZipCode { get; set; } + public string City { get; set; } + public string EMail { get; set; } + public string CountryCode { get; set; } + public XRSellerContact Contact { get; set; } + public XRSellerBankAccount BankAccount { get; set; } + + public XRSeller() + { + Contact = new XRSellerContact(); + BankAccount = new XRSellerBankAccount(); + } + } +} diff --git a/Data/Models/XRechnung/XRSellerBankAccount.cs b/Data/Models/XRechnung/XRSellerBankAccount.cs new file mode 100644 index 000000000..a2517361f --- /dev/null +++ b/Data/Models/XRechnung/XRSellerBankAccount.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Data.Models.XRechnung +{ + public class XRSellerBankAccount + { + public string IBAN { get; set; } + public string BIC { get; set; } + public string Owner { get; set; } + public string Reference { get; set; } + public string ReferenceID { get; set; } + } +} diff --git a/Data/Models/XRechnung/XRSellerContact.cs b/Data/Models/XRechnung/XRSellerContact.cs new file mode 100644 index 000000000..e85ba8ae4 --- /dev/null +++ b/Data/Models/XRechnung/XRSellerContact.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Data.Models.XRechnung +{ + public class XRSellerContact + { + public string Name { get; set; } + public string Department { get; set; } + public string Phone { get; set; } + public string EMail { get; set; } + } +} diff --git a/Data/Models/XRechnung/XRechnung.cs b/Data/Models/XRechnung/XRechnung.cs new file mode 100644 index 000000000..8ffadcc8d --- /dev/null +++ b/Data/Models/XRechnung/XRechnung.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Data.Models.XRechnung +{ + public class XRechnung + { + public XRInvoice Invoice { get; set; } + public XRSeller Seller { get; set; } + public XRBuyer Buyer { get; set; } + public List Position { get; set; } + + public XRechnung() + { + Invoice = new XRInvoice(); + Seller = new XRSeller(); + Buyer = new XRBuyer(); + Position = new List(); + } + + //public static XRechnung GetExample() + //{ + // var xrec = new XRechnung(); + + // xrec.Invoice.Type = "380"; + // xrec.Invoice.Number = "BWP28418"; + // xrec.Invoice.Date = "20141002"; + // xrec.Invoice.Currency = "EUR"; + // xrec.Invoice.Notice = "Rechnung gemäß Bestellung vom 01.03.2018."; + //} + } +} diff --git a/Host/Host.csproj.user b/Host/Host.csproj.user index b2e12d1fa..05b240bab 100644 --- a/Host/Host.csproj.user +++ b/Host/Host.csproj.user @@ -3,7 +3,7 @@ BeWo2.0 true - Release|Any CPU + Debug|Any CPU false @@ -12,5 +12,29 @@ ProjectFiles - + + + + + + + CurrentPage + True + False + False + False + + + + + + + + + True + False + + + + \ No newline at end of file diff --git a/Service/ServiceContracts/IAccountingService.cs b/Service/ServiceContracts/IAccountingService.cs index 90f31269e..fe2192efb 100644 --- a/Service/ServiceContracts/IAccountingService.cs +++ b/Service/ServiceContracts/IAccountingService.cs @@ -6,171 +6,150 @@ using BS.Shared; using BS.Shared.Core; using BS.Shared.DataContracts; using BS.Shared.DataContracts.GkvAbrechnung; +using BS.Shared.DataContracts.Invoicing.XRechnung; using BS.Shared.DataContracts.Reports; namespace BeWo.Service.ServiceContracts { - [ServiceContract] - public interface IAccountingService - { - [FaultContract(typeof(BeWoFault))] - [OperationContract] - void DeactivateInvoiceBases(List invoices); + [ServiceContract] + public interface IAccountingService + { + [FaultContract(typeof(BeWoFault))] + [OperationContract] + void DeactivateInvoiceBases(List invoices); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - void DeactivateServiceInvoices(List invoices); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + void DeactivateServiceInvoices(List invoices); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - void DeactivateSettlementInvoice(List invoices); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + void DeactivateSettlementInvoice(List invoices); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GenerateInitialServiceInvoices(long costBearerOid, long? supportConceptOid, DateTimeSpan invoicePeriod); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GenerateInitialServiceInvoices(long costBearerOid, long? supportConceptOid, DateTimeSpan invoicePeriod); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetAllActiveInvoiceBases(); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetAllActiveInvoiceBases(); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetInvoiceBases(DateTime? startDate, DateTime? endDate); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetInvoiceBases(DateTime? startDate, DateTime? endDate); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetInvoiceBases2(DateTime? startDate, DateTime? endDate, bool filterByInvoiceDate); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetInvoiceBases2(DateTime? startDate, DateTime? endDate, bool filterByInvoiceDate); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetInvoiceBasesForCostBearerAndId(DateTime? startDate, DateTime? endDate, long costBearerOid, String invoiceId); - - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetInvoiceBasesForCostBearerAndIdAndIsUsed(DateTime? startDate, DateTime? endDate, long costBearerOid, String invoiceId); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetInvoiceBasesForCostBearerAndId(DateTime? startDate, DateTime? endDate, long costBearerOid, String invoiceId); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetGeneralInvoiceBasesForCustomer(long customerOid); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetInvoiceBasesForCostBearerAndIdAndIsUsed(DateTime? startDate, DateTime? endDate, long costBearerOid, String invoiceId); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetGeneralInvoiceBasesForOrganisation(long organisationOid); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetGeneralInvoiceBasesForCustomer(long customerOid); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetGeneralInvoiceBasesForPerson(long personOid); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetGeneralInvoiceBasesForOrganisation(long organisationOid); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetInvoiceBasesForSupportConcept(InvoiceType type, long supportConceptOid); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetGeneralInvoiceBasesForPerson(long personOid); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - ServiceInvoiceDC GetServiceInvoiceByInvoiceBaseOid(long invoiceBaseOid); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetInvoiceBasesForSupportConcept(InvoiceType type, long supportConceptOid); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetServiceInvoices(long costBearerOid, long? supportConceptOid, DateTimeSpan period); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + ServiceInvoiceDC GetServiceInvoiceByInvoiceBaseOid(long invoiceBaseOid); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - Settlement2DC GetSettlementByInvoiceBaseOid(long invoiceBaseOid); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetServiceInvoices(long costBearerOid, long? supportConceptOid, DateTimeSpan period); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetSettlementInvoicesForCostBearerAndPeriod(long costBearerOid, DateTime periodStart, DateTime periodEnd); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + Settlement2DC GetSettlementByInvoiceBaseOid(long invoiceBaseOid); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetSettlementInvoicesForSupportConcept(long supportConceptOid); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetSettlementInvoicesForCostBearerAndPeriod(long costBearerOid, DateTime periodStart, DateTime periodEnd); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List InsertNewInvoiceBases(List invoices); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetSettlementInvoicesForSupportConcept(long supportConceptOid); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List InsertNewServiceInvoices(List invoices); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List InsertNewInvoiceBases(List invoices); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List InsertNewSettlementInvoice(List invoices); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List InsertNewServiceInvoices(List invoices); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - InvoiceBaseDC LoadInvoiceBaseByOid(long invoiceBaseOid); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List InsertNewSettlementInvoice(List invoices); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - InvoiceNumberDC LoadInvoiceNumber(); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + InvoiceBaseDC LoadInvoiceBaseByOid(long invoiceBaseOid); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - ServiceInvoiceDC LoadServiceInvoiceByOid(long serviceInvoiceOid); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + InvoiceNumberDC LoadInvoiceNumber(); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List UpdateInvoiceBases(List invoices); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + ServiceInvoiceDC LoadServiceInvoiceByOid(long serviceInvoiceOid); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List SetInvoicePaid(List invoices, bool isPaid); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List UpdateInvoiceBases(List invoices); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - InvoiceNumberDC UpdateInvoiceNumber(InvoiceNumberDC dc); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List SetInvoicePaid(List invoices, bool isPaid); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List UpdateServiceInvoices(List invoices); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + InvoiceNumberDC UpdateInvoiceNumber(InvoiceNumberDC dc); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - void UpdateSettlementInvoice(List invoices); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List UpdateServiceInvoices(List invoices); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List LoadInvoiceNumberList(); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + void UpdateSettlementInvoice(List invoices); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List UpdateInvoiceNumberList(List dclist); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List LoadInvoiceNumberList(); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - void StorniereInvoiceBases(List invoices); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List UpdateInvoiceNumberList(List dclist); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - GkvAbrechnungDC GetGkvAbrechnung(long oid); + [FaultContract(typeof(BeWoFault))] + [OperationContract] + void StorniereInvoiceBases(List invoices); - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetAllGkvAbrechnungen(); - - [FaultContract(typeof(BeWoFault))] - [OperationContract] - List GetFilteredGkvAbrechnungen(GkvAbrechnungViewFilterDC gkvAbrechnungViewFilter); - - [FaultContract(typeof(BeWoFault))] - [OperationContract] - GkvAbrechnungCreateResponseDC CreateNewGkvAbrechnung(GkvAbrechnungCreateRequestDC request); - - [FaultContract(typeof(BeWoFault))] - [OperationContract] - GkvAbrechnungDC UpdateGkvAbrechnung(GkvAbrechnungDC abrechnung); - - [FaultContract(typeof(BeWoFault))] - [OperationContract] - void DeleteGkvAbrechnung(GkvAbrechnungDC abrechnung); - - [FaultContract(typeof(BeWoFault))] - [OperationContract] - GkvAbrechnungSendResponseDC SendNewGkvAbrechnung(GkvAbrechnungSendRequestDC req); - - [FaultContract(typeof(BeWoFault))] - [OperationContract] - GkvAbrechnungGetIKResponseDC SendGetIKRequest(GkvAbrechnungGetIKRequestDC req); - } + [FaultContract(typeof(BeWoFault))] [OperationContract] XRechnungResponse GetXRechnung(XRechnungRequest req); + [FaultContract(typeof(BeWoFault))] [OperationContract] GkvAbrechnungDC GetGkvAbrechnung(long oid); + [FaultContract(typeof(BeWoFault))] [OperationContract] List GetAllGkvAbrechnungen(); + [FaultContract(typeof(BeWoFault))] [OperationContract] List GetFilteredGkvAbrechnungen(GkvAbrechnungViewFilterDC gkvAbrechnungViewFilter); + [FaultContract(typeof(BeWoFault))] [OperationContract] GkvAbrechnungCreateResponseDC CreateNewGkvAbrechnung(GkvAbrechnungCreateRequestDC request); + [FaultContract(typeof(BeWoFault))] [OperationContract] GkvAbrechnungDC UpdateGkvAbrechnung(GkvAbrechnungDC abrechnung); + [FaultContract(typeof(BeWoFault))] [OperationContract] void DeleteGkvAbrechnung(GkvAbrechnungDC abrechnung); + [FaultContract(typeof(BeWoFault))] [OperationContract] GkvAbrechnungSendResponseDC SendNewGkvAbrechnung(GkvAbrechnungSendRequestDC req); + [FaultContract(typeof(BeWoFault))] [OperationContract] GkvAbrechnungGetIKResponseDC SendGetIKRequest(GkvAbrechnungGetIKRequestDC req); + } } \ No newline at end of file diff --git a/Service/ServiceImplementations/AccountingServiceImp.cs b/Service/ServiceImplementations/AccountingServiceImp.cs index 9e4daf50f..7a4d1e066 100644 --- a/Service/ServiceImplementations/AccountingServiceImp.cs +++ b/Service/ServiceImplementations/AccountingServiceImp.cs @@ -28,6 +28,7 @@ using BS.Shared.Extensions; using BS.Shared.Exceptions; using BS.Shared.AppSender; using BeWo.Data.Security; +using BS.Shared.DataContracts.Invoicing.XRechnung; namespace BeWo.Service.ServiceImplementations { @@ -746,6 +747,11 @@ namespace BeWo.Service.ServiceImplementations } } + public XRechnungResponse GetXRechnung(XRechnungRequest req) + { + return null; + } + #region GKV public GkvAbrechnungDC GetGkvAbrechnung(long oid) { diff --git a/Shared/AppSender/OwnSoftSender.cs b/Shared/AppSender/OwnSoftSender.cs new file mode 100644 index 000000000..ad058b504 --- /dev/null +++ b/Shared/AppSender/OwnSoftSender.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; + +namespace BS.Shared.AppSender +{ + public static class OwnSoftSender + { + public static string Send(string url, string dataString) + { + string response; + + using (WebClient client = new WebClient()) + { + client.Encoding = Encoding.UTF8; + + client.Headers.Add(HttpRequestHeader.ContentType, "application/xml"); + + response = client.UploadString(url, "POST", dataString); + } + + return response; + } + } +} diff --git a/Shared/DataContracts/AppRequestDC.cs b/Shared/DataContracts/AppRequestDC.cs index 2b3508d1e..9363cfa95 100644 --- a/Shared/DataContracts/AppRequestDC.cs +++ b/Shared/DataContracts/AppRequestDC.cs @@ -11,7 +11,7 @@ namespace BS.Shared.DataContracts /// Kann per RequestSender gesendet werden und als ResponseDC empfangen wird. /// [DataContract] - public abstract class AppRequestDC : IDataContract + public abstract class AppRequestDC { public AppRequestDC(RequestType type) { diff --git a/Shared/DataContracts/AppResponseDC.cs b/Shared/DataContracts/AppResponseDC.cs index 90994c38b..ac01ac7e9 100644 --- a/Shared/DataContracts/AppResponseDC.cs +++ b/Shared/DataContracts/AppResponseDC.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; namespace BS.Shared.DataContracts { [DataContract] - public abstract class AppResponseDC : IDataContract + public abstract class AppResponseDC { [DataMember] public bool Success { get; set; } [DataMember] public string Message { get; set; } diff --git a/Shared/DataContracts/GkvAbrechnung/GkvRequestDC.cs b/Shared/DataContracts/GkvAbrechnung/GkvRequestDC.cs index 215005839..92bda6b46 100644 --- a/Shared/DataContracts/GkvAbrechnung/GkvRequestDC.cs +++ b/Shared/DataContracts/GkvAbrechnung/GkvRequestDC.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; namespace BS.Shared.DataContracts.GkvAbrechnung { [DataContract] - public class GkvRequestDC : AppRequestDC + public class GkvRequestDC : AppRequestDC, IDataContract { public GkvRequestDC() : base(RequestType.Default) { } diff --git a/Shared/DataContracts/GkvAbrechnung/GkvResponseDC.cs b/Shared/DataContracts/GkvAbrechnung/GkvResponseDC.cs index 8e51ff31d..233880a43 100644 --- a/Shared/DataContracts/GkvAbrechnung/GkvResponseDC.cs +++ b/Shared/DataContracts/GkvAbrechnung/GkvResponseDC.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; namespace BS.Shared.DataContracts.GkvAbrechnung { [DataContract] - public class GkvResponseDC : AppResponseDC + public class GkvResponseDC : AppResponseDC, IDataContract { public GkvResponseDC() : base(false) { } public GkvResponseDC(bool success) : base(success) { } diff --git a/Shared/DataContracts/Invoicing/XRechnung/XRechnungRequest.cs b/Shared/DataContracts/Invoicing/XRechnung/XRechnungRequest.cs new file mode 100644 index 000000000..b5bdf1e94 --- /dev/null +++ b/Shared/DataContracts/Invoicing/XRechnung/XRechnungRequest.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BS.Shared.DataContracts.Invoicing.XRechnung +{ + public class XRechnungRequest : OwnSoftRequest + { + public string Data { get; set; } + } +} diff --git a/Shared/DataContracts/Invoicing/XRechnung/XRechnungResponse.cs b/Shared/DataContracts/Invoicing/XRechnung/XRechnungResponse.cs new file mode 100644 index 000000000..42569e864 --- /dev/null +++ b/Shared/DataContracts/Invoicing/XRechnung/XRechnungResponse.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BS.Shared.DataContracts.Invoicing.XRechnung +{ + public class XRechnungResponse : OwnSoftResponse + { + + } +} diff --git a/Shared/DataContracts/OwnSoftRequest.cs b/Shared/DataContracts/OwnSoftRequest.cs new file mode 100644 index 000000000..dd5b0dccf --- /dev/null +++ b/Shared/DataContracts/OwnSoftRequest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BS.Shared.DataContracts +{ + public class OwnSoftRequest + { + } +} diff --git a/Shared/DataContracts/OwnSoftResponse.cs b/Shared/DataContracts/OwnSoftResponse.cs new file mode 100644 index 000000000..58720b6ab --- /dev/null +++ b/Shared/DataContracts/OwnSoftResponse.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BS.Shared.DataContracts +{ + public class OwnSoftResponse + { + } +} diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index 8285ee89e..2bc0ba8d8 100644 --- a/Shared/Shared.csproj +++ b/Shared/Shared.csproj @@ -133,6 +133,7 @@ + @@ -190,6 +191,10 @@ + + + + @@ -535,6 +540,7 @@ + - + - + - + - - - - - + + + + + - + - + - - - - - + + + + - - - - + + + + - - + + - - - - - - + + + + + + + diff --git a/BeWo/View/Detail/Accounting/InvoiceOverview.xaml.cs b/BeWo/View/Detail/Accounting/InvoiceOverview.xaml.cs index 3c1bce601..89242ba9d 100644 --- a/BeWo/View/Detail/Accounting/InvoiceOverview.xaml.cs +++ b/BeWo/View/Detail/Accounting/InvoiceOverview.xaml.cs @@ -10,6 +10,7 @@ using System.Windows.Navigation; using System.Windows.Threading; using BeWo.Core; using BeWo.ServiceProxy; +using BeWo.View.Controls; using BeWo.ViewModel; using BeWo.ViewModel.ListViewModel; @@ -21,6 +22,7 @@ using BS.Shared.Translation; using DevExpress.Xpf.Editors; using DevExpress.Xpf.Grid; using Microsoft.Win32; +using Newtonsoft.Json; namespace BeWo.View.Detail.Accounting { @@ -624,5 +626,16 @@ namespace BeWo.View.Detail.Accounting return list; } + + private void button_eRechnung_Click(object sender, RoutedEventArgs e) + { + var res = ServiceFacade.DoAccountingServiceSync(x => x.GetXRechnung(null)); + + if (res.HasErrors) + BeWoApp.ShowErrorMessage("Fehler: " + res.ResponseString); + else + BeWoUtils.ShowPdfWindow(res.ResponseBytes); + + } } } \ No newline at end of file diff --git a/Service/ServiceImplementations/AccountingServiceImp.cs b/Service/ServiceImplementations/AccountingServiceImp.cs index 36c7a1907..38771203d 100644 --- a/Service/ServiceImplementations/AccountingServiceImp.cs +++ b/Service/ServiceImplementations/AccountingServiceImp.cs @@ -30,6 +30,8 @@ using BS.Shared.AppSender; using BeWo.Data.Security; using BeWo.Data.Models.XRechnung; using BS.Shared.DataContracts.Invoicing.XRechnung; +using BeWo.Service.ServiceUtils.XRechnung; +using System.IO; namespace BeWo.Service.ServiceImplementations { @@ -750,7 +752,21 @@ namespace BeWo.Service.ServiceImplementations public XRechnungResponse GetXRechnung(XRechnungRequest req) { - return null; + try + { + var str = File.ReadAllText(@"C:\dev\invoicetest.json", System.Text.Encoding.UTF8); + var xrec = JsonConvert.DeserializeObject(str); + + var url = "https://app5.bewoplaner.de/service/DownloadFile.aspx?key=jhkf4589141324h6543958"; + + var response = XRechnungSender.Send(xrec, url); + + return response; + } + catch (Exception e) + { + throw Utils.CreateBeWoFaultException(e); + } } #region GKV diff --git a/Shared/DataContracts/AppResponseDC.cs b/Shared/DataContracts/AppResponseDC.cs index ac01ac7e9..90994c38b 100644 --- a/Shared/DataContracts/AppResponseDC.cs +++ b/Shared/DataContracts/AppResponseDC.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; namespace BS.Shared.DataContracts { [DataContract] - public abstract class AppResponseDC + public abstract class AppResponseDC : IDataContract { [DataMember] public bool Success { get; set; } [DataMember] public string Message { get; set; } diff --git a/Shared/DataContracts/Invoicing/XRechnung/XRechnungRequest.cs b/Shared/DataContracts/Invoicing/XRechnung/XRechnungRequest.cs index a34931014..e8b5c3f19 100644 --- a/Shared/DataContracts/Invoicing/XRechnung/XRechnungRequest.cs +++ b/Shared/DataContracts/Invoicing/XRechnung/XRechnungRequest.cs @@ -3,6 +3,7 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; @@ -10,9 +11,8 @@ namespace BS.Shared.DataContracts.Invoicing.XRechnung { public class XRechnungRequest : OwnSoftRequest { - public string XRechnung { get; set; } - - public string Url { get; set; } + [DataMember] public string XRechnung { get; set; } + [DataMember] public string Url { get; set; } public void SetXRechnung(object obj) { diff --git a/Shared/DataContracts/Invoicing/XRechnung/XRechnungResponse.cs b/Shared/DataContracts/Invoicing/XRechnung/XRechnungResponse.cs index 2d537b8ce..ff7ea8de5 100644 --- a/Shared/DataContracts/Invoicing/XRechnung/XRechnungResponse.cs +++ b/Shared/DataContracts/Invoicing/XRechnung/XRechnungResponse.cs @@ -3,6 +3,7 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; @@ -10,13 +11,18 @@ namespace BS.Shared.DataContracts.Invoicing.XRechnung { public class XRechnungResponse : OwnSoftResponse { - public byte[] ResponseBytes { get; set; } - public string ResponseString { get; set; } - public List Errors { get; set; } + [DataMember] public byte[] ResponseBytes { get; set; } + [DataMember] public string ResponseString { get; set; } + [DataMember] public List Errors { get; set; } public bool HasErrors => Errors is object && Errors.Any(); - private XRechnungResponse(byte[] res_bytes) + private XRechnungResponse() + { + + } + + private XRechnungResponse(byte[] res_bytes) : this() { ResponseBytes = res_bytes; } diff --git a/Shared/DataContracts/OwnSoftRequest.cs b/Shared/DataContracts/OwnSoftRequest.cs index dd5b0dccf..6fbb46896 100644 --- a/Shared/DataContracts/OwnSoftRequest.cs +++ b/Shared/DataContracts/OwnSoftRequest.cs @@ -1,12 +1,14 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace BS.Shared.DataContracts { - public class OwnSoftRequest + [DataContract] + public class OwnSoftRequest : IDataContract { } } diff --git a/Shared/DataContracts/OwnSoftResponse.cs b/Shared/DataContracts/OwnSoftResponse.cs index 58720b6ab..bd8441d77 100644 --- a/Shared/DataContracts/OwnSoftResponse.cs +++ b/Shared/DataContracts/OwnSoftResponse.cs @@ -1,12 +1,14 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace BS.Shared.DataContracts { - public class OwnSoftResponse + [DataContract] + public class OwnSoftResponse : IDataContract { } } From f1cc096810fa69056612ab998ab916ad2c770dc1 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Wed, 29 Jan 2025 10:47:18 +0100 Subject: [PATCH 09/46] Remote Test --- BeWo/Core/BeWoUtils.cs | 2 +- BeWo/DebugConfig.cs | 3 ++ .../Detail/Accounting/InvoiceOverview.xaml | 13 +++++++ .../Detail/Accounting/InvoiceOverview.xaml.cs | 8 +++-- BeWo/app.config | 4 +-- Data/ASPHibernateSessionManager.cs | 21 ++++++++++++ Host/DownloadFile.aspx.cs | 5 +++ Host/GkvAbrechnungClient.aspx.cs | 6 +++- Host/ReportView.aspx.cs | 3 +- Host/Web.config | 1 + Service/Ressources/invoicetest.json | 1 + Service/Service.csproj | 3 +- .../AccountingServiceImp.cs | 10 ++++-- .../DownloadServiceImp.cs | 10 ++++++ Service/ServiceUtils/ServiceConfigReader.cs | 31 +++++++++++++++++ Shared/Core/TokenUtils.cs | 34 +++++++++++++++++++ Shared/DataContracts/InvoiceBaseDC.cs | 19 ++++++----- Shared/Shared.csproj | 1 + 18 files changed, 156 insertions(+), 19 deletions(-) create mode 100644 Service/Ressources/invoicetest.json create mode 100644 Service/ServiceUtils/ServiceConfigReader.cs create mode 100644 Shared/Core/TokenUtils.cs diff --git a/BeWo/Core/BeWoUtils.cs b/BeWo/Core/BeWoUtils.cs index e211ad2ae..2c75b492d 100644 --- a/BeWo/Core/BeWoUtils.cs +++ b/BeWo/Core/BeWoUtils.cs @@ -279,7 +279,7 @@ namespace BeWo.Core return navigateUri.Split('?')[0] + "?" + uriValues; } - private static string RefreshNavigateUriString(string navigateUri) + public static string RefreshNavigateUriString(string navigateUri) { if (navigateUri.Contains("tenant")) navigateUri = RemoveAuthenticationInfoFromUri(navigateUri); diff --git a/BeWo/DebugConfig.cs b/BeWo/DebugConfig.cs index 547d40d47..2b24737d3 100644 --- a/BeWo/DebugConfig.cs +++ b/BeWo/DebugConfig.cs @@ -138,6 +138,9 @@ namespace BeWo AutoLogin = true, SelectView = UIContext.Finance, SelectIndex = 7, + Username = "m1", + Password = "bewobewo", + Profilename = "5000000000" }); return name2config; diff --git a/BeWo/View/Detail/Accounting/InvoiceOverview.xaml b/BeWo/View/Detail/Accounting/InvoiceOverview.xaml index 797a1ca55..38bb7346a 100644 --- a/BeWo/View/Detail/Accounting/InvoiceOverview.xaml +++ b/BeWo/View/Detail/Accounting/InvoiceOverview.xaml @@ -123,6 +123,19 @@ +