Files
BeWoPlaner/Service/ServiceImplementations/Enhanced/AccountingEnhancedServiceImp.cs

50 lines
1.6 KiB
C#
Raw Normal View History

using BeWo.Data;
using BeWo.Data.Access;
2025-03-28 10:05:29 +01:00
using BeWo.Data.Entities;
using BeWo.Data.Models.XRechnung;
using BeWo.Data.Security;
using BeWo.Service.DCEntityMapper;
2025-06-02 11:16:35 +02:00
using BeWo.Service.ServiceContracts.Enhanced;
2025-03-19 16:30:27 +01:00
using BeWo.Service.ServiceProxy;
using BeWo.Service.ServiceUtils;
using BeWo.Service.ServiceUtils.XRechnung;
using BS.Shared;
2025-03-19 16:30:27 +01:00
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.DataContracts.Invoicing.XRechnung;
2025-03-28 10:05:29 +01:00
using BS.Shared.DataContracts.MikePHPContracts;
using DevExpress.Entity.Model.Metadata;
2025-03-28 10:05:29 +01:00
using Newtonsoft.Json;
2025-03-19 09:35:01 +01:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
2025-03-19 09:35:01 +01:00
using System.ServiceModel;
using System.Text;
2025-04-08 10:22:22 +02:00
using System.Threading;
2025-03-19 09:35:01 +01:00
using System.Threading.Tasks;
2025-06-02 11:16:35 +02:00
namespace BeWo.Service.ServiceImplementations.Enhanced
2025-03-19 09:35:01 +01:00
{
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]
2025-06-02 11:16:35 +02:00
public class AccountingEnhancedServiceImp : IAccountingEnhancedService
2025-03-19 09:35:01 +01:00
{
2025-06-02 11:16:35 +02:00
public byte[] CreateXRechnung(long invoice_base_oid, int report_type, string report_url)
{
if (string.IsNullOrWhiteSpace(report_url))
throw new ArgumentNullException(nameof(report_url));
// Berechne XRechnung
var str = ServiceConfigReader.GetInvoiceTestJsonString();
// Erstelle Url ohne weitere Authentifizierung
var download_url = report_url + "&mode=pdf";
var token_url = (new DownloadServiceImp()).CreateTemporaryUrl(download_url, false);
var response = ServiceFacade.XRechnung.Create(str, token_url);
return response;
}
2025-03-19 09:35:01 +01:00
}
}