QuellCode/CentronERP war nur als Gitlink (Submodul-Referenz auf 79c1142) getrackt, ohne .gitmodules und ohne erreichbares Remote. Der Untersuchungsgegenstand der Versuchsreihe war damit nicht reproduzierbar gesichert: Ein Klon haette ein leeres Verzeichnis erhalten, und die Belege der 3.287 Anforderungen waeren nicht ueberpruefbar gewesen. Umstellung: - Historie nach c:\DEV\CentronERP_git_snapshot_79c1142 ausgelagert (vollstaendig lesbar, enthaelt 79c1142 und Vorgaenger 89ccfd6) - Gitlink aus dem Index entfernt - Dateiinhalt aufgenommen: 24.557 Dateien, rund 333 MB Die verschachtelte .gitignore der Codebasis gilt weiter, Build-Artefakte bleiben ausgeschlossen. Details in Versuche/Versuch_01/_Codebasis-Nachweis.md
62 lines
1.9 KiB
C#
62 lines
1.9 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.EmployeeArea;
|
|
using Centron.BusinessLogic.WebServices.Sales.Receipts.ReceiptSearch;
|
|
using Centron.Data.Entities.Administration.Logins;
|
|
using Centron.Data.WebServices.Sales.Receipts.ReceiptSearch;
|
|
using Centron.Interfaces;
|
|
using Centron.Interfaces.BL;
|
|
using Centron.Interfaces.Sales.Receipts.ReceiptSearch;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.TicketTests.Ticket129019;
|
|
|
|
public class Ticket129019Tests : EndToEndTest
|
|
{
|
|
public Ticket129019Tests(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
}
|
|
|
|
private const int InvoiceNumber = 40221;
|
|
|
|
public override void Execute()
|
|
{
|
|
this.PrepareDatabase();
|
|
|
|
// The problem in this ticket is, that you got duplicate receipts from SearchReceipts
|
|
// This happened, when you had a Projectnumber of 0, and multiple CRM-Projects with that number
|
|
|
|
var invoices = this.GetInvoices();
|
|
Assert.Single(invoices);
|
|
}
|
|
|
|
private void PrepareDatabase()
|
|
{
|
|
this.Sql($"UPDATE dbo.RechKopf SET ProjNr = 0 WHERE Nummer = {InvoiceNumber}");
|
|
}
|
|
|
|
private List<ReceiptSearchItemDTO> GetInvoices()
|
|
{
|
|
using var session = new BLSession();
|
|
|
|
var user = session.GetBL<AppUserBL>().GetAppUser(f => f.I3D == 11);
|
|
var filter = new ReceiptSearchFilter
|
|
{
|
|
ReceiptKinds = new List<CentronObjectKindNumeric>
|
|
{
|
|
CentronObjectKindNumeric.InvoiceClass
|
|
},
|
|
IncludeClosedReceipts = true,
|
|
};
|
|
|
|
var result = session.GetBL<ReceiptSearchWebServiceBL>().SearchReceipts(new LoggedInUser(user), filter, 1, int.MaxValue).ThrowIfError();
|
|
|
|
return result.Result
|
|
.Where(f => f.Number == InvoiceNumber)
|
|
.ToList();
|
|
}
|
|
} |