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
83 lines
2.9 KiB
C#
83 lines
2.9 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.Sales.Receipts.DataAndResults;
|
|
using Centron.BusinessLogic.WebServices.Sales.Receipts;
|
|
using Centron.Data.WebServices.Sales.Receipts.Orders;
|
|
using Centron.Interfaces;
|
|
using Centron.Interfaces.BL;
|
|
using Centron.Interfaces.Sales.Receipts.InsertReceipts;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using CentronSoftware.Centron.WebServices.EntitiesWrongPlace.Sales.Receipts.DataAndResults;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.TicketTests.Ticket133706;
|
|
|
|
public class Ticket133706Tests : EndToEndTest
|
|
{
|
|
public Ticket133706Tests(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
}
|
|
|
|
public const int OfferI3D = 5503;
|
|
public const int OfferItemI3D = 14441;
|
|
|
|
public override void Execute()
|
|
{
|
|
// In this ticket 133706, the problem is:
|
|
// When copying a existing receipt, we don't take over the IReceiptItemWithPurchaseInformation and IReceiptItemWithPurchaseOrderNumber
|
|
// But we do take them over, when forwarding it by Reference
|
|
|
|
this.PrepareDatabase();
|
|
|
|
this.ForwardReceipt(InsertReceiptTakeoverOptions.Copy);
|
|
this.ForwardReceipt(InsertReceiptTakeoverOptions.Reference);
|
|
}
|
|
|
|
private void PrepareDatabase()
|
|
{
|
|
this.Sql($"UPDATE dbo.AngPos SET Bestellinformation = 'Bestellinfo', BestellNr = 'Bestellnummer!' WHERE I3D = {OfferItemI3D}");
|
|
}
|
|
|
|
private void ForwardReceipt(InsertReceiptTakeoverOptions takeoverOption)
|
|
{
|
|
using var session = new BLSession();
|
|
|
|
var forwardResult = session.GetBL<ReceiptWebServiceBL>().ForwardReceipt(
|
|
CentronObjectKindNumeric.OrderClass,
|
|
this.GetLoggedInUser().User,
|
|
new ForwardReceiptData
|
|
{
|
|
IgnoreCallbacks = true,
|
|
CreateReceiptData = new CreateReceiptData
|
|
{
|
|
IgnoreCallbacks = true,
|
|
},
|
|
CreateReceiptItemsFromExistingItemsData = new List<CreateReceiptItemsFromExistingItemsData>
|
|
{
|
|
new()
|
|
{
|
|
IgnoreCallbacks = true,
|
|
},
|
|
},
|
|
},
|
|
new List<ReceiptToForward>
|
|
{
|
|
new()
|
|
{
|
|
ReceiptKind = CentronObjectKindNumeric.OfferClass,
|
|
ReceiptI3D = OfferI3D
|
|
}
|
|
},
|
|
null,
|
|
takeoverOption,
|
|
onlyTakeoverAvailableQuantity: false,
|
|
ignoreDefaultContract: false).ThrowIfError();
|
|
|
|
var order = (ReceiptOrderDTO)forwardResult.Receipt;
|
|
var orderItem = order.Items.First(f => f.ArticleI3D == 2);
|
|
|
|
this.Verifier.Verify(takeoverOption.ToString(), new { orderItem.PurchaseOrderNumber, orderItem.PurchaseInformations });
|
|
}
|
|
} |